SlackWiki swikidb https://www.slackwiki.com/Main_Page MediaWiki 1.40.0 first-letter Media Special Talk User User talk SlackWiki SlackWiki talk File File talk MediaWiki MediaWiki talk Template Template talk Help Help talk Category Category talk Main Page 0 1 1 2009-05-24T17:46:17Z MediaWiki default 0 wikitext text/x-wiki <big>'''MediaWiki has been successfully installed.'''</big> Consult the [http://meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software. == Getting started == * [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list] * [http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ] * [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list] bd962048d95fbb6b6b514885867811db20a5476b 2 1 2009-05-24T17:56:03Z Erik 1 wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 4ba83ac81d0d82c96dc0d480b6547fe731b1ba9c 3 2 2009-05-24T18:27:07Z Erik 1 wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==NOTICE== After a long time and numerous upgrades, the DB finally caved in on itself. This is a fresh start. [http://slackwiki.org/old/ The old Wiki can be found here.] Don't bother trying to log in to the old Wiki or creating new users. The data is still there, you need to use the Search box to find it. Any help copying the old data over here to the new Wiki would be greatly appreciated. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 6e149165aa3721cc94cb42a609aded6fcc517a4d 40 3 2009-05-28T23:59:01Z Erik 1 Protected "[[Main Page]]" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==NOTICE== After a long time and numerous upgrades, the DB finally caved in on itself. This is a fresh start. [http://slackwiki.org/old/ The old Wiki can be found here.] Don't bother trying to log in to the old Wiki or creating new users. The data is still there, you need to use the Search box to find it. Any help copying the old data over here to the new Wiki would be greatly appreciated. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 6e149165aa3721cc94cb42a609aded6fcc517a4d User:Erik 2 2 4 2009-05-24T18:37:55Z Erik 1 Creating my user page. wikitext text/x-wiki Real Name: Erik Hanson<br> EMail: [mailto:erik@slackbuilds.org erik@slackbuilds.org]<br> IRC: erik @ [irc://frop.taphouse.org/ Taphouse Cabal] and [irc://chat.freenode.net The Freenode Network]<br> 24429ee81cdb6c9bc029cbf76178404e9f4da624 Links 0 3 5 2009-05-24T18:39:14Z Erik 1 Manual copy of old data. wikitext text/x-wiki ==Slackware Links== * http://www.slackware.com - the home of Slackware * http://www.slackwaregallery.com - our ugly mugs :) * ftp://termserver.niesc.org/pub/sandman1 - Packages mostly by [[User:Sandman1|Sandman1]] * http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ - Slackware FAQ by [[User:juhl|juhl]] (Jesper Juhl) * http://slackware.wordpress.com - Slackware Blog by [[User:Tyler|Tyler]] * http://www.slackbook.org - updated version of the slackware book * http://fredemmott.co.uk/rss.php - RSS feeds for slackware 10 patches and the slackware-current ChangeLog * http://slackware.it/en/rss - RSS feeds for stable Slackware release and -current ChangeLog * http://userlocal.com/ - A focal point for the online Slackware Linux community * http://www.slackware.com/getslack - Extensive listing of Slackware mirrors * http://www.slackbasics.org/ - "Slackware Linux Basics" by Daniel de Kok * http://uselesstree.org/ - The Complete Slacker * http://shilo.is-a-geek.com/ - Shilo's tutorial * http://www.linuxquestions.org/questions/forumdisplay.php?forumid=14 - Slackware forum * http://www.kde-look.org/content/show.php?content=23384 - Slack-Track - a superkaramba theme to track the slackware-current changelog on your desktop, created by [[User:omal|omal]] * http://www.slacklife.com.br - Slackware Brazillian Community - by [[User:Redhate|redhate]] * http://www.slackware-peru.org - Slackware Peruvian Community - by [[User:R1CHARD|R1CHARD]] * http://slackware.linux.or.id - Indonesian Slackware Community - by [[User:Willysr|Willysr]] * http://open-eslack.org/ - Spanish Slackware community ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs * http://www.themedepot.org/ - Generalized theme site for X11 based programs ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==Free packages== * [http://slackware.com/~alien/ http://slackware.com/~alien/] Eric Hameleers' packages * [http://rlworkman.net/pkgs/ http://rlworkman.net/pkgs/] rworkman's packages * http://www.linuxpackages.net/ * [http://www.slacky.eu/repository/slackware-11.0/ Slacky.eu] Italian Slackware site * [http://www.audioslack.com/packages/ Audioslack.com] Audio software packages * [http://straterra.info/Packages/ http://straterra.info/Packages/] Straterra's packages * [http://www.sekurity.com/packages/ Sekurity.com] dadexter's packages * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware * [http://scxd.info/en/ Slackware Current eXtended Desktop] Packages for Slackware Current * [ftp://termserver.niesc.org/ ftp://termserver.niesc.org] Sandman1's packages ==.SlackBuild Repositories== * http://slackbuilds.org - The SlackBuilds.org Project * http://slackbuilds.net - The French SlackBuilds Repository * http://www.slackware.com/~alien/slackbuilds/ - Eric "Alien" Hameleer's SlackBuilds * http://contrib.slamd64.com - [http://contrib.slamd64.com buildcontrib] can build and fetch these packages for you. Primarily for Slamd64, but work on x86 as well * http://slackbuild.strangeworlds.co.uk - cathectic's SlackBuilds * http://slackbuilds.rlworkman.net - robw810's SlackBuild scripts * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. * http://textlinux.slackadelic.com/slackbuilds/ - A repository dedicated to command line (friendly) applications * http://scxd.info/pub/slackbuilds/ - Slackware Current eXtended Desktop's SlackBuilds ==Live CD's based on Slackware== * [http://www.remote-exploit.org/index.php/Main_Page BackTrack] The result of the merging of two Innovative Penetration Testing live Linux distributions: Whax and Auditor * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://alien.slackbook.org/ Alien Bob's Wiki] * http://open-eslack.org/wiki/ - Wiki of the Slackware spanish community * http://slackware.linux.or.id/wiki/ - Indonesian Slackware Wiki 8271d339b511427cd1e362edd6dcc24261818372 35 5 2009-05-28T21:38:59Z 94.192.0.60 0 /* Slackware Links */ wikitext text/x-wiki ==Slackware Links== * http://www.slackware.com - the home of Slackware * http://www.slackwaregallery.com - our ugly mugs :) * ftp://termserver.niesc.org/pub/sandman1 - Packages mostly by [[User:Sandman1|Sandman1]] * http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ - Slackware FAQ by [[User:juhl|juhl]] (Jesper Juhl) * http://slackware.wordpress.com - Slackware Blog by [[User:Tyler|Tyler]] * http://www.slackbook.org - updated version of the slackware book * http://fredemmott.co.uk/rss.php - RSS feeds for slackware 10 patches and the slackware-current ChangeLog * http://slackware.it/en/rss - RSS feeds for stable Slackware release and -current ChangeLog * http://userlocal.com/ - A focal point for the online Slackware Linux community * http://www.slackware.com/getslack - Extensive listing of Slackware mirrors * http://www.slackbasics.org/ - "Slackware Linux Basics" by Daniel de Kok * http://uselesstree.org/ - The Complete Slacker * http://shilo.is-a-geek.com/ - Shilo's tutorial * http://www.linuxquestions.org/questions/forumdisplay.php?forumid=14 - Slackware forum * http://www.kde-look.org/content/show.php?content=23384 - Slack-Track - a superkaramba theme to track the slackware-current changelog on your desktop, created by [[User:omal|omal]] * http://www.slacklife.com.br - Slackware Brazillian Community - by [[User:Redhate|redhate]] * http://www.slackware-peru.org - Slackware Peruvian Community - by [[User:R1CHARD|R1CHARD]] * http://slackware.linux.or.id - Indonesian Slackware Community - by [[User:Willysr|Willysr]] * http://open-eslack.org/ - Spanish Slackware community * http://sbopkg.org - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs * http://www.themedepot.org/ - Generalized theme site for X11 based programs ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==Free packages== * [http://slackware.com/~alien/ http://slackware.com/~alien/] Eric Hameleers' packages * [http://rlworkman.net/pkgs/ http://rlworkman.net/pkgs/] rworkman's packages * http://www.linuxpackages.net/ * [http://www.slacky.eu/repository/slackware-11.0/ Slacky.eu] Italian Slackware site * [http://www.audioslack.com/packages/ Audioslack.com] Audio software packages * [http://straterra.info/Packages/ http://straterra.info/Packages/] Straterra's packages * [http://www.sekurity.com/packages/ Sekurity.com] dadexter's packages * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware * [http://scxd.info/en/ Slackware Current eXtended Desktop] Packages for Slackware Current * [ftp://termserver.niesc.org/ ftp://termserver.niesc.org] Sandman1's packages ==.SlackBuild Repositories== * http://slackbuilds.org - The SlackBuilds.org Project * http://slackbuilds.net - The French SlackBuilds Repository * http://www.slackware.com/~alien/slackbuilds/ - Eric "Alien" Hameleer's SlackBuilds * http://contrib.slamd64.com - [http://contrib.slamd64.com buildcontrib] can build and fetch these packages for you. Primarily for Slamd64, but work on x86 as well * http://slackbuild.strangeworlds.co.uk - cathectic's SlackBuilds * http://slackbuilds.rlworkman.net - robw810's SlackBuild scripts * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. * http://textlinux.slackadelic.com/slackbuilds/ - A repository dedicated to command line (friendly) applications * http://scxd.info/pub/slackbuilds/ - Slackware Current eXtended Desktop's SlackBuilds ==Live CD's based on Slackware== * [http://www.remote-exploit.org/index.php/Main_Page BackTrack] The result of the merging of two Innovative Penetration Testing live Linux distributions: Whax and Auditor * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://alien.slackbook.org/ Alien Bob's Wiki] * http://open-eslack.org/wiki/ - Wiki of the Slackware spanish community * http://slackware.linux.or.id/wiki/ - Indonesian Slackware Wiki 6eaac0eab73d62a30ee370f4ebd309a261a2ab26 The Regulars 0 4 6 2009-05-24T18:40:55Z Erik 1 Manual copy of old data. wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:cpunches|cpunches]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please post a message on my [[User_talk:FredEmmott|user talk]] page if you think you'd be a suitable admin. 5adf8b6c951b7ab01e0a5121ec4bc936da384364 20 6 2009-05-28T11:57:58Z Chopp 10 /* Others */ wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:cpunches|cpunches]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:chopp|chopp]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please post a message on my [[User_talk:FredEmmott|user talk]] page if you think you'd be a suitable admin. aaee4553956c07f975dedb6ea969992f44bf59fa Category:Information 14 5 7 2009-05-24T19:25:33Z Erik 1 Manual copy of old data. wikitext text/x-wiki Pages containing general information related to Slackware. Please [[Special:Userlogin|LOG IN]] before adding/editing pages. 2f0e70b3d25250b938b437fac06c9aa25fdfc655 45 7 2009-05-29T00:01:45Z Erik 1 wikitext text/x-wiki Pages containing general information related to Slackware. If you create a page and want it listed in this category, add [[Category:Information]] to the top. Please [[Special:Userlogin|LOG IN]] before adding/editing pages. 308bd427685341bd64adceb68a9c7c438e23bbb0 46 45 2009-05-29T00:03:03Z Erik 1 Undo revision 45 by [[Special:Contributions/Erik|Erik]] ([[User talk:Erik|Talk]]) wikitext text/x-wiki Pages containing general information related to Slackware. If you create a page and want it listed in this category, add <nowiki>[[Category:Information]]</nowiki> to the top. Please [[Special:Userlogin|LOG IN]] before adding/editing pages. a38debf8c9fa35c7d4c7c9482db299754b86e857 47 46 2009-05-29T00:03:14Z Erik 1 Protected "[[Category:Information]]" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) wikitext text/x-wiki Pages containing general information related to Slackware. If you create a page and want it listed in this category, add <nowiki>[[Category:Information]]</nowiki> to the top. Please [[Special:Userlogin|LOG IN]] before adding/editing pages. a38debf8c9fa35c7d4c7c9482db299754b86e857 Category:Tutorials 14 6 8 2009-05-24T19:26:05Z Erik 1 Manual copy of old data. wikitext text/x-wiki This is the spot for Tutorials. If you create a page and want it listed in this category, add <nowiki>[[Category:Tutorials]]</nowiki> to the top. Please [[Special:Userlogin|LOG IN]] before adding/editing pages. 59c03b97d7b902729522b0351f98efe234613913 12 8 2009-05-28T08:42:07Z Ibm5 25 8 Added CPU Freq Scale wikitext text/x-wiki This is the spot for Tutorials. If you create a page and want it listed in this category, add <nowiki>[[Category:Tutorials]]</nowiki> to the top. Please [[Special:Userlogin|LOG IN]] before adding/editing pages. [[CPU Frequency Scaling]] 96174eef54122de4d7998d37f28dd0a36080dab1 14 12 2009-05-28T08:43:11Z Ibm5 25 8 CPU Freq Scale, 2x wikitext text/x-wiki This is the spot for Tutorials. If you create a page and want it listed in this category, add <nowiki>[[Category:Tutorials]]</nowiki> to the top. Please [[Special:Userlogin|LOG IN]] before adding/editing pages. 59c03b97d7b902729522b0351f98efe234613913 41 14 2009-05-28T23:59:17Z Erik 1 Protected "[[Category:Tutorials]]" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) wikitext text/x-wiki This is the spot for Tutorials. If you create a page and want it listed in this category, add <nowiki>[[Category:Tutorials]]</nowiki> to the top. Please [[Special:Userlogin|LOG IN]] before adding/editing pages. 59c03b97d7b902729522b0351f98efe234613913 Category:Tips 14 7 9 2009-05-24T19:26:32Z Erik 1 Manual copy of old data. wikitext text/x-wiki This is the spot for Tips and other bits of useful information. If you create a page and want it listed in this category, add <nowiki>[[Category:Tips]]</nowiki> to the top. 03866c694922986b45916c5c5a98b7d62a077894 42 9 2009-05-28T23:59:39Z Erik 1 Protected "[[Category:Tips]]" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) wikitext text/x-wiki This is the spot for Tips and other bits of useful information. If you create a page and want it listed in this category, add <nowiki>[[Category:Tips]]</nowiki> to the top. 03866c694922986b45916c5c5a98b7d62a077894 Category:Security 14 8 10 2009-05-24T19:27:05Z Erik 1 Manual copy of old data. wikitext text/x-wiki Security related articles and Iptables scripts. No scripts generated by tools here please (unless of course you made it yourself, in which case, please only one). Add <nowiki>[[Category:Security]]</nowiki> to the very bottom of your script to have it appear on this page. 1070b9940e92c80b49a252e273ccc1e1a583b721 43 10 2009-05-28T23:59:54Z Erik 1 Protected "[[Category:Security]]" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) wikitext text/x-wiki Security related articles and Iptables scripts. No scripts generated by tools here please (unless of course you made it yourself, in which case, please only one). Add <nowiki>[[Category:Security]]</nowiki> to the very bottom of your script to have it appear on this page. 1070b9940e92c80b49a252e273ccc1e1a583b721 Category:Hardware 14 9 11 2009-05-24T19:27:33Z Erik 1 Manual copy of old data. wikitext text/x-wiki This is the spot for Hardware and other related bits of useful information regarding installing and/ or configuring Slackware on certain hardware. If you create a page and want it listed in this category, add <nowiki>[[Category:Hardware]]</nowiki> to the top. Please [[Special:Userlogin|LOG IN]] before adding/editing pages. eb4b86de8b7554049a855e39a0fc4a2bb8c55e50 44 11 2009-05-29T00:00:11Z Erik 1 Protected "[[Category:Hardware]]" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) wikitext text/x-wiki This is the spot for Hardware and other related bits of useful information regarding installing and/ or configuring Slackware on certain hardware. If you create a page and want it listed in this category, add <nowiki>[[Category:Hardware]]</nowiki> to the top. Please [[Special:Userlogin|LOG IN]] before adding/editing pages. eb4b86de8b7554049a855e39a0fc4a2bb8c55e50 CPU Frequency Scaling 0 10 13 2009-05-28T08:42:37Z Ibm5 25 8 Copied from /old wikitext text/x-wiki The CPU frequency scaling feature present in modern computers allows lowering and increasing the processor speed dynamically in runtime so as to save energy while having the possibility of increasing the performance and power consumption if needed. Activating CPU frequency scaling under Slackware is very easy, and requires loading a minimum of two kernel modules and running a simple command. On the one hand, you need to load a specific CPU driver that will activate the frequency scaling feature in your platform. Second, you need to choose a CPU frequency scaling governor, a module that will decide how and when to change the internal processor speed. There are governors to always run at full speed, governors to always run at low speed, governors to increase and decrease the speed based on the CPU load, etc. It's usually desired to activate CPU frequency scaling as early as possible in the boot process, eventhough a few seconds running at full power are not that important. The easier way is, however, to enable it from the boot script <tt>/etc/rc.d/rc.local</tt>, which is executed right at the end of the boot process. Other approaches need more intrusive changes. You could load the required modules and run the commands from a modified init script of an initial RAM disk. You could do the same from a personal <tt>/etc/rc.d/rc.modules.local</tt>, or also from the already mentioned <tt>rc.local</tt>. It's up to you to decide when and where to load and activate the feature. = Loading CPU specific drivers = You first need to load one of the available CPU powersaving modules. They are included in the typical kernel module packages, and depend on the type of CPU you have. Every available module will be located in <tt>/lib/modules/$( uname -r )/kernel/arch/i386/kernel/cpu/cpufreq</tt>. For example, my CPU is a K8 processor and I use the <tt>powernow-k8</tt> module. Inside that directory you will see a lot of module files ending with <tt>.ko</tt>. To load them, use <tt>/sbin/modprobe</tt> followed by the name before the suffix, from any location. Example: /sbin/modprobe powernow-k8 If you're not sure about which driver you need, proceed by trial and error. Load one module with a command like the previous one and then check the last lines of <tt>dmesg</tt> with the command <tt>dmesg | tail</tt>. If you see a successful detection, that's the module you need. If not, unload the module with <tt>/sbin/modprobe -r</tt> (example: <tt>/sbin/modprobe -r powernow-k8</tt>) and try another one. This is an example of successful output as printed by <tt>dmesg | tail</tt>: powernow-k8: Found 1 Mobile AMD Sempron(tm) Processor 3000+ processors (version 2.00.00) powernow-k8: 0 : fid 0xa (1800 MHz), vid 0x8 powernow-k8: 1 : fid 0x8 (1600 MHz), vid 0xa powernow-k8: 2 : fid 0x0 (800 MHz), vid 0x13 = Loading a governor module = The second step is to load a governor module. The governor most people will want to load is the one named <em>ondemand</em>, that will always use the lowest frequency available to fullfill the processing requirements. If your computer is idle, it will put the processor in the lowest possible speed. If you perform a very CPU-intensive task, it will increase the frequency accordingly. It's also the governor that Intel recommends to use in its laptops. All the available governor modules are located in <tt>/lib/modules/$( uname -r )/kernel/drivers/cpufreq</tt>. To use a governor, the first step is to load its corresponding module as we did previously with the CPU module. Example: /sbin/modprobe cpufreq_ondemand Notice how the governor is called <em>ondemand</em>, yet its module is called <em>cpufreq_ondemand</em>. = Setting the CPU scaling governor = Loading a governor module doesn't mean it's going to be used immediately. In fact, you can load all governor modules if you want. To decide which governor will be used in a given moment, you need to set it at runtime. Each CPU can have its own governor. That is, if you have a dual core machine, you can put one of the cores in low power and other one in full power if you need it. However, the most usual case is to use the same governor in all CPUs. Each CPU has its own configuration file in the <tt>/sys</tt> filesystem. For example, the file for the first CPU is called <tt>/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor</tt>. For other CPUs, increase the digit in <tt>cpu0</tt>. You can set a governor name for all of them at the same time using a shell loop like the one in this example, that sets the <em>ondemand</em> governor for every CPU: for config_file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo ondemand >$config_file done To confirm you have successfully set the governor, see if it scales the CPU frequency. From an idle system, run <tt>grep '^cpu MHz' /proc/cpuinfo</tt>. You should see one or more lines like: cpu MHz : 800.000 Then, launch a CPU intensive task from a different terminal, like <tt>yes >/dev/null</tt> and then run the previous command again. You should now see a higher number (1800.000 in my case) in at least one of the output lines. If you see the same number wait 5 seconds and try again. = Putting it all together = This can be made as sophisticated as you decide, but let's suppose you opt for the simple approach of setting everything up from <tt>rc.local</tt>. You would add the following commands if your CPU needed the module <em>powernow-k8</em> and you wanted to set the <em>ondemand</em> governor: /sbin/modprobe powernow-k8 /sbin/modprobe cpufreq_ondemand for config_file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo ondemand >$config_file done [[Category:Tutorials]] 5eb801f9de521638190518da9fc1842c9b05d0f0 User talk:Ibm5 25 3 11 15 2009-05-28T08:45:40Z Ibm5 25 8 Created page with '[[ThinkPad X61s]]' wikitext text/x-wiki [[ThinkPad X61s]] 385af5e4906f196500a0c7e91212474e1eeb3f78 17 15 2009-05-28T08:47:16Z Ibm5 25 8 wikitext text/x-wiki [[Minimal_System]] adfbd76592ebe95aaed9e000115f4f829af148c7 ThinkPad X61s 0 12 16 2009-05-28T08:46:01Z Ibm5 25 8 from /old wikitext text/x-wiki [[Category:Hardware]] == Specs == Note: There are several different models, and Lenovo offer customization in some countries. This is just what I have. Bus IDs are provided when I can't find more details on the model. * CPU: Intel Core 2 Duo L7500 @ 1.60Ghz * RAM: 1GB PC2-3500 DDR2 * Graphics: Intel Graphics Media Accelerator X3100 (i965) * Display: 12.1" 1024x768 TFT * Hard Drive: 120GB Hitatchi SATA drive * Audio: AD1984 Intel HD Audio * LAN: Intel 82566MM Gigabit Ethernet * WLAN: Intel 3945 ABG * WWAN: Sierra Wireless (Internal USB, ID: 1199:6813) * Bluetooth: Broadcom Corp. (Internal USB, ID: 0a5c:2110) * Fingerprint reader: SGS Thomson Microelectronics Fingerprint Reader * USB: 4 UHCI controllers, 2 EHCI controllers, 3 ports. Intel 82801H (ICH8 Family) * Firewire: Ricoh Co Limited - Unknown device (PCI ID: 1180:0832) * SD Card reader: Ricoh Co Ltd R5C822 * Pointing device: TrackPoint - "nipple mouse" == Notes == If you plan on keeping Vista, don't use it's built in NTFS resizer. This will only free up around 30GB of space, instead of the more than 60 you can free up with other tools. I used a proprietary Windows application, [http://www.partition-manager.com Paragon Partition Manager], however Parted and ntfs_resize are reported to have no problems. I'd advise not using Partition Magic, as it officially doesn't support Vista. I would advise not deleting the first partition, as it is the recovery partition. I would also advise not installing your bootloader to the MBR without backing up the MBR first, as it isn't a standard MBR. CDMA WWAN devices *MUST* be activated from Windows; GSM/UMTS devices don't need activating. For both types of WWAN, the on-screen 'activation information' isn't complete - the full information is on a sticker on the underside of the laptop. If when running lilo, you get an error out the partition table being invalid, and asking you to FIX or IGNORE, "lilo -P fix" worked for me, and I can still boot Windows fine. "lilo -P ignore" is safer, but may not work. Also, I installed Slamd64, not Slackware. I will note anywhere where I believe there's likely to be a difference. == Installing == There's 4 choices: * Normal install from UltraBay DVD drive in UltraBase (docking station) * Normal install from USB DVD drive - there's reportedly been mixed success with this though * PXE + NFS install * USB + NFS install I created the USB/PXE installer initrd for Slamd64 (Slackware 12.0 includes one already), and went for the PXE + NFS option. There is already good documentation for how to install Slackware like this. You should start the installer with the hugesmp.s kernel, and install it, until you've made a suitable initrd for booting from another kernel. == Kernel == I'd strongly recommend going for the latest kernel from kernel.org - this is a very new laptop, and not properly supported in older kernels. You also probably want to patch it a bit. I used 2.6.22.2 === Patches === Some of these were hard to find, so I've put them at [http://files.fredemmott.co.uk/X61s]. * hdaps_protect-2.6.19.patch.gz - allows userspace to park the hard disk heads. Required for the accelerometer-based hard-drive shock protection to work * thinkpad-acpi-0.15-20070723_x2.6.22.1.patch.gz - required for advanced power management, bluetooth, and the soundcard - doesn't quite apply cleanly, find -name "*.rej" in your source tree and apply the remaining changes manually. * alsa-git-2007-07-20.patch.gz - required for the sound card * enablec3.patch.gz - allows the CPU to enter a lower CPU sleep state If you have in-built WWAN, you also will need to do minor changes to drivers/usb/serial/sierra.c: # Find the two lines containing: <pre>USB_DEVICE(0x1199, 0x6812)</pre> # Copy them to the next line, changing 0x6812 to 0x6813 # Change the comment to something descriptive, like: <pre>/* Thinkpad X61s unknown card */</pre> === Config === I based mine off hugesmp.s's config: <pre> zcat /proc/config.gz > .config make oldconfig </dev/null </pre> I also turned on the following options (paths given are for the tree structure in menuconfig): * Processor type and features/Support for suspend on SMP and hot-pluggable CPUs - CONFIG_HOTPLUG_CPU; this is required for suspend to RAM to function correctly, and lets you turn off the second core to save power. * Networking/Wireless/Generic IEEE 802.11 Networking Stack (mac80211) - CONFIG_MAC80211; this is required for the newer of the two WLAN drivers. I recommend making this a module. * Device drivers/Misc devices/ThinkPad ACPI Laptop Extras - CONFIG_THINKPAD_ACPI; this is required for sound, bluetooth, and advanced power saving, and used to be "ibm-acpi" instead of "thinkpad-acpi". I recommend making this a module, and turning on 'Enable input layer support by default' (CONFIG_THINKPAD_ACPI_INPUT_ENABLED). == rc.modules.local == Unless noted otherwise, this is where modules should be loaded from. Keep in mind that if this file is present and +x, rc.modules is not called. For this reason, my rc.modules.local starts with: <pre> #!/bin/sh if [ -x /etc/rc.d/rc.modules ]; then /etc/rc.d/rc.modules fi </pre> This file should be +x, and belongs in /etc/rc.d/. == Hard Drive Impact Protection == The laptop contains hardware to detect a fall, and to park the hard disk drive heads. You need the a kernel patched with the hdaps_protect patch described above. # Download [http://sourceforge.net/project/showfiles.php?group_id=1212 tp_smapi] # Extract it # make HDAPS=1 # make install HDAPS=1 Add the following to /etc/rc.d/rc.modules.local: <pre> /sbin/modprobe hdaps /sbin/modprobe tp-smapi </pre> If you wish to use the joystick device provided by the tilt sensors, one of the axis is inverted. This can be fixed by changing the function 'transform_axes' in hdaps.c to the following, before running 'make': <pre> static void transform_axes(int *x, int *y) { if (hdaps_invert) *x = -*x; else *y = -*y; } </pre> Impact protection requires a user-space daemon, hdapsd: # Download [http://files.fredemmott.co.uk/X61s/hdapsd-20070524.c hdapsd-20070524.c] # gcc -o /usr/local/sbin/hdapsd hdapsd-20070524.c # Add the following to /etc/rc.d/rc.local: <pre>/usr/local/sbin/hdapsd -d sda -s 30 -b</pre> === KHDAPSMonitor === KHDAPSMonitor is a KDE system-tray applet that indicates the status of the hard disk parking. Eric Hameleers has made [http://www.slackware.com/~alien/slackbuilds/khdapsmonitor/pkg/12.0/ a package] and [http://www.slackware.com/~alien/slackbuilds/khdapsmonitor/build/ SlackBuild script]. == XOrg == xorgconfig should give you a working configuration. You want to use the 'intel' graphics driver. === Multiple Monitors === xrandr 1.2 can handle this fine; there's two "gotchas": * You must provide a large enough virtual screen - I have 'Virtual 3000 1600' in my "Display" Subsection * Only modes with horizontal and vertical refresh rates in the ranges specified in your xorg.conf screen section will be accepted. Making these ranges really large appears to have no ill effects. (I'm currently using HorizSync 10-100, and VertRefresh 30-70). Once you've got the above done, and restarted X, it's easy to add enough screen once X is running: * xrandr --output TV --off * xrandr # get a list of modes * xrandr --output VGA --mode XRESxYRES For example, "xrandr --output VGA --mode 1280x1024". If you want Xinerama, instead of cloning, replace the last line with: * xrandr --output VGA --mode XRESxYRES --left-of LVDS Other valid options are --right-of, --above, and --below. === DRI === This works fine, as long as you've upgraded mesa; it's unstable and crashes with the version included in Slackware, however, upgrading to mesa 7.0.1 fixes this. == TrackPoint == The TrackPoint 'just works' as a basic mouse, however, it can do better :) For enhanced support: Add the following to /etc/rc.d/rc.modules.local (the psmouse driver doesn't recognize it as a TrackPoint the first time): <pre> /sbin/rmmod psmouse /sbin/modprobe psmouse </pre> Add the following to /etc/rc.d/rc/local: <pre>echo 1 > /sys/devices/platform/i8042/serio1/press_to_select</pre> I have the following as the relevant "InputDevice" section in my xorg.conf, which lets you hold down the middle mouse button to scroll: <pre> Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "ExplorerPS/2" # IMPS/2 is not recommend for TrackPoints Option "Device" "/dev/input/mice" Option "EmulateWheel" "on" Option "EmulateWheelTimeout" "200" Option "EmulateWheelButton" "2" Option "YAxisMapping" "4 5" Option "XAxisMapping" "6 7" EndSection </pre> == Card Reader == Add the following to rc.modules.local: <pre> /sbin/modprobe sdhci /sbin/modprobe mmc-block </pre> This card reader is compatible with HAL's media insertion/removal support. == Sound == This uses the snd-hda-intel driver, which should be automatically loaded by udev. If you get silence, check that Speaker output is enabled, and check /proc/acpi/ibm/volume. Without the thinkpad-acpi module loaded, audio is corrupted. == Gigabit Ethernet == This uses the e1000 driver. == Wireless LAN (802.11) == I used the [http://intellinuxwireless.org new iwlwifi driver], version 1.0, and the corresponding iwlwifi-3945-ucode, version 2.14.1.5. Ignore the documentation saying you need to download mac80211 and patch the kernel, this is included in recent kernels. # Download the ucode tarball # Extract it somewhere # Copy iwlwifi-3945-1.ucode to /lib/firmware/iwlwifi-3945.ucode - note the filename change # Download the iwlwifi driver tarball # Extract it # make; make install Add the following to rc.modules.local: <pre> /sbin/modprobe iwl3945 </pre> When this module is loaded, the WLAN device is wlan0. == Wireless WAN (EVDO/UMTS) == These instructions based on the UK Vodafone 3G card. I believe the US Cingular/Verizon cards should be very similar; check the USB IDs though. Add the following to rc.modules.local: <pre>/sbin/modprobe usbserial vendor=0x1199 product=0x6813</pre> You should now have /dev/ttyUSB[0-2]. I have [http://files.fredemmott.co.uk/X61s/ppp-peers.tar.bz2 modified] the pppd peers scripts that [http://www.sierrawireless.com/faq/ShowFAQ.aspx?ID=601 Sierra provides]. Untar these to /etc/ppp, creating 4 files in /etc/ppp/peers. "gsm" and "gsm_chat" are for GSM/UMTS connections, "cdma" and "cdma_chat" are for CDMA devices. For GSM/UMTS, if you aren't using Vodafone, you must change the APN in gsm_chat. I am unsure about the configuration of CDMA. To connect, type "pppd call gsm" for GSM/UMTS, or "pppd call cdma" for cdma. == ACPI == I'm assuming you've patched your kernel and build thinkpad-acpi as a module. To enable basic ACPI functionality, add the following to /etc/rc.d/rc.modules.local: <pre> /sbin/modprobe nvram /sbin/modprobe ac /sbin/modprobe battery /sbin/modprobe button /sbin/modprobe acpi-cpufreq /sbin/modprobe cpufreq-ondemand /sbin/modprobe thinkpad-acpi </pre> If you wish to use any of the ACPI action scripts below: #Download [http://files.fredemmott.co.uk/X61s/acpi_handler.sh] as /etc/acpi/acpi_handler.sh #<pre>chmod +x /etc/acpi/acpi_handler.sh</pre> === CPU Frequency Scaling === To enable on-demand frequency scaling: <pre>echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor</pre> Changing the cpufreq settings for one core affects both. cpu1's cpufreq directory is actually a symlink to cpu0's. Intel recommend ondemand, and believe it to be more power-efficient than 'powersave'. === Suspend to RAM === Add the following to the Linux section of your /etc/lilo.conf, otherwise you'll have a black screen when resuming: <pre>append = "acpi_sleep=s3_bios"</pre> Run lilo and reboot. To sleep, download [http://files.fredemmott.co.uk/X61s/sleep]. This script is based on one from [http://www.thinkwiki.org ThinkWiki]. If you want to go to sleep based on ACPI events, such as closing the lid or pressing the sleep button (Fn-F4): # Save the above 'sleep' script as /etc/acpi/actions/sleep # <pre>chmod +x /etc/acpi/actions/sleep</pre> # For Fn-F4 to work, run the following and add it to /etc/rc.d/rc.local: <pre>echo 808 > /proc/acpi/ibm/hotkey</pre> 808 is a modification of the default bitmask, telling thinkpad-acpi to pass the Fn-F4 event to the ACPI userspace, instead of dealing with it itself, AKA ignoring it. === Suspend to Disk === This works fine, just change the above 'sleep' script to echo "disk" instead of echo "ram". === Adjust Screen Brightness on AC Status Change === # Download [http://files.fredemmott.co.uk/X61s/ac] as /etc/acpi/actions/ac # chmod +x /etc/acpi/actions/ac The brightness levels used on battery and ac are adjusted by two variables at the top of that script. You might also want to add /etc/acpi/actions/ac to /etc/rc.d/rc.local, so that the appropriate brightness is set on boot. == PCMCIA/CardBus == This works fine, and should 'just work'. It uses the yenta_socket driver. === Fingerprint Reader === This works fine on a PAMified system, using the 'thinkfinger' driver. I've not tried the closed source driver. You can also use it instead of a BIOS password if you configure it from Windows. == Not Tested == === Firewire === I don't have any firewire devices, so I've not tested this. It is however detected by the kernel, and appears to be supported. === BlueTooth === I've just not got round to testing this yet. /proc/acpi/ibm/bluetooth enables/disabled it. When it's disabled, it doesn't appear on the USB bus. When enabled, and the wireless kill switch is off, it is detected by the hciusb driver. === UltraBase/UltraBay DVD Drive === I don't own this hardware. Reportedly it's a standard IDE drive, and hotplugging works. === Modem === Got no use for it. == Not Working == === Screen Brightness Buttons === Screen brightness can be controlled via /proc/acpi/ibm/brightness == External sources == * [http://www.thinkwiki.org/ ThinkWiki - Linux Thinkpad Wiki] - Tons of information about installing various Linux distributions on IBM/Lenovo Thinkpads 4764ce8d9fb4fa4e586c0cc8f28cc2159826d8a8 Minimal System 0 13 18 2009-05-28T08:47:43Z Ibm5 25 8 Created page with '[[Category:Tutorials]] ''by Niki Kovacs, September 2007'' === Introduction === Once in a while, the question arises on AOLS or in some forum: what packages should I install t...' wikitext text/x-wiki [[Category:Tutorials]] ''by Niki Kovacs, September 2007'' === Introduction === Once in a while, the question arises on AOLS or in some forum: what packages should I install to have a ''base system''? Well, one could argue about what is meant. While some folks run no more than a kernel, a libc and a handful of packages on their servers stripped down to the bare bones, others might find such a configuration useful in the sense that chickens fly and horses swim. Some facts and figures: * A "base" install of [http://www.linuxfromscratch.org Linux From Scratch] consists of a little more than 50 packages. * [http://www.archlinux.org Arch Linux]' [base] system has exactly 92 packages. * A "minimal" install of [http://www.centos.org CentOS 5.0] (all software categories unselected) counts as much as 393 packages. Conclusion: "''Il y a fagots et fagots''" (Molière, Le Médecin Malgré Lui) The package choice suggested on this page is of course highly subjective. It's also the result of a simple pragmatic approach. So far, I'm using Slackware in the following situations: * Database server * Web server (Apache/PHP/MySQL) * File server * CUPS print server * SANED scanner server * Streaming media server (MPD/Icecast) Here, the "base system" would simply boil down to the common denominator of packages installed in all these different scenarios. Something like: * A bootable, coherent system (no missing libs or scripts) * A Bash shell * A SMP kernel and what's necessary to rebuild it. * Development tools to build the odd package from source * Networking * A selection of tools for system administration * No graphical environment * No sound Once the base system is installed, it's easy to manually add the few needed packages depending on the needs: CUPS, Apache, MySQL, ALSA, whatever. Now here's my working base configuration: &nbsp; === Package group [A] === {| border="1" cellspacing="0" cellpadding="5" ! Package ! Short Description ! Long Description |- | '''aaa_base''' | Basic Linux filesystem package | Sets up the empty directory tree for Slackware and adds an email to root's mailbox welcoming them to Linux. :) This package should be installed first, and never uninstalled. |- | '''aaa_elflibs''' | Shared libraries needed by many programs | This is a collection of shared libraries needed to run Linux programs. ELF (Executable and Linking Format) is the standard Linux binary format. These libraries are gathered from other Slackware packages and are intended to give a fairly complete initial set of libraries. This package should be not upgraded or reinstalled (it could copy over newer library versions). |- | '''aaa_terminfo''' | A basic collection of terminfo entries | This is a starter set of files from the terminfo database, which should be enough in most cases. The complete set (from which this is derived) can be found in the ncurses package. The terminfo database describes the characteristics of terminals, so don't try to log in without this package. :-) |- | '''acl''' | Tools for using POSIX Access Control Lists | This package contains a set of tools and libraries for manipulating POSIX Access Control Lists. POSIX Access Control Lists (defined in POSIX 1003.1e draft standard 17) are used to define more fine-grained discretionary access rights for files and directories. |- | '''acpid''' | ACPI daemon | Most modern computers support the Advanced Configuration and Power Interface (ACPI) standard to allow intelligent power management. This package contains acpid, which is the user-space daemon needed in order to make the Linux ACPI support completely functional. ACPI must be compiled into the kernel to run acpid. |- | '''apmd''' | Advanced Power Management daemon | apmd is an APM monitoring daemon, and works in conjunction with the APM BIOS driver in the kernel. Apmd (and the included tools) handle tasks such as automatically putting a laptop into suspend when the power level drop below a certain point. This package also includes the graphical power management tools xapm and xbattery. |- | '''attr''' | Tools for using extended attributes on filesystems | This package contains a set of tools for manipulating extended attributes (name:value pairs associated permanently with files and directories) on filesystem objects, and the library and header files needed to develop programs which make use of extended attributes. Extended attributes are used to provide additional functionality to a filesystem. For example, Access Control Lists ([[ACL]]s) are implemented using extended attributes. |- | '''bash''' | sh-compatible shell | The GNU Bourne-Again SHell. Bash is a sh-compatible command interpreter that executes commands read from the standard input or from a file. Bash also incorporates useful features from the Korn and C shells (ksh and csh). Bash is ultimately intended to be a conformant implementation of the IEEE Posix Shell and Tools specification (IEEE Working Group 1003.2). Bash must be present for the system to boot properly. |- | '''bin''' | Some command-line utilities | The bin package is a collection of miscellaneous command-line utilities. Some of these (such as 'tempfile') are used in system scripts. |- | '''bzip2''' | A block-sorting file compressor | Bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. Compression is generally considerably better than that achieved by more conventional LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors. |- | '''coreutils''' | Core GNU utilities | These are the GNU core utilities, the basic command line programs such as 'mkdir', 'ls', and 'rm' that are needed for the system to run. This package is the union of the GNU fileutils, sh-utils, and textutils packages. Most of these programs have significant advantages over their Unix counterparts, such as greater speed, additional options, and fewer arbitrary limits. |- | '''cpio''' | Backup and archiving utility | This is GNU cpio, a program to manage archives of files. This package also includes mt, a tape drive control program. cpio copies files into or out of a cpio or tar archive, which is a file that contains other files plus information about them, such as their pathname, owner, timestamps, and access permissions. The archive can be another file on the disk, a magnetic tape, or a pipe. |- | '''cryptsetup''' | Utility for setting up encrypted filesystems | LUKS is a standard for cross-platform hard disk encryption. It provides secure management of multiple userpasswords and stores setup information in the partition header. LUKS for dm-crypt is now implemented in cryptsetup replacing the original cryptsetup. It provides all the functionally of the original version plus all LUKS features. |- | '''cxxlibs''' | C++ shared library compatibility package | This package contains the shared libraries needed to run dynamically linked C++ binaries linked with older versions of libstdc++. |- | '''dcron''' | Dillon's Cron daemon | The cron daemon runs in the background and executes tasks on behalf of users at the appropriate time. Many timed system tasks are started with cron, such as the nightly indexing with updatedb. |- | '''device-mapper''' | Device mapper for logical volume management | The goal of device-mapper is to support volume management. The driver enables the definition of new block devices composed of ranges of sectors of existing devices. This can be used to define disk partitions or logical volumes. device-mapper is required by LVM2, the Logical Volume Manager. |- | '''devs''' | System device files | This package creates special files in the /dev directory that represent your system's hardware, and a tool (/dev/MAKEDEV) for creating new device files. These files are required to access hardware on a Linux system. |- | '''dialog''' | Display dialog boxes from shell scripts | Dialog is a program to present a variety of questions or display messages using dialog boxes from a shell script. The Slackware package management script "pkgtool" uses this, as do various other menu-driven console scripts. |- | '''dosfstools''' | Tools for working with FAT filesystems | Utilities for creating FAT filesystems (mkdosfs), and for checking and repairing them (dosfsck). |- | '''e2fsprogs''' | --- | Utilities needed to create and maintain ext2 and ext3 filesystems. |- | '''eject''' | A tool to eject removable media | Eject allows removable media (typically a DVD, CD, floppy disk, tape, etc.) to be ejected under software control. The command can also control some multi-disc changers, the auto-eject feature supported by some devices, and can close the disc tray of some drives. |- | '''elvis''' | --- | Elvis is a text editor. It is intended to be a modern replacement for the classic ex/vi editor of UNIX fame. Elvis supports many new features, including multiple edit buffers, multiple windows, and a variety of display modes. |- | '''etc''' | System configuration files | System configuration files. The /etc directory is traditionally the location where configuration files are found. |- | '''file''' | A utility to determine file type | This is Ian F. Darwin's 'file' utility, used to identify files. |- | '''findutils''' | Utilities to locate files | This package contains the GNU find and xargs programs. The find and xargs implementations comply with POSIX 1003.2. They also support some additional options, some borrowed from Unix and some unique to GNU. |- | '''floppy''' | Floppy disk utilities | Contains fdutils-5.4, tools to test and format floppy disks; and mtools-3.9.8, a collection of utilities for using DOS/Windows floppy disks with Linux. |- | '''gawk''' | Pattern scanning and processing language | Gawk is the GNU Project's implementation of the AWK programming language. It conforms to the definition of the language in the POSIX 1003.2 Command Language And Utilities Standard. This version in turn is based on the description in The AWK Programming Language, by Aho, Kernighan, and Weinberger, with the additional features found in the System V Release 4 version of UNIX awk. Gawk also provides more recent Bell Labs awk extensions, and some GNU-specific extensions. |- | '''gettext''' | --- | The GNU gettext package contains "gettext" and "ngettext", programs that are used to internationalize the messages given by shell scripts. |- | '''glibc-solibs''' | Shared GNU C libraries | This package contains the shared libraries, binaries, and support files required to run most Linux applications linked with glibc. |- | '''glibc-zoneinfo''' | Timezone database | This package allows you to configure your time zone. Use the timeconfig utility to set your local time zone. |- | '''grep''' | Print lines matching a pattern | This is GNU grep, the "fastest grep in the west" (we hope). Grep searches through textual input for lines which contain a match to a specified pattern and then prints the matching lines. |- | '''gzip''' | File compression utility | Gzip reduces the size of the named files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension .gz, while keeping the same ownership modes, access and modification times. |- | '''hdparm''' | Read/set hard drive parameters | hdparm provides a command line interface to various hard disk ioctls supported by the Linux ATA/IDE device driver subsystem. This may be required to enable higher-performing disk modes. |- | '''infozip''' | Info-ZIP's zip and unzip utilities | zip is a compression and file packaging utility for Unix, VMS, MSDOS, OS/2, Windows NT, Minix, Atari and Macintosh, Amiga and Acorn RISC OS. It is analogous to a combination of the UNIX commands tar(1) and compress(1) and is compatible with PKZIP (Phil Katz's ZIP). A companion program unzip(1L)), unpacks zip archives. |- | '''isapnptools''' | ISA Plug-And-Play tools | These programs allow ISA Plug-And-Play devices to be configured on a Linux machine. |- | '''kbd''' | Keyboard maps and console fonts | Load and save keyboard mappings. Needed if you are not using the US keyboard map. This package also contains utilities to change your console fonts - if you install it you'll get a menu later on that lets you select from many different fonts. If you like one, you can make it your default font. A new default font can be chosen at any time by typing 'setconsolefont'. |- | '''kernel-huge-smp''' | A fully-loaded SMP Linux kernel | This is a Linux kernel with built-in support for most disk controllers. If you're looking for a more stripped down kernel (this one contains everything but the kitchen sink ;-), then install the kernel-generic-smp in the /boot directory along with an initrd to load support for your boot device and filesystem. For instructions on the initrd, see README.initrd in the /boot directory. SMP is "Symmetric multiprocessing", or multiple CPU/core support. |- | '''kernel-modules-smp''' | SMP Linux kernel modules | A kernel module is a piece of object code that can be dynamically loaded into the Linux kernel to provide new kernel functions. Most of these modules provide support for devices such as CD-ROM drives, tape drives, and ethernet cards. You can choose which modules to load by editing /etc/rc.d/rc.modules. |- | '''less''' | File pager | Less is a paginator similar to more (1), but which allows backward movement in the file as well as forward movement. Also, less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like vi (1). |- | '''lilo''' | Linux Loader | Generic Boot Loader for Linux ('LInux LOader') by Werner Almesberger. LILO boots Linux from your hard drive. It can also boot other operating systems such as MS-DOS and OS/2, and can even boot DOS from the second hard drive. LILO comes with utilities and documentation that make it easier to install, such as 'liloconfig' and 'QuickStart'. NOTE: Installing boot loaders is inherently dangerous. Be sure to have some means to boot your system from a different media if you install LILO on your hard disk. |- | '''logrotate''' | System log rotation tool | The logrotate utility is designed to simplify the administration of log files on a system which generates a lot of log files. Logrotate allows for the automatic rotation compression, removal and mailing of log files. Logrotate can be set to handle a log file daily, weekly, monthly or when the log file gets to a certain size. Normally, logrotate runs as a daily cron job. |- | '''lvm2''' | Logical Volume Manager version 2 | Heinz Mauelshagen's LVM (Logical Volume Manager) for Linux. LVM adds an additional layer between the physical peripherals and the low-level I/O interface to get a logical view of disks. This allows the concatenation of several disks (so-called physical volumes or PVs) to form a storage pool (so-called Volume Group or VG) with allocation units called physical extents (called PE). With LVM, you can extend, resize, or relocate storage dynamically. |- | '''mdadm''' | Manage RAID arrays | mdadm is a utility program for creating, managing, and monitoring Linux MD (Software RAID) devices. Unlike the older raidtools package, mdadm is a single program (which should make it easier to use). |- | '''module-init-tools''' | Kernel module utilities | Utilities to load and unload kernel modules. These are used on Linux to load extra drivers or other features into the running kernel. |- | '''openssl-solibs''' | OpenSSL shared libraries | These shared libraries provide encryption routines required by programs such as openssh. They are also used by KDE's Konqueror web browser to provide secure web connections. |- | '''patch''' | Apply a diff file to an original file or files | Patch is a utility used to apply diffs (or patches) to files, which are usually source code. |- | '''pciutils''' | PCI utilities | lspci displays detailed information about all PCI buses and devices in the system, replacing the original /proc/pci interface. setpci allows reading from and writing to PCI device configuration registers. For example, you can adjust the latency timers with it. |- | '''pcmciautils''' | Utilities for using PCMCIA cards with 2.6+ kernels | This package provides PCMCIA tools that replace the pcmcia-cs tools used with the 2.4.x Linux kernel. PCMCIA cards are commonly used in laptops to provide expanded capabilities such as network connections, modems, increased memory, and more. |- | '''pkgtools''' | The Slackware package maintenance system | This package contains utilities for handling Slackware packages. Included are the command line utilities 'installpkg', 'removepkg', 'makepkg', 'explodepkg', and 'upgradepkg' that install, remove, build, examine, and upgrade software packages. Also included are 'pkgtool', a menu based program for installing packages, removing packages, or viewing the packages that are installed on the system, documentation (man pages), and a few other system admin scripts. |- | '''procps''' | Utilities for displaying process information | The procps package provides the classic set of utilities used to display information about the processes currently running on the machine. |- | '''quota''' | Linux disk quota utilities | An implementation of the diskquota system for the Linux operating system to keep those greedy users from gobbling up 100% of the hard drive space. Works with ext2, ext3, reiserfs, and xfs filesystems. |- | '''reiserfsprogs''' | --- | These utilities are used for Reiserfs. Reiserfs is a file system based on balanced tree algorithms. |- | '''rpm2tgz''' | A tool for converting an RPM archive into a tar+gz one | Converts RPM format to Slackware's GNU tar + GNU zip format. (view converted packages with "less", install and remove with "installpkg", "removepkg", "pkgtool", or manually with "tar"). Converted packages come with no warranty. ;-) |- | '''sdparm''' | Fetch and change SCSI attributes | sdparm is a utility for listing and potentially changing SCSI disk parameters. More generally it can be used on any device that uses a SCSI command set. Apart from SCSI disks, examples of devices that use SCSI command sets are ATAPI CD/DVD drives, SCSI and ATAPI tape drives and SCSI enclosures. |- | '''sed''' | Stream editor | This is the GNU version of sed, a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). It is sed's ability to filter text in a pipeline which distinguishes it from other types of editors. sed is a required package (it is needed by many system scripts). |- | '''shadow''' | Shadow password suite | This set of login related programs utilizes an alternate, non-readable file to contain the actual encrypted passwords. This is presumed to increase system security by increasing the difficulty with which system crackers obtain encrypted passwords. This package provides 'login', which is needed to log into the system. |- | '''slocate''' | Secure Locate | Slocate is an enhanced version of locate, a command to help you locate files on the system. Like the original version of locate, Slocate maintains a database of files on the system, updating it nightly. Unlike the original, Slocate indexes every file on the machine rather than only the ones that can be seen by everyone. The "secure" part of slocate is that it will only return matches if the user is allowed to see the files. |- | '''smartmontools''' | Hard drive monitoring utilities | SMARTMONTOOLS contains utilities that control and monitor storage devices using the Self-Monitoring, Analysis and Reporting Technology (S.M.A.R.T.) system build into ATA and SCSI Hard Drives. This is used to check the reliability of the hard drive and to predict drive failures. SMARTMONTOOLS Version 5.x is designed to comply to the ATA/ATAPI-5 specification (Revision 1). Future releases of SMARTMONTOOLS (Versions 6.x and 7.x) will comply with the ATA/ATAPI-6 and ATA/ATAPI-7 specifications. |- | '''sysfsutils''' | Utilities for the sysfs filesystem | The purpose of this package is to provide a set of utilities for interfacing with sysfs, a virtual filesystem in Linux kernel versions 2.6+ that provides a tree of system devices. While a filesystem is a very useful interface, a library (libsysfs) is also included that will hopefully make it easier for applications to query system devices and their attributes. |- | '''sysklogd''' | Linux system logging utilities | Dr. Greg Wettstein and Stephen Tweedie's syslogd/klogd. This package contains a modified version of syslogd for the Linux environment. An additional utility, klogd, is included which allows kernel logging to be directed through the syslogd facility. Syslogd and klogd are started when your system boots. |- | '''syslinux''' | SYSLINUX/PXELINUX/ISOLINUX boot loaders | SYSLINUX is a boot loader for the Linux operating system which operates off an MS-DOS/Windows FAT filesystem. This is used by the Slackware makebootdisk script to create system boot floppies. Also included are PXELINUX and ISOLINUX, boot loaders for booting from a network server or CD-ROM. |- | '''sysvinit''' | init, the parent of all processes | System V style init programs by Miquel van Smoorenburg that control the booting and shutdown of your system. These support a number of system runlevels, each with a specific set of utilities spawned. For example, the normal system runlevel is 3, which starts agetty on virtual consoles tty1 - tty6. Runlevel 4 starts xdm. Runlevel 0 shuts the system down. |- | '''sysvinit-functions''' | /etc/init.d/functions | This is the /etc/init.d/functions file, the typical sysvinit-style directories, and a few supporting binaries. Using this system, subdirectories of /etc/rc.d/ are searched for scripts (which are usually symlinks to the script in /etc/init.d/ or /etc/rc.d/init.d/). The links must start with S to start a script or K to stop (kill) it. For the most part, these are useful for running software developed for other versions of Linux. |- | '''sysvinit-scripts''' | The basic scripts used to boot your machine | These are the Slackware boot scripts, which are needed to start the machine. Sysvinit looks for these in /etc/rc.d/. |- | '''tar''' | Archiving utility | This is the GNU version of tar, an archiving program designed to store and extract files from an archive file known as a tarfile. A tarfile may be made on a tape drive, however, it is also common to write a tarfile to a normal file. Slackware's package system uses tarfiles compressed with GNU gzip. |- | '''time''' | The GNU time command for measuring program resource use | The `time' command runs another program, then displays information about the resources used by that program, collected by the system while the program was running. |- | '''tree''' | A program to display a directory tree | Tree is a recursive directory listing program that produces a depth indented listing of files, which is colorized ala dircolors if the LS_COLORS environment variable is set and output is to tty. With no arguments, tree lists the files in the current directory. |- | '''udev''' | Dynamic device directory system | udev provides a dynamic device directory containing only the files for the devices which are actually present. It creates or removes device node files usually located in the /dev directory. |- | '''usbutils''' | USB utilities | lsusb displays detailed information about all USB buses and devices in the system. usbmodules lists the kernel modules for a plugged in USB device. |- | '''utempter''' | utmp updating library and utility | The utempter package provides a utility and shared library that allows terminal applications such as xterm and screen to update /var/run/utmp and /var/log/wtmp without requiring root privileges. |- | '''util-linux''' | A huge collection of essential utilities | The util-linux package is a huge collection of random utilities that are essential to run a Linux system. This package includes the util-linux package from ftp.kernel.org, plus some related programs from other sources such as adjtimex, bsdstrings, net-tools (only for 'hostname', a complete version is in the tcpip package), schedutils, setserial, and ziptool. |- | '''which''' | Shows the full path to shell commands | GNU 'which' takes one or more arguments. For each of its arguments it prints to stdout the full path of the executables that would have been executed when this argument had been entered at the shell prompt. It does this by searching for an executable or script in the directories listed in the environment variable PATH using the same algorithm as bash(1). 'Which' is a built-in function in many shells. |- | '''xfsprogs''' | Tools to use the XFS filesystem | XFS is a high performance journaling filesystem which originated on the SGI IRIX platform. It is completely multi-threaded, can support large files and large filesystems, extended attributes, variable block sizes, is extent based, and makes extensive use of Btrees (directories, extents, free space) to aid both performance and scalability. |- |} === Package group [AP] === {| border="1" cellspacing="0" cellpadding="5" ! Package ! Short Description ! Long Description |- | '''at''' | Delayed command execution | at and batch read shell commands from standard input (or a specified file) storing them as a job to be scheduled for execution at a later time. |- | '''cdrdao''' | CD burning utility | cdrdao burns proper disc-at-once (DAO) audio discs. In DAO mode the disc is written in one shot, so you don't have to have irritating 2 second gaps interrupting a live recording. |- | '''cdrtools''' | Tools for mastering and writing compact discs. | cdda2wav -- CD audio sampling utility. cdrecord -- burn discs in most ATAPI and SCSI CD-R drives. mkisofs -- create ISO9660/HFS/Joliet CD-ROM images. mkzftree -- compress a file tree to make a compressed CD-ROM. |- | '''diffutils''' | Finds differences between files | The GNU diff utilities finds differences between files. A major use for this package is to make source code patches. |- | '''dmapi''' | Data Management API library | A library required to use the Data Management API (DMAPI). This interface is defined in the X/Open document 'Systems Management: Data Storage Managment (XDSM) API' dated February 1997. The DMAPI library is used by the xfsdump utility. |- | '''dmidecode''' | DMI table decoder | dmidecode is a tool for dumping a computer's DMI table (some say SMBIOS) contents in a human-readable format. This table contains a description of the system's hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. |- | '''dvd+rw-tools''' | --- | A collection of tools to master DVD+RW/+R/-R/-RW media. |- | '''groff''' | Document formatting system | The GNU groff package provides versions of troff, nroff, eqn, tbl, and other Unix text-formatting utilities. Groff is used to 'compile' man pages stored in groff/nroff format into a form which can be printed or displayed on the screen. These man pages are stored in compressed form in the /usr/man/man? directories. |- | '''lm_sensors''' | Hardware monitoring package | lm_sensors provides tools for monitoring the temperatures, voltages, and fans of Linux systems with hardware monitoring devices. Included are text-based tools for sensor reporting, and a library for sensors access called libsensors. It also contains tools for sensor hardware identification and I2C bus probing. IMPORTANT NOTE: If you have a Thinkpad, please read the warnings in the README.thinkpad file. [http://www.thinkwiki.org/wiki/Problem_with_lm-sensors lm_sensors has been known to cause damage to some Thinkpads]. |- | '''lsof''' | List open files | Lsof is a Unix-specific tool. Its name stands for "LiSt Open Files", and it does just that. It lists information about files that are open by the processes running on the system. |- | '''lsscsi''' | List SCSI devices or hosts, and their attributes | Uses information in sysfs to list scsi devices (or hosts) currently attached to the system. Options can be used to control the amount and form of information provided for each device. |- | '''man''' | Format and display the on-line manual pages | The man package is a collection of tools used for searching and reading the online system documentation. In fact, on most UNIX-like operating systems it is the primary means of finding out how programs on the system work. For example, 'man man' will display the documentation for man itself. Man requires the groff text processing package. |- | '''man-pages''' | System documentation | Man pages are online documentation for Linux. This package includes many section 1, 2, 3, 4, 5, 7, and 8 man pages for Linux. |- | '''mc''' | Midnight Commander file manager | The Midnight Commander is a Norton Commander clone, a program that manipulates and manages files and directories. Useful, fast, and has color displays on the Linux console. Mouse support is provided through the gpm mouse server. This is a lightweight compilation of mc for use on the text console or in an xterm. |- | '''most''' | Another pager, like 'more' and 'less' | most is a paging program that displays, one windowful at a time, the contents of a file on a terminal. Unlike other well-known paging programs, most supports multiple windows and can scroll left and right. Why settle for less? |- | '''screen''' | Screen manager with VT100/ANSI terminal emulation | Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells). Each virtual terminal provides the functions of a DEC VT100 terminal and several control functions from the ISO 6492 (ECMA 48, ANSI X3.64) and ISO 2022 standards (e.g. insert/delete line and support for multiple character sets). There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows moving text regions between windows. |- | '''sudo''' | Give limited root privileges to certain users | 'sudo' is a command that allows users to execute some commands as root. The /etc/sudoers file (edited with 'visudo') specifies which users have access to sudo and which commands they can run. 'sudo' logs all its activities to /var/log/ so the system administrator can keep an eye on things. |- | '''sysstat''' | System performance monitoring tools | The sysstat utilities are a collection of performance monitoring tools for Linux. These include sar, sadf, mpstat, iostat and sa tools. |- | '''texinfo''' | GNU software documentation system | 'Texinfo' is a documentation system that uses a single source file to produce both on-line information and printed output. Using Texinfo, you can create a printed document with the normal features of a book, including chapters, sections, cross references, and indices. From the same Texinfo source file, you can create a menu-driven, on-line Info file with nodes, menus, cross references, and indices. This package is needed to read the documentation files in /usr/info. |- | '''vim''' | Vi IMproved | Vim is an almost compatible version of the UNIX editor vi. Many new features have been added: multi level undo, command line history, filename completion, block operations, and more. Vim's development is led by Bram Moolenaar. This package also contains the Exuberant Ctags program written by Darren Hiebert. |- | '''xfsdump''' | Backup tools for the XFS filesystem | The xfsdump package contains the xfsdump and xfsrestore utilities for backing up and restoring XFS partitions. xfsdump examines files in a filesystem, determines which need to be backed up, and copies those files to a specified disk, tape or other storage medium. xfsrestore performs the inverse function of xfsdump; it can restore a full or incremental backup of a filesystem. |- |} &nbsp; === Package group [D] === {| border="1" cellspacing="0" cellpadding="5" ! Package ! Short Description ! Long Description |- | '''autoconf''' | Generate configuration scripts | GNU autoconf is an extensible package of m4 macros that produce shell scripts to automatically configure software source code packages. These scripts can adapt the packages to many kinds of UNIX-like systems without manual user intervention. Autoconf creates a configuration script for a package from a template file that lists the operating system features that the package can use, in the form of m4 macro calls. You must install the "m4" package to be able to use autoconf. |- | '''automake''' | A Makefile generator | This is Automake, a Makefile generator. It was inspired by the 4.4BSD make and include files, but aims to be portable and to conform to the GNU standards for Makefile variables and targets. Automake is a Perl script. The input files are called Makefile.am. The output files are called Makefile.in; they are intended for use with Autoconf. Automake requires certain things to be done in your configure.in. You must install the "m4" and "perl" packages to be able to use automake. |- | '''binutils''' | GNU binary development tools | Binutils is a collection of binary utilities. It includes "as" (the portable GNU assembler), "ld" (the GNU linker), and other utilities for creating and working with binary programs. These utilities are REQUIRED to compile C, C++, Objective-C, Fortran, and most other programming languages. |- | '''bison''' | Parser generator similar to yacc | GNU "Bison" is a general-purpose parser generator that converts a grammar description for an LALR(1) context-free grammar into a C program to parse that grammar. Bison is upward compatible with Yacc: all properly-written Yacc grammars ought to work with Bison with no change. Anyone familiar with Yacc should be able to use Bison with little trouble. |- | '''doxygen''' | Documentation generator | Doxygen is a documentation system for C++, C, Java, IDL, and to some extent PHP and C#. Doxygen generates project documentation using special documentation blocks in the source code, easing the process of keeping docs and code in sync. Doxygen produces documentation in several output formats, including HTML, LaTeX, man pages, RTF, XML, compressed HTML, PostScript, and PDF. |- | '''flex''' | fast lexical analyzer generator | flex is a tool for generating programs that perform pattern matching on text. flex is a rewrite of the AT&T Unix lex tool (the two implementations do not share any code, though), with some extensions (and incompatibilities). |- | '''gcc''' | Base GCC package with C support | This package contains those parts of the compiler collection needed to compile C code. Other packages add C++, Fortran, Objective-C, and Java support to the compiler core. |- | '''gcc-g++''' | C++ for GCC | C++ support for the GNU Compiler Collection. This package contains those parts of the compiler collection needed to compile C++ code. The base gcc package is also required. |- | '''gettext-tools''' | --- | The GNU gettext-tools package is useful for authors and maintainers of internationalized software, or for anyone compiling programs that use the gettext functions. This package provides the needed tools and library functions for the handling of messages in different languages. Some other GNU packages use the gettext program (included in this package) to internationalize the messages given by shell scripts. |- | '''kernel-headers''' | Linux kernel include files | These are the include files from the Linux kernel. You'll need these to compile most system software for Linux. |- | '''libtool''' | A generic library support script | This is GNU Libtool, a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. To use libtool, add the new generic library building commands to your Makefile, Makefile.in, or Makefile.am. See the documentation for details. You must install the "m4" package to be able to use libtool. |- | '''m4''' | An implementation of the UNIX macro processor | This is GNU m4, a program which copies its input to the output, expanding macros as it goes. m4 has built-in functions for including named files, running commands, doing integer arithmetic, manipulating text in various ways, recursion, etc... Macros can also be user-defined, and can take any number of arguments. |- | '''make''' | GNU make utility to maintain groups of programs | This is the GNU implementation of make, which was written by Richard Stallman and Roland McGrath. The purpose of the make utility is to determine automatically which pieces of a large program need to be recompiled, and issue the commands to recompile them. This is needed to compile just about any major C program, including the Linux kernel. |- | '''perl''' | Practical Extraction and Report Language | Larry Wall's "Practical Extraction and Report Language". Perl is a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks. The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal). |- | '''pkg-config''' | --- | pkg-config is a system for managing library compile/link flags that works with automake and autoconf. It replaces the ubiquitous *-config scripts you may have seen with a single tool. See the man page that comes with pkg-config for full documentation. |- |} &nbsp; === Package group [F] === {| border="1" cellspacing="0" cellpadding="5" ! Package ! Short Description ! Long Description |- | '''linux-faqs''' | Linux FAQ collection from ibiblio.org | Frequently Asked Questions (and answers!) on many Linux topics. Some of the FAQs included in this package: ATAPI-FAQ, AfterStep-FAQ, BLFAQ (Brief Linux FAQ), Ftape-FAQ, GCC-SIG11-FAQ, Joe-Command-Reference, the Linux-FAQ, PPP-FAQ, SMP-FAQ, and the Threads-FAQ. These FAQs will be installed under /usr/doc/Linux-FAQs/. |- | '''linux-howtos''' | HOWTOs from the Linux Documentation Project | Documentation on many tasks relating to Linux setup and operation. These documents will be installed in /usr/doc/Linux-HOWTOs/. |- |} &nbsp; === Package group [K] === {| border="1" cellspacing="0" cellpadding="5" ! Package ! Short Description ! Long Description |- | '''kernel-source''' | Linux kernel source | Source code for Linus Torvalds' Linux kernel. This is the complete and unmodified source code for the Linux kernel. |- |} &nbsp; &nbsp; &nbsp; === Package group [L] === {| border="1" cellspacing="0" cellpadding="5" ! Package ! Short Description ! Long Description |- | '''db42''' | Berkeley database library version 4.2.x | The Berkeley Database (Berkeley DB) library provides embedded database support for both traditional and client/server applications. This package should be installed if compatibility is needed with databases created with the Berkeley DB version 4.2.x. |- | '''db44''' | Berkeley database library version 4.4.x | The Berkeley Database (Berkeley DB) library provides embedded database support for both traditional and client/server applications. This package should be installed if compatibility is needed with databases created with the Berkeley DB version 4.4.x. |- | '''gdbm''' | GNU database routines | GNU dbm is a set of database routines that work similar to the standard UNIX dbm routines. |- | '''glibc''' | GNU C libraries | This package contains the GNU C libraries and header files. The GNU C library was written originally by Roland McGrath, and is currently maintained by Ulrich Drepper. Some parts of the library were contributed or worked on by other people. You'll need this package to compile programs. |- | '''glibc-i18n''' | locale files from glibc | These files go in /usr/lib/locale and /usr/share/i18n/ to provide internationalization support. You'll need this package unless you will be using US English only. |- | '''libusb''' | USB library | This is libusb, a library which allows userspace application access to USB devices. It is used to connect to USB devices like scanners. |- | '''lzo''' | LZO Compression Library | LZO is a portable lossless data compression library written in ANSI C. It offers pretty fast compression and very fast decompression. |- | '''ncurses''' | --- | The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0, and more. It uses terminfo format, supports pads and color and multiple highlights and forms characters and function-key mapping, and has all the other SYSV-curses enhancements over BSD curses. |- | '''pcre''' | Perl-compatible regular expression library | The pcre library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5, with just a few differences (documented in the man page). |- | '''popt''' | Command line parsing library | popt is a C library for parsing command line parameters. popt was heavily influenced by the getopt() and getopt_long() functions, but it improves on them by allowing more powerful argument expansion. popt can parse arbitrary argv[] style arrays and automatically set variables based on command line arguments. popt allows command line arguments to be aliased via configuration files and includes utility functions for parsing arbitrary strings into argv[] arrays using shell-like rules. |- | '''readline''' | line input library with editing features | The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes additional functions to maintain a list of previously entered command lines, to recall and perhaps edit those lines, and perform csh-like history expansion on previous commands. |- | '''zlib''' | Compression library | zlib is a general purpose thread safe data compression library. |- |} &nbsp; === Package group [N] === {| border="1" cellspacing="0" cellpadding="5" ! Package ! Short Description ! Long Description |- | '''bitchx''' | Chat client | BitchX is an advanced Internet Relay Chat (IRC) client. |- | '''dhcpcd''' | DHCP client daemon | The DHCP client program dhcpcd is used to connect to a network by contacting a DHCP server. dhcpcd gets an IP address and other information from a corresponding DHCP server, configures the network interface automatically, and tries to renew the lease time according to RFC2131 or RFC1541 depending on the command line option. |- | '''inetd''' | Internet super-server | This is a program to listen for connections on certain Internet sockets and invokes a program to service the request. Essentially, inetd allows running one daemon to invoke several others, reducing load on the system. Many of the network services are run through inetd, so you'll probably need it. This version of inetd was ported from OpenBSD. |- | '''iproute2''' | IP routing utilities | These are tools used to administer many advanced IP routing features in the kernel. See Configure.help in the kernel documentation (search for iproute2) for more information on which kernel options these tools are used with. |- | '''iptables''' | IP packet filter administration | Iptables can be used to build internet firewalls based on stateless and stateful packet filtering, use NAT and masquerading for sharing internet access if you don't have enough public IP addresses, use NAT to implement transparent proxies, aid the tc and iproute2 systems used to build sophisticated QoS and policy routers, do further packet manipulation (mangling) like altering the TOS/DSCP/ECN bits of the IP header, and much more. |- | '''iptraf''' | --- | IPTraf is a console-based network monitoring program for Linux that displays information about IP traffic such as: Current TCP connections, types of IP packets, packet and byte counts, TCP/UDP counts by ports, packet counts by packet sizes, packet and byte counts by IP address, interface activity, flag statuses on TCP packets, and other LAN station statistics. |- | '''iputils''' | a collection of common network tools | The iputils package contains network tools found on nearly all *NIX systems, along with an extra or two. Some of the utilities found here include arping, clockdiff, ping, ping6, rarpd, rdisc, tracepath, tracepath6, and traceroute6. |- | '''lftp''' | Command line file transfer program | lftp is a program that allows sophisticated ftp and http connections to other hosts. lftp can handle many file access methods including ftp, ftps, http, https, hftp, fish and file. Every operation in lftp is reliable, that is any non-fatal error is ignored and the operation is retried. lftp has shell-like command syntax. lftp has a built in mirror feature which can download or upload a whole directory tree. To learn about many more features of lftp, see 'man lftp'. |- | '''libgcrypt''' | General purpose crypto library | libgcrypt is a general purpose crypto library based on the code used in GnuPG. |- | '''libgpg-error''' | GnuPG Error Definitions Library | This is a library that defines common error values for all GnuPG components. Among these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt , Libksba, DirMngr, Pinentry, SmartCard Daemon, and more. |- | '''lynx''' | Text mode browser | Lynx is a distributed hypertext browser with full World Wide Web capabilities. Lynx can be used to access information on the World Wide Web, or to build information systems intended primarily for local access. For example, Lynx has been used to build several Campus Wide Information Systems (CWIS). |- | '''mtr''' | A network diagnostic tool | mtr combines the functionality of the 'traceroute' and 'ping' programs in a single network diagnostic tool. |- | '''net-tools''' | Base Linux networking utilities | This is the core collection of tools such as "ifconfig" and "route" used to configure networking on Linux. You won't be able to do much networking without this package and the network-scripts. |- | '''netkit-ftp''' | The old BSD FTP client | Ftp is the user interface to the Internet standard File Transfer Protocol. The program allows a user to transfer files to and from a remote network site. This is a program of mostly historical value. For a more powerful command-line FTP client, look at something like lftp. |- | '''netket-rsh''' | The BSD rsh/rcp/rlogin clients and daemon | The old BSD rsh suite. Note that none of these programs provide encryption or strong authentication of network connections. As such, their use is discouraged. The "ssh" protocol and package is a cryptographically secure replacement. |- | '''netwatch''' | --- | Netwatch allows a user (superuser) to monitor activity on the network. The monitor includes statistics on transmitted and received packets, bytes, protocol, and more. |- | '''network-scripts''' | Scripts to configure a network | These are the basic scripts and files used to define a network and configure network interfaces on Linux. Most of the original /etc files were written by Fred N. van Kempen, or borrowed from BSD. The rc.inet1 and rc.inet2 scripts were mostly written by Patrick Volkerding, with suggestions and fixes from hundreds of contributors over the years. |- | '''nmap''' | Network scanner | Nmap ("Network Mapper") is an open source utility for network exploration or security auditing. It was designed to rapidly scan large networks, although it works fine against single hosts. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (ports) they are offering, what operating system (and OS version) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. Nmap runs on most types of computers, and both console and graphical versions are available. |- | '''ntp''' | Network Time Protocol daemon | The Network Time Protocol (NTP) is used to synchronize the time of a computer client or server to another server or reference time source, such as a radio or satellite receiver or modem. It provides client accuracies typically within a millisecond on LANs and up to a few tens of milliseconds on WANs relative to a primary server synchronized to Coordinated Universal Time (UTC) via a Global Positioning Service (GPS) receiver, for example. |- | '''openssh''' | Secure Shell daemon and clients | ssh (Secure Shell) is a program for logging into a remote machine and for executing commands on a remote machine. It is intended to replace rlogin and rsh, and provide secure encrypted communications between two untrusted hosts over an insecure network. sshd (SSH Daemon) is the daemon program for ssh. |- | '''openssl''' | Secure Sockets Layer toolkit | The OpenSSL certificate management tool and the shared libraries that provide various encryption and decryption algorithms and protocols. |- | '''tcp_wrappers''' | TCP/IP daemon wrapper library and utilities | With this package you can monitor and filter incoming requests for network services for access control, and detection things like host name spoofing and host address spoofing. Nearly all the network daemons on Slackware are "wrapped" using this library, and most daemons in /etc/inetd.conf use tcp_wrappers' tcpd wrapper daemon. If you plan to do much networking, you will need tcp_wrappers. |- | '''telnet''' | The telnet client and daemon | telnet supports the original DARPA telnet interactive communication protocol. As connecting to a telnetd server transmits your password over the network in cleartext, telnet's use as a login protocol has been mostly superceded by the use of ssh and sshd. However, the telnet client is still a very handy tool, and telnetd may still have some uses on networks that are known to be secure. telnet and telnetd were ported from BSD. |- | '''traceroute''' | IP packet route tracing utility | The traceroute utility displays the route used by IP packets on their way to a specified network host. Traceroute will display the IP number and host name (if possible) of all the machines along the route taken by the packets. If you're having network connectivity problems, traceroute can show you where the trouble is located. |- | '''wget''' | A non-interactive network retriever | GNU Wget is a free network utility to retrieve files from the World Wide Web using HTTP and FTP, the two most widely used Internet protocols. It works non-interactively, thus enabling work in the background after having logged off. |- | '''whois''' | whois directory client | This is an enhanced whois (RFC 954) client derived from the BSD and RIPE whois programs. It can automatically select the appropriate whois server for most queries. |- | '''wireless-tools''' | Utilities for wireless networking | This package contains tools and a library used for configuring wireless networking interfaces: iwconfig (the main wireless tool), iwlist (display more detailed information than iwconfig), iwspy (get stats per MAC address and more), iwpriv (set driver private ioctls), iwgetid (show the ESSID or NWID of a device), iwevent (display wireless events), ifrename (rename a network interface). |- | '''wpa_supplicant''' | WPA/WPA2/IEEE 802.1X Supplicant | wpa_supplicant is a WPA Supplicant for Linux with support for WPA and WPA2 (IEEE 802.11i / RSN). Supplicant is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA Authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wlan driver. |} &nbsp; === How to install this minimal system === You only need the first Slackware CD to do this. * Install Slackware as you would do normally. * In the '''PACKAGE SERIES SELECTION''' screen, select package sets '''A''', '''AP''', '''D''', '''F''', '''K''', '''L''' and '''N'''. Now you have two choices: * '''Manual selection''': at the next screen ('''SELECT PROMPTING MODE'''), choose the '''expert''' option, and manually select (or unselect) every single package. * '''Using tagfiles''': this method is described in detail [http://www.slackbasics.org/html/chap-pkgmgmt.html#chap-pkgmgmt-tagfiles here]. I provide a set of tagfiles which spares you the chore of manual package selection. You can download it [http://www.kikinovak.net/tagfiles/base.tar.bz2 here]. &nbsp; 78c83d9a72d5dc6be7c4e2d9637f6d8591552f34 User:Alienbob 2 14 19 2009-05-28T11:23:49Z Alienbob 9 Alien introduction wikitext text/x-wiki * Real Name: Eric Hameleers * IRC Nickname: alienBOB * E-Mail: alien(.AT.)slackware.com * My Homepage: http://slackware.com/~alien/ * My Wiki: http://alien.slackbook.org/ * My Blog: http://alien.slackbook.org/blog/ I have a lot of SlackBuilds and Slackware packages in my repository. This is a list of URLs where you can find these: * [http://slackware.com/~alien/slackbuilds/ master site] ([http://slackware.com/~alien/slackbuilds/ChangeLog.rss RSS feed]) ** [http://slackware.org.uk/people/alien/slackbuilds/ UK mirror] * [http://slackware.org.uk/people/alien/restricted_slackbuilds/ packages with export restrictions] ([http://slackware.org.uk/people/alien/restricted_slackbuilds/ChangeLog.rss RSS feed]). Think of lame, faac, libdvdcss. 5f02c8bb3d95567b2c0c1ec34c255ce32e1ff3d2 SlackBuild Scripts 0 15 21 2009-05-28T17:37:32Z Dugan 12 Created page with 'SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slack...' wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://www.slackbuilds.net/slackbuilds/ ;* http://slackbuild.strangeworlds.co.uk/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] 5790ce4393af0df4fbef5d93d3a01eb0177d0d87 Writing A SlackBuild Script 0 16 22 2009-05-28T17:39:45Z Dugan 12 Created page with '[[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackw...' wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like linuxpackages.net, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/latex2html-2002-2-1.tar.gz # 05.02.2005 Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar -xzf latex2html-2002-2-1.tar.gz || exit 1 = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. #!/bin/sh You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ ;* http://www.slackbuilds.net/slackbuilds/ ;* http://slackbuild.strangeworlds.co.uk/ ;* http://www2.linuxpackages.net/packages/SlackBuilds/ ;* http://www.selkfoster.com.ar/downloads/slackbuilds/ ;* http://slack.sarava.org/slackbuilds/ fe66c82092eb710e5a3f0fe9014afee62a7232f2 Slack-desc 0 17 23 2009-05-28T17:46:19Z Dugan 12 Created page with '[[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackw...' wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like linuxpackages.net, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/latex2html-2002-2-1.tar.gz # 05.02.2005 Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar -xzf latex2html-2002-2-1.tar.gz || exit 1 = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. #!/bin/sh You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ ;* http://www.slackbuilds.net/slackbuilds/ ;* http://slackbuild.strangeworlds.co.uk/ ;* http://www2.linuxpackages.net/packages/SlackBuilds/ ;* http://www.selkfoster.com.ar/downloads/slackbuilds/ ;* http://slack.sarava.org/slackbuilds/ fe66c82092eb710e5a3f0fe9014afee62a7232f2 24 23 2009-05-28T17:47:48Z Dugan 12 wikitext text/x-wiki =Overview= A proper slack-desc file should be written as follows: # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| appname: Summary of application name and function (one line only) appname: <this line is generally left blank> appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname: The "appname" string must *exactly* match the application name portion of the Slackware package (for example, a package titled "gaim-1.5-i486-1.tgz" must have a slack-desc file with the <appname> string of "gaim: " rather than "Gaim: " or "GAIM: " or something else. The "handy ruler" is meant to stop you at 79 characters, because the standard console is 80x25 and if you go beyond this the words will wrap. =See Also= man makepkg man pkgtool [[Category:Tutorials]] c24c887449d4942b75d125ca6278c76190d4c962 Packages 0 18 25 2009-05-28T20:07:13Z Dugan 12 Migrated from old wiki wikitext text/x-wiki Slackware's package management system utilizes .tgz tarballs as its standard package format. These tarballs are tar.gz archives which contain Slackware built binaries, support files, a description file and installation script. Although they can be unzipped and untarred like a normal archive, they are (usually) binary-only packages intended to be installed through Slackware's provided package management tools. Information about a package is stored in two ways, in the filename of the package and a description file inside that package. ==Package Tools== See the respective manual pages for more information on each of the following commands. <code>pkgtool</code> <code>installpkg</code> <code>removepkg</code> <code>explodepkg</code> <code>makepkg</code> <code>upgradepkg</code> ==Slackware Package Layout== A typical Slackware package is laid out as such: ./ ./install/doinst.sh ./install/slack-desc [./usr/bin] [./usr/lib] [...] The install directory as well as the files within it will be deleted after the installation of the package to the root install directory (usually '/'). The install directory is not necessarily required for the most basic packages but allows additional functionality: [[slack-desc]] contains the package description, and [[doinst.sh]] contains post-installation instructions such as creating symbolic links. Every other file within the package is simply untarred (extracted) to the root directory. Most of these files are in standard locations. There are other special files within packages: '''usr/doc/<appname><version>''' All documentation included with the package (such as README, INSTALL, ChangeLog, docs/, etcetera) should be placed in this directory. Some of the files in this directory should be manually copied from the source archive, since Makefiles usually don't copy these documentation files to the package build tree. ==Making Slackware Packages== See [[Building A Package]] 94daaefc38da7411307d08fa34c43d2683e04278 Doinst.sh 0 19 26 2009-05-28T20:09:56Z Dugan 12 Migrated from old wiki wikitext text/x-wiki This script is usually included under ./install within Slackware [[packages]] and contains post-install actions. Usually automatically created by [[makepkg]] for cleaning up and recreating symbolic links, advanced packagers may wish to include further configuration instructions here to be executed after files have been extracted from the .tgz package. == Files == Within packages, doinst.sh is located in install/. After installation, the doinst.sh scripts are placed in /var/log/scripts, and renamed into the package name. == Examples == === Handling symbolic links === The package 'udev-064-i486-2' (from Slackware 10.2), contains a doinst.sh script which includes the following: ( cd etc/hotplug.d/default ; rm -rf 10-udev.hotplug ) ( cd etc/hotplug.d/default ; ln -sf /sbin/udevsend 10-udev.hotplug ) ( cd usr/man/man8 ; rm -rf udevsend.8.gz ) ( cd usr/man/man8 ; ln -sf udevd.8.gz udevsend.8.gz ) Thus, during installation of this package, it will delete 'etc/hotplug.d/default/10-udev.hotplug' and 'usr/man/man8/udevsend.8.gz', then immediately recreate them using symbolic links. This part of doinst.sh scripts is the most common, and is almost always generated by [[makepkg]] automatically during the creation of the package. In fact, 'makepkg' strongly suggests handling symbolic links using the doinst.sh script this way. === Configuration Files === The package 'vim-7.0.109-i486-1' (from Slackware 11.0), contains a doinst.sh script which includes the following: config() { NEW="$1" OLD="$(dirname $NEW)/$(basename $NEW .new)" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } config usr/share/vim/vimrc.new The config() function checks whether the configuration file in the package (vimrc) already exists on the system, or is exactly the same as the new one included in the package; if it exists and is not the same as the package's copy, it will not overwrite the old one but instead will be copied with a .new file extension (vimrc.new). This is a common, and the preferred, way of dealing with configuration files in Slackware packages. == See Also == * [[Packages]] * [[Building A Package]] 62ca7fa7ad16df9a866b1bcecd06a6c410d0a590 Build Environment 0 20 27 2009-05-28T20:12:40Z Dugan 12 Migrated from old wiki wikitext text/x-wiki = Introduction = The purpose of this document is to give you several ideas on how to set up a good building environment (directory structure and such) for making Slackware packages from SlackBuild scripts. Hopefully, you can see what works for several different people here. The definition of "good" is largely dependent upon personal preference, but all of these would be classified as "good" for the individuals using them. = Individual Setups = == jjdm == My directory structure is as follows: '''/home/slackware/''' The slackware home directory. This directory (and all subdirectories) are owned by the group "packager" (of which root and my user account are members on my system). '''/home/slackware/source''' In this directory I've placed the whole slackware-source because maybe I have to temporarily build another package to build a new one because of header files and stuff. '''/home/slackware/source/myslackware/''' This is where I build all my packages. Now they are unorganized but you can organize them in different topics like they're in Slackware. '''/home/slackware/source/myslackware/<package>''' In this directory you build your package <package>. '''/home/slackware/packages''' Place where the built packages are. You don't have to use such a building environment. You can place everything in your home-folder, in /root or somewhere else. The only important thing is that you always keep track of your files and packages. BTW: You can get the Slackware source packages from your Slackware-mirror of choice. It's placed in source/. == robw810 == === Directory Structure === My setup is something like this: /shared/os_files/slackware/slackware-(version)/source/... /home/rworkman/build/source /home/rworkman/build/packages === Explanation of Directory Structure === The [code] /shared/os_files/slackware/slackware-(version)/source/ [/code] directory contains all of the source files (it's copied directly from the cdroms) from that release of Slackware. The [code]/home/rworkman/build/source[/code] directory contains all of the sources for my SlackBuild scripts and such (it's set up basically identical to what the Slackware source directory contains). The [code]/home/rworkman/build/packages[/code] directory contains all of the packages compiled from my sources. === Integration of Directory Structure with Executing SlackBuild Scripts === With some good environment variables declared in your SlackBuild scripts, it's relatively easy to manage this setup: PKG_OUT=/home/rworkman/build/packages === Final Thoughts === As always, what works for me may not be ideal for you, so adjust your expectations accordingly :) = Other Resources = * [[Writing_A_SlackBuild_Script]] * [[SlackBuild_Scripts]] 463d490fdd4bdf80295d52d2ceecb4c5d62a22c3 28 27 2009-05-28T20:17:15Z Dugan 12 Replaced [CODE] tags (which weren't displaying properly) wikitext text/x-wiki = Introduction = The purpose of this document is to give you several ideas on how to set up a good building environment (directory structure and such) for making Slackware packages from SlackBuild scripts. Hopefully, you can see what works for several different people here. The definition of "good" is largely dependent upon personal preference, but all of these would be classified as "good" for the individuals using them. = Individual Setups = == jjdm == My directory structure is as follows: '''/home/slackware/''' The slackware home directory. This directory (and all subdirectories) are owned by the group "packager" (of which root and my user account are members on my system). '''/home/slackware/source''' In this directory I've placed the whole slackware-source because maybe I have to temporarily build another package to build a new one because of header files and stuff. '''/home/slackware/source/myslackware/''' This is where I build all my packages. Now they are unorganized but you can organize them in different topics like they're in Slackware. '''/home/slackware/source/myslackware/<package>''' In this directory you build your package <package>. '''/home/slackware/packages''' Place where the built packages are. You don't have to use such a building environment. You can place everything in your home-folder, in /root or somewhere else. The only important thing is that you always keep track of your files and packages. BTW: You can get the Slackware source packages from your Slackware-mirror of choice. It's placed in source/. == robw810 == === Directory Structure === My setup is something like this: /shared/os_files/slackware/slackware-(version)/source/... /home/rworkman/build/source /home/rworkman/build/packages === Explanation of Directory Structure === The '''/shared/os_files/slackware/slackware-(version)/source/''' directory contains all of the source files (it's copied directly from the cdroms) from that release of Slackware. The '''/home/rworkman/build/source''' directory contains all of the sources for my SlackBuild scripts and such (it's set up basically identical to what the Slackware source directory contains). The '''/home/rworkman/build/packages''' directory contains all of the packages compiled from my sources. === Integration of Directory Structure with Executing SlackBuild Scripts === With some good environment variables declared in your SlackBuild scripts, it's relatively easy to manage this setup: PKG_OUT=/home/rworkman/build/packages === Final Thoughts === As always, what works for me may not be ideal for you, so adjust your expectations accordingly :) = Other Resources = * [[Writing_A_SlackBuild_Script]] * [[SlackBuild_Scripts]] 0e4ccf2eb4c3122c1246de05c4d2b8c2abea8b7b Contest 0 21 29 2009-05-28T20:19:39Z Dugan 12 Migrated from old wiki wikitext text/x-wiki '''This contest is completed; congratulations to Marcus''' This page is here for those of you who wanted to create logos for slackwiki.org's contest. Have at it!!! From [[User:FredEmmott|Fred87]] Can i have SVGs and/or png's please :) From [[User:erik|erik]] Mine is a png :) ---- Submitted by: [[User:Dominian|Dominian]] on Nov. 17, 2004<br> http://home.insightbb.com/~mhayes/images/slackwiki_logo.png ----------------------------------------- Submitted by: [[User:jjdm|jjdm]] on Nov. 20, 2004<br/> Repainted [http://us.aminet.net/pix/trace/BOOK.jpg this book] with sodipodi, repainted the slackware-logo and added a third-party svg-tux. You can get the SVG-file at [http://mufl.politux.org/logo.svg]. If you like the logo, but not the colors, feel free to edit the SVG-file. I meen, _please_ edit the SVG if you are good in colors because I'm a little colorblind. Thanks.<br/> http://mufl.politux.org/logo.png ----------------------------------------- Submitted by: [[User:erik|erik]] on Nov. 21, 2004<br/> The Wings of Slack, not mine, original from [http://subgenius.com/ The Church of the Subgenius].<br/> Should fit right over the old logo (135x135), transparent bg will blend with current bg.<br/> http://sl1200.org/WingsOfSlack.png ----------------------------------------- Submitted by: [[User:buzzedlightyear|buzzedlightyear]] on Nov. 23, 2004<br/> Slackware logo, cropped it from a background i found and added text.<br/> http://www.slackwaregallery.com/albums/userpics/10157/slackwikilogo.png ----------------------------------------- Submitted by: [[User:tewmten|tewmten]] on Dec. 14, 2004<br/> A little penguin writing a book wich has the Slackware S on it.<br/> 135x135 with transparent background.<br/> http://irda.mine.nu/~tewmten/SlackWiki-tew.png ---- Submitted by: [[User:v3ctor|v3ctor]] on Dec. 15, 2004<br/> Just a little something.</br> http://www.geocities.com/thelucid99/slackwiki.png ---- Submitted by: [[User:Marcus|Marcus]] on Dec. 25, 2004<br/> Feel free to use it: http://www.gnulinux.de/images/personal/slackwiki/slackwiki.gif 4b30e3f522f06075538cc0bcfb3c200c1e503bcc Different Approach To Buildscripts 0 22 30 2009-05-28T20:23:32Z Dugan 12 Migrated from old wiki wikitext text/x-wiki [[Category:Tutorials]] Pretty much everyone can have their own way of writing Slackware buildscripts. I also have mine, which just makes it easier for me to package software. In here, I'm going to explain mine. To start, let's look at one I wrote this morning while drinking coffee cup #1: #!/bin/bash ############################################################################# ## Name: jpilot ## ## Version: 0.99.8 ## ## Packager: Martin Lefebvre (dadexter@gmail.com) ## ## Homepage: http://www.jpilot.org ## ############################################################################# PKGNAME=jpilot VERSION=0.99.8 LOC="http://jpilot.org/$PKGNAME-$VERSION.tar.gz" ARCH=`uname -m` START=`pwd` PKG=$START/pkg SRC=$START/work build() { mkdir -p $PKG $SRC cd $SRC wget $LOC tar -zxvf $PKGNAME-$VERSION.tar.gz cd $PKGNAME-$VERSION ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --enable-gtk2 --enable-prometheon patch -p0 < patch.0.99.8-memory patch -p0 < patch.jpilot-sync make make DESTDIR=$PKG install mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION cp -r ABOUT-NLS AUTHORS BUGS COPYING ChangeLog ChangeLog.cvs INSTALL \ NEWS README TODO UPGRADING docs $PKG/usr/doc/$PKGNAME-$VERSION cp KeyRing/README.txt $PKG/usr/doc/$PKGNAME-$VERSION/README.keyring cp dialer/README $PKG/usr/doc/$PKGNAME-$VERSION/README.dialer cp icons/README $PKG/usr/doc/$PKGNAME-$VERSION/README.icons } package() { cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : \ | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : \ | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "current ar archive" | cut -f 1 -d : | \ xargs strip --strip-debug 2> /dev/null chown -R root:root usr/bin gzip -p $PKG/usr/man/man*/* mkdir $PKG/install cp $START/slack-desc $PKG/install/slack-desc cd $PKG makepkg -l y -c n $START/$PKGNAME-$VERSION-$ARCH-1.tgz } build package The top section is just comments identifying the piece of software we're going to build, and the name of the script's author. Then we have the following lines: PKGNAME=jpilot VERSION=0.99.8 LOC="http://jpilot.org/$PKGNAME-$VERSION.tar.gz" ARCH=`uname -m` START=`pwd` PKG=$START/pkg SRC=$START/work They set the program's name, version, download URL, build and package directories. Since I usually don't specify anything related to the cpu or architecture, it auto detects the architecture. So, the $ARCH variable *should be* accurate. build() { mkdir -p $PKG $SRC cd $SRC wget $LOC tar -zxvf $PKGNAME-$VERSION.tar.gz cd $PKGNAME-$VERSION ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --enable-gtk2 --enable-prometheon patch -p0 < patch.0.99.8-memory patch -p0 < patch.jpilot-sync make make DESTDIR=$PKG install mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION cp -r ABOUT-NLS AUTHORS BUGS COPYING ChangeLog ChangeLog.cvs INSTALL \ NEWS README TODO UPGRADING docs $PKG/usr/doc/$PKGNAME-$VERSION cp KeyRing/README.txt $PKG/usr/doc/$PKGNAME-$VERSION/README.keyring cp dialer/README $PKG/usr/doc/$PKGNAME-$VERSION/README.dialer cp icons/README $PKG/usr/doc/$PKGNAME-$VERSION/README.icons } The is the main build function. This contains the code required to build the software. First, we create the build and package directories. The next 3 lines change to the building diirectory, uses wget to fetch the source file and extracts it. The lines after that are what you would normally type at your command line to build the software: * Change to the source directory. * Run ./configure with all the options you want. * Apply two patches required (in this case) to fix bugs with the software. * Run make * Install the software in the package directory defined by $PKG * Create the standard Slackware Software Documentation directory in the package * Copy the standard documentation. The next section is the packaging part: package() { cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : \ | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : \ | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "current ar archive" | cut -f 1 -d : | \ xargs strip --strip-debug 2> /dev/null chown -R root:root usr/bin gzip -p $PKG/usr/man/man*/* mkdir $PKG/install cp $START/slack-desc $PKG/install/slack-desc cd $PKG makepkg -l y -c n $START/$PKGNAME-$VERSION-$ARCH-1.tgz } * We change to the package directory * Strip executables and libraries in order to decrease size. * As a Slackware standard, we change the ownership of the executables to root:root (to be done for every bin/ and sbin/ directory) * We compress the manpages * Create install/ and copy the slack-desc file from the start directory * Finally, change back to the package folder and create the package tarball. In this example, the slack-desc and some patch files are distributed with the SlackBuild. This also makes it easier to ship the build script with patches that might be required for the software to work on Slackware (patch to remove PAM stuff). The slack-desc file format is described here: [http://www.linuxpackages.net/howto.php?page=slack-desc&title=Slackware+Desc+Files LinuxPackages.net] Additional files: Some people use slapt-get (like me). slapt-get supports additional features such as * Dependencies * Conflicts * Suggestions Not everyone wants those features, so building a package with those files will not interfere with the normal pkgtools process. For more info on these optional files, go here: [http://www.linuxpackages.net/howto.php?page=perfect-package&title=Perfect+Package#Optional LinuxPackages.net] If you decide to use those files, you will then have to repeat these lines: cp $START/slack-desc $PKG/install/slack-desc for slack-required, slack-conflicts, and slack-suggests. ---- See also [[SlackBuild_Scripts]] and [[Writing A SlackBuild Script]] ---- 00c1d139fe473abbcd7fd5f55290127ea0189736 Building A Package 0 23 31 2009-05-28T20:24:50Z Dugan 12 Migrated from old wiki wikitext text/x-wiki [[Category:Tutorials]] This is a rough outline for building Slackware packages. Some steps may not be neccessary, some steps might be missing. Use the discussion page for side-notes such as using slacktrack (when DESTDIR fails) and other utilities like checkinstall. ---- Configure and compile the source as you usually do: ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc make Make a temporary destination directory available: mkdir /tmp/build Install into the temporary directory: make install DESTDIR=/tmp/build Now strip libs/bins within the temporary directory: strip -s /tmp/build/usr/lib/* /tmp/build/usr/bin/* You also want to make sure that anything in <tt>/usr/man</tt> is gzipped before you make the package: gzip -9 /tmp/build/usr/man/man?/*.? Create the <tt>install</tt> directory, this is where the description and install script will be stored: cd /tmp/build mkdir install cd install Using a text editor, create a file called <tt>slack-desc</tt> and fill it with the following contents: |-----handy-ruler------------------------------------------------------| app: Application Name (Short/Brief description) app: app: Enter a description of the package you are building. app: All 11 "app:" lines must be present app: "app" needs to be your application name. app: The handy-ruler is there to help you, these lines should not exceed app: 79 characters. app: app: app: app: Create the actual package: cd /tmp/build makepkg ../app-version-arch-tag.tgz ''(The dashes should appear as above, so if the version has a subversion like say "1.0 RC2" make sure you use 1.0_RC2 not 1.0-RC2. The arch should be something like "i486" for example. The tag should consist of the build number and your initals, e.g. 1zb for Zaphod Beeblebrox's first build, 2zb for his second build, etc. Official slackware packages have only numbers as tags.)'' When prompted to recreate symbolic links, say <tt>yes</tt><br> When prompted to reset permissions, say <tt>no</tt> ''Note: Using '''makepkg -l y -c n''' will give you the same behaviour as answering yes to the symlinks question, and no to the permissions question.'' If all went well, you can now install the package. cd .. installpkg app-version-arch-tag.tgz ---- For more information, also see the pages on [[SlackBuild_Scripts]] and [[Different_Approach_To_Buildscripts]]. ---- 7a323271780fdaeb613b6e71ec01f41ef6fbdc6c Checkinstall 0 24 32 2009-05-28T20:27:22Z Dugan 12 Migrated from old wiki. AND GOT RID OF SPAM. wikitext text/x-wiki Checkinstall is actually really easy to use. Like it's told in [[compiling]] tutorial, you first do:<br> <pre>./configure (--option=argument/path)</pre><br> then when configure has finished you write<br> <pre>make</pre><br> after compiling you simply write<br> <pre>checkinstall -y -S</pre><br> and you don't have to worry about it. This command makes a package and installs it. Also it leaves copy of this package to current directory in case you need it. If you want to remove package you go to /var/log/packages and write:<br> <pre>removepkg pkgname</pre><br> '''Configuration''' Checkinstall also works with a config file: /etc/checkinstall/checkinstallrc. In this file, the options that are especially interesting to a SlackWare user are: <pre> ARCHITECTURE="i686" INSTYPE="S" PAK_DIR="/usr/src" SHOW_SLACK_INSTALL=0 </pre> "ARCHITECTURE" sets your architecture (if blank, it will auto guess) "INSTYPE" specifies the type of package to create (S for Slackware) "PAK_DIR" is the location where the finished packages will be moved to "SHOW_SLACK_INSTALL" specifies wether the slackware package info will be shown when it's installed That's it. == External Links == Checkinstall home page: http://asic-linux.com.mx/~izto/checkinstall/ [[Category:Tutorials]] 0cb0a9c6a0c097e78977c7b67d7df4a83db4b3c9 Compiling 0 25 33 2009-05-28T20:28:32Z Dugan 12 Migrated from old wiki wikitext text/x-wiki Well compiling a program can be a pain, but it's pretty fun. First you need to get the source you're compiling and read the INSTALL and README files on any weird install techniques. We first need to extract the source: : <code>tar zxvf file.tar.gz</code> You will now see a bunch of files on your screen, that means it's extracting, now half the programs have a configure script, this means you can enable, disable and tell the program where to install to: : <code>./configure --help</code> This gives you a list of the options you can compile in or disable options. Now this is a normal compile line: : <code>./configure --prefix=/usr</code> Now this installs the program in /usr so you don't need to edit the $PATH to launch it, Now 2 other options that you might want to add to some programs are: : <code>--sysconfdir=/etc</code> : <code>--localstatedir=/var</code> These are pretty self explanatory. You may or may not need to edit these. Some source say $PREFIX/etc or something similar for the --sysconfdir and you might not want that, this is an example of when you need the --sysconfdir=/etc. Now when we have the source configured, you want to compile it: : <code>make</code> This compiles the actual program. It might take some time, it might not, depending on the source. If make succeeds without errors, the program is now technically compiled. Some simpler programs can be run directly after compiling, without having to be installed, but most programs need to be fully installed before they can properly run. To install, one can simply proceed as such: : <code>su</code> : <code>make install</code> However, the above method does not take advantage of Slackware's package management system, which will make upgrading or uninstalling this program in the future much easier. The preferred way to install programs is through packages-- thus, at this point, the program should be packaged instead of simply running "make install" as root. See [[Building_A_Package]] and [[Checkinstall]]. This is just a basic way to compile a program and it's pretty easy to do. Now you know how to compile a program. Good luck. [[Category:Tutorials]] d4ae7fce4be0a82bb09e133470f0ebab32b32777 LCD Monitor Configuration In X.Org 0 26 34 2009-05-28T20:36:03Z Dugan 12 Migrated from old wiki wikitext text/x-wiki [[Category:Tutorials]] ==DISCLAIMER== If there is nothing wrong with your display, please don't go mucking about with your ~/.fonts.conf file (at least, back it up first). If you do have problems with your LCD display, then this is a good bet to try. If you have any success or failure, please do report this back, and changes, if any, that you made to your .fonts.conf file and any other file (perhaps /etc/X11/xorg.conf?) Comments, corrections and thoughts are always welcome. This may well also work with XFree86 > 4.3, since they use the same font configuration files as this. Older versions have a non-XML font configuration setup (I don't know when the switch over was made though), and will not be covered. WARNING - Parts of this article are out of date, and there are a few changes required for modular X. These will be added soon. ==Introduction== LCD/TFTs display fonts very differently to a CRT. Unfortunately with Slackware's default settings on X.Org/FreeType, the results for fonts on an LCD are painful to say the least. This is further compounded by the fact that all the 'helpful' HOWTOs out there are badly out of date, referring to ancient versions of the now defunct XFree86. Whilst there are a few sites out there with bits of information, putting into a workable solution is quite a challenge. This exists, therefore, to show the naysayers that they're wrong, and that you _can_ enjoy nice looking fonts in Slackware. (Please note, this is _not_ an exhaustive HOWTO, and it is _not_ a HOWTO about .fonts.conf (please see the Bibliography for a site detailing the tags available in .fonts.conf). This HOWTO is only about configuring an LCD monitor and what works best for one) ==What You'll Need== *Your favourite text editor *X.Org (or a later edition of XFree86 >4.3. This has only been tested on Slackware 10.1 and above). *An LCD/TFT monitor (most of this may also apply to an LCD monitor on a laptop). ==Physical Setup== ===The Monitor=== (I humbly apologise in advance for this section, but better safe than sorry.) (Standalone Monitors only) Plug up your LCD. Where possible, use the DVI-D (i.e. The digital, not analogue VGA) connector, if both your monitor and your graphics card have one. If not, use an analogue VGA cable and connection (where possible, avoid using DVI-D to VGA adaptors.) Then, ensure the viewing angle of your LCD is correct. Play around with it until you are happy. ==Settings== ===X=== As far as I know, there is no special configuration of X needed for an LCD monitor. Just create the necessary entry for a monitor in /etc/X11/xorg.conf with the correct refresh rates as normal and enjoy (the monitor itself may even be able to give you these, mine does.) I won't cover this in any more detail, as it's pretty standard and covered better elsewhere. X will also detect the correct sub-pixel alignment, so you don't need to deal with that either. ===Fonts and FreeType=== The real problems begins with font rendering in X. If you are switching over on your machine from a CRT to an LCD, what is facing you at first sight will be unpleasant to say the least. Of course, this isn't down to X, as in all modern X servers from X.Org (and the later ones from XFree86) FreeType is responsible for all font rendering (any other modules loaded in your /etc/X11/xorg.conf for font rendering are anachronisms: they are no longer used, and X tells you they don't exist). Something I've seen a lot is that “fonts looked better on 9.0” or earlier versions of Slackware, and there is good reason for this. With the changeover to FreeType2, due to various Apple patents in the US and Japan, the 'bytecode interpreter' is now disabled by default. (Plus, IMHO, the Bitstream fonts that ship with Slackware aren't very good). With a CRT, this isn't much of a problem, but it does make a lot of difference on an LCD and is nearly illegible. There are two ways round this, either: #Make alterations to .fonts.conf to try and make the Bitstream fonts render better on an LCD. #Rebuild FreeType with the bytecode interpreter, and use the properly hinted MS fonts (Arial, et al) to get cleaner, crisper looking fonts on the LCD. Both of these solutions give different results (though I prefer the second). ====Common==== For both alternatives, there are some common settings that must be made. If you're using KDE or GNOME, you'll find they have tools for doing some of what I'm going to describe. However, I would recommend _against_ using them. I've found their attempts at generating and editing a .fonts.conf file to be dubious to say the least. It is much more preferable to edit the file yourself, and since it is now done through a well defined XML file, this isn't as bad as it once appeared to be (judging from some of those ancient HOWTOs). Crank up your editor and load ~/.fonts.conf (or /etc/fonts/local.conf) If it exists: Just add these sections to it, inside the <fontconfig></fontconfig> tags. If it doesn't exist: Use my ~/.fonts.conf skeleton from Appendix A as your .fonts.conf and edit as necessary. 1. Ensure that the sub pixel order is _not_ specified. X knows the sub pixel order already, and if this is enabled as well, FreeType produces some very strange results. However, if you do still have problems, consider replacing 'none' with 'rgb' (the standard for LCD monitors), 'bgr' (unusual), 'vrgb' (vertical rgb, if you have a monitor that has been rotated by 90 degrees[1]), 'vgbr' (as vrgb, but very rare). <match target="font" > <edit mode="assign" name="rgba" > <const>none</const> </edit> </match> 2. Enable sub-pixel hinting This is what really starts to make the difference. Visit http://grc.com/ctwhat.htm for the technical explanation of why we're doing all of this. <match target="font" > <edit mode="assign" name="hinting" > <bool>true</bool> </edit> </match> 3. Set the hinting amount Usually, this should be full. Valid options are 'none', 'hintslight', 'hintmedium' and 'hintfull' which should be fairly self explanatory if you've read the article at the link above. <match target="font" > <edit mode="assign" name="hintstyle" > <const>hintfull</const> </edit> </match> ====Option 1) The 'Easy' Way==== Essentially, we're going to enable FreeType's non-patented autohinter and antialiasing to improve the appeareance of the default Bitstream fonts. Add the following to ~/.fonts.conf. #Enable anti aliasing This makes the fonts start to look nice, but some of the shapes will be distorted, so we need the FreeType autohinter (see next part). <match target="font" > <edit mode="assign" name="antialias" > <bool>true</bool> </edit> </match> Fluxbox only: You may need to enable anti alias separately on Fluxbox before it takes notice of the changes: fluxbox menu --> Configure --> AntiAlias #Enable the FreeType autohinter The autohinter is not turned on automatically, so we have to do this manually. Please note that OpenOffice.org binaries from the OOo website are built against the bytecode interpreter, so even if you have compiled FreeType with the bytecode interpreter and override it with the autohinter, OOo will still use the bytecode interpreter. <match target="pattern" > <edit mode="assign" name="autohint" > <bool>true</bool> </edit> </match> ====Option 2) The 'Hard' Way==== This is my ([[User:Cathectic]]) preferred solution, as I believe it gives better results. This involves rebuilding FreeType with the bytecode interpreter enabled, and then using the properly hinted fonts 'Core Fonts For the Web' from Microsoft. For this, you will need to: #Get a copy of FreeType that has the bytecode interpreter enabled. ##Download the Freetype sources from your local Slackware mirror (slackware-$VERSION/source/l/freetype) ##In freetype.SlackBuild, uncomment the line to apply the bytecode enabling patch ##Run the SlackBuild ##Replace your old freetype package with the new one you've just built. '''32bit X Applications (Slamd64 only)''': To enable 32bit applications in Slamd64 to use the bytecode interpreter, you need to install a 32bit bytecode enabled FreeType. #Download and install the 'Microsoft Core Fonts for the Web' (if you have a Windows installation, you could import the fonts from that instead. This tutorial assumes you do not) from either: ##LinuxPackages (install CabExtract, then CoreFonts) ##Or, From the 'Core Fonts for the Web' at http://prdownloads.sourceforge.net/corefonts/ ###Get all the *.exe files ###Get the CabExtract source RPM, rpm2tgz it, untar, build and install ###Use CabExtract to extract the *.ttf's from the *.exe's you downloaded, and then move the fonts to /usr/X11/lib/X11/fonts/TTF (/usr/share/fonts/TTF for X.Org 7 or newer). Now add the following to ~/.fonts.conf 1. Disable the autohinter This isn't strictly necessary – the autohinter is not enabled by default, and if it's not enabled, the bytecode interpreter is used by default. However, it's better safe than sorry. <!-- Disable autohinter - using bytecode interpreter instead --> <match target="pattern" > <edit mode="assign" name="autohint" > <bool>false</bool> </edit> </match> 2. Set the MS fonts as defaults <!-- Set sans-serif as Arial --> <match target="pattern" name="family" > <test name="family" qual="any" > <string>sans-serif</string> </test> <edit mode="assign" name="family" > <string>Arial</string> </edit> </match> <!-- Set monospace as Courier New --> <match target="pattern" name="family" > <test name="family" qual="any" > <string>monospace</string> </test> <edit mode="assign" name="family" > <string>Courier New</string> </edit> </match> <!-- Set serif to Times New Roman --> <match target="pattern" name="family" > <test name="family" qual="any" > <string>serif</string> </test> <edit mode="assign" name="family" > <string>Times New Roman</string> </edit> </match> (I would also recommend using the template in Appendix B to replace all the Bitstream and Luxi fonts with the MS equivalents (or set them to use serif, sans-serif, monospace instead)). ====Testing==== Just load any application up (I'd recommend a Gtk one, KDE will probably need a restart for the changes to take affect everywhere), and the changes should be immediately obvious (I used Mozilla Firefox, by opening and closing it after every tweak of ~/.fonts.conf, I was able to see the changes immediately). ====Apply System Wide==== You can apply these changes system wide, using /etc/fonts/local.conf If it exists, just append the sections you added above to it. If it doesn't, use your .fonts.conf as /etc/fonts/local.conf, and edit it as necessary (The order of precedence for processing is /etc/fonts/fonts.conf (automatically generated, don't edit it), /etc/fonts/local.conf then ~/.fonts.conf - meaning your ~/.fonts.conf will always override the system settings). ===Application Specific Settings=== Qt and Gtk settings need to be changed. ====Gtk==== For gtk, edit .gtkrc-2.0 and set the fonts either to the generic 'serif', 'sans-serif', etc (now aliased to the MS fonts), or specify the MS fonts outright. ====Qt==== For qt, edit .kde/kderc and .qt/qtrc ==Suggestions== ===Non TrueType fonts=== Non TrueType fonts don't render well on LCDs as they don't support hinting. For these fonts (e.g. Helvetica), it is recommended that you specify an alternative TrueType font (that is hopefully similar, but it doesn't have to be!) to use instead (in this case, whatever the default sans-serif font on the system is): <match target="pattern" name="family" > <test name="family" qual="any" > <string>Helvetica</string> </test> <edit mode="assign" name="family" > <string>sans-serif</string> </edit> </match> You can easily reuse this for other fonts. Just copy and paste, then replace 'Helvetica' with the font to replace, and 'sans-serif' with the font you want to replace it with (or you can use the generic descriptions 'serif', 'sans-serif' or 'monospace'). ===Old Gtk/Qt=== Some programs (usually older ones) using these libraries may not always use anti aliased fonts, even if you've specified them in .fonts.conf. This can fixed by: Gtk: Add the following to /etc/profile: export GDK_USE_XFT='1' qt: In ~/.qt/qtrc, ensure the following entry is present under [General]: enableXft=true useXft=true Programs coded using Gtk 1.x don't appear to support anti aliasing properly – you may want to consider replacing them with ones that use Gtk 2.x (e.g. Replacing XMMS with its Gtk2 fork, Beep Media Player) ===OpenOffice.org=== OpenOffice.org binaries are built against the bytecode interpreter. If you install a bytecode enabled FreeType, OOo will always use it, regardless of any system settings enabling the autohinter. Also, OpenOffice.org fonts have to be changed manually. Tools > Options > OpenOffice.org > 'Use system font for user interface' (make sure this is checked). ==Appendix A== The following is a ~/.fonts.conf / /etc/fonts/local.conf skeleton. Use this to put together a working configuration for your system. <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!-- Settings go between fontconfig tags --> </fontconfig> ==Appendix B== This section is a recommendation only. Some fonts are not TrueType, which means they don't support anti aliasing and look dreadful on an LCD. The way round this is to tell FreeType to replace any such fonts with a properly hinted TrueType equivalent. All of the Bitstream and Luxi fonts should be aliased in this way (some sites, such as Gnome's home page, use these fonts, and they don't render correctly with the bytecode interpreter). You can copy, paste and edit the following example for Helvetica for any other fonts you want to replace. (Just replace 'Helvetica' with the font to replace, and 'sans-serif' with the font you want it to be replaced with. Generic font descriptions serif, sans-serif and monospace are valid entries, as well as specific font names.) <!-- Replace Helvetica with default sans-serif --> <match target="pattern" name="family" > <test name="family" qual="any" > <string>Helvetica</string> </test> <edit mode="assign" name="family" > <string>sans-serif</string> </edit> </match> <alias> ==Footnotes== [1] Apparently, there are some monitors where the screen can be rotated. If so, perhaps the vrgb/vbgr settings might be better for you (but only when the screen is rotated) If you can test this, please report back the results. ==Bibliography== Man Page of fonts.conf - http://www.fontconfig.org/fontconfig-user.html<br /> XFree86 Font Configuration - http://www.xfree86.org/current/fonts2.html<br /> Explanation of Sub Pixel Hinting - http://grc.com/ctwhat.htm<br /> Gentoo Xorg & Fonts (And how to fix Konsole Linux fonts problem) - http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts<br /> If you're running an old version of XFree http://www.tldp.org/HOWTO/FDU/index.html b75d482f6194791191e0b023a6c8931212c85ab1 Burning CD/DVD 0 27 36 2009-05-28T22:21:33Z Erik 1 Manual copy of old data. wikitext text/x-wiki [[Category:Tutorials]] Random information about burning CD/DVD's with slack (and linux in general). Feel free to tack on any insight you might have on the subject. ==The Basics== In most modern situations, you will not have to tell the software which device to use (unless you have more than one device). In case you have older hardware or software, it may be necessary to pass the device info. On a 2.6 kernel, you can use: cdrecord dev=/dev/someDevice On a 2.4 kernel, you use one of these commands: cdrdao scanbus cdrecord -scanbus dev=ATA This should present you with some information: ATA:1,0,0 DVDRW , IDE1004 , 0151 1,0,0 100) 'DVDRW ' 'IDE1004 ' '0151' Removable CD-ROM To pass this device (1,0,0) to cdrdao or cdrecord: cdrdao --device 1,0,0 cdrecord dev=ATA:1,0,0 These will be SCSI ID's if you have a SCSI burner, or are using ide-scsi (no-longer necessary) ==CDR== ===Creating an image=== ====From a disc==== readcd dev=ATA:1,0,0 f=image.iso dd if=/dev/cdrom of=image.iso ====From a directory of files==== -r provides Rock Ridge extension (for posix)<br> -J provides Joliet extension (for windows) mkisofs -o image.iso -J -r /path/to/files/ ===Burning an image=== cdrdao write image.cue cdrecord -dao driveropts=burnfree dev=/dev/cdrom image.iso ==DVDR== ===From an image=== growisofs -dvd-compat -Z /dev/dvd=dvd.iso ===A directory of files=== -R provides Rock Ridge extension (for posix)<br> -J provides Joliet extension (for windows) growisofs -dvd-compat -Z /dev/dvd -J -R /path/to/files/ ===A DVD Video=== This path must be structured like a DVD, see Authoring. growisofs -Z /dev/dvd -dvd-video /path/to/dvd/files/ ==Blanking== ===Quick=== cdrdao blank --blank-mode minimal dvd+rw-format -blank /dev/dvd ===Full=== cdrdao blank --blank-mode full dvd+rw-format -blank=full /dev/dvd ==Links== ===Burning Software=== ; DVD+RW-Tools : http://fy.chalmers.se/~appro/linux/DVD+RW/ ; CDRDAO : http://cdrdao.sourceforge.net/ ; Cdrtools : http://www.fokus.fhg.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html ===GUI Frontends=== ; X-CD-Roast : http://www.xcdroast.org/ ; Gnome CD Master : http://cdrdao.sourceforge.net/gcdmaster/index.html ; Gnome Toaster : http://gnometoaster.rulez.org/ ; Nautilus-CD-Burner : http://www.gnome.org/projects/nautilus/ ; K3B : http://www.k3b.org/ ===Authoring Tools=== ; dvdauthor : http://dvdauthor.sourceforge.net/ ; DVDStyler : http://dvdstyler.sourceforge.net/ ; &lsquo;Q&lsquo; DVD-Author : http://qdvdauthor.sourceforge.net/ ===Format Converters=== ; CCD2ISO : http://ccd2iso.sourceforge.net/ ; NRG2ISO : http://gregory.kokanosky.free.fr/v4/linux/nrg2iso.en.html 1702ede72a6539ac8a9aae2d495e755219fe204f SSH Keys 0 28 37 2009-05-28T23:54:54Z Erik 1 Manual copy of old data. wikitext text/x-wiki Having to type an SSH password everytime may get annoying in some cases. Well there is thing called password-less SSH logins. First we need to create a key by issuing the following command from the local client machine: ssh-keygen -t dsa Now press enter on the location and the pass-phrase. Now we have made the actual key, so we can copy the key over to the remote server: ssh-copy-id -i ~/.ssh/id_dsa.pub user@host Now 'user' is the actual user of the remote server, and 'host' you replace with the servers IP or Hostname. Now it might ask if you wish to continue, you make sure you hit yes, and the password you type is the password for the user on the remote server. Now lets login: ssh user@host You will log right into the server without typing in a password. It will also not ask for a password when you are going to scp a file over, too. To copy your key to another remote server, simply run the ssh-copy-id command again with another $USER@$HOST specified. [[Category:Tutorials]] db3940ba0fdcac805c0e46b234d29db40caf4f1a Scroll Wheel 0 29 38 2009-05-28T23:56:05Z Erik 1 Manual copy of old data. wikitext text/x-wiki [[Category:Tutorials]] __TOC__ Many people wonder how to enable scrolling on their Mouse, This tutorial is going to describe how to enable it on X-Windows. First you must figure out what Slackware version you are running. This is needed to tell if you edit the XF86Config or the xorg.conf file. The first step is to su into root: su Then you must edit the X config, On slackware 9.1 it is: vi /etc/X11/XF86Config And on Slackware 10.0 you must edit xorg.conf: vi /etc/X11/xorg.conf ==3 and 5 button mice== I used "vi" to edit my files because that's my editor of choice, But if you want to use pico, or anything else feel free to do so. Now you must search for the following items in the config: Section "InputDevice" Identifier "Mouse0" Now below that you must add the following items: Option "Buttons" "5" Option "ZAxisMapping" "4 5" And I had to change the mouse protocol, so if it doesn't work you should change it to IMPS/2: Option "Protocol" "IMPS/2" Summing it up, below is the entire section: Section "InputDevice" Identifier "Mouse0" Driver "mouse" Option "Device" "/dev/input/mice" Option "Protocol" "IMPS/2" Option "Buttons" "5" Option "ZAxisMapping" "4 5" EndSection The last step is saving the file and restarting X, you now should have a scrolling mouse:) ==7 button mice== You can use the command `X -version` to find your version of X.<br> Here is a section of xorg.conf for 7 button mouse (MX-700) will most likely work for others.. Section "InputDevice" Identifier "Mouse0" Driver "mouse" Option "Device" "/dev/input/mice" Option "Protocol" "ExplorerPS/2" Option "Buttons" "7" Option "ZAxisMapping" "6 7" EndSection You then need to use Xmodmap to remap the scroll wheel, this can be ~/.Xmodmap or /etc/X11/xinit/.Xmodmap or even just `xmodmap -e` in whatever X startup script you're using. The extra 2 buttons (usually forward/back) will be mapped in most web browsers like galeon and firefox. If you need to map them for other applications, look at imwheel http://imwheel.sourceforge.net/ pointer = 1 2 3 6 7 4 5 Xorg 6.9 (Slackware-current as of May 30th, 2006) has a known issue with correctly exposing the number of mouse buttons present. The presence of this problem may be verified by running xmodmap -pp and noting the presence of 11 buttons instead of 7. (xev was handy in determining what number each button was being read as.) This may be corrected by using the following Xmodmap: pointer = 1 2 3 8 9 4 5 6 7 10 11 ==Multi-Button Mice== Recent versions of the XOrg server include a ButtonMapping option that allows you to remap mouse buttons in a specific order. This is particularly useful for users of multi-button mice such as the Razer DeathAdder and MS Intellimouse Explorer. The following section of an xorg.conf file (modified from [http://linux.wordpress.com/2006/06/06/tip-my-logitech-mx700-mouse-with-linux-and-firefox/ this blog post]) allows you to use the additional "thumb buttons" under X as you would on MS Windows provided applications support that functionality (the expected behavior is the default for Firefox, the additional buttons seem to do nothing in Konqueror by default). Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Name" "Razer Deathadder" Option "Device" "/dev/mouse" Option "Vendor" "Razer" Option "CorePointer" Option "Protocol" "ExplorerPS/2" Option "Buttons" "7" Option "ZAxisMapping" "4 5" Option "ButtonMapping" "1 2 3 6 7" EndSection Each mouse is different, so you should use xev to verify that the additional buttons are working in the manner that they ought. ==MX1000== Here is my Logitech MX1000 configuration, it allows ALL buttons on this mouse to work with X11 (X.org 6.8.2 + evdev patches). xorg.conf Section "InputDevice" Identifier "MX1000" Driver "mouse" Option "CorePointer" Option "Protocol" "evdev" Option "Dev Name" "Logitech USB Receiver" Option "Buttons" "12" Option "ZAxisMapping" "11 12 10 9" Option "Resolution" "800" Option "Emulate3Buttons" "false" EndSection Xmodmap ! MX1000 pointer = 1 2 3 8 9 10 11 12 6 7 4 5 xbindkeysrc [http://hocwp.free.fr/xbindkeys/xbindkeys.html xbindkeys] [http://homepage3.nifty.com/tsato/xvkbd/ xvkbd] # Backward and Forward buttons "xvkbd -text "\[Alt_L]\[Left]"" m:0x10 + b:8 "xvkbd -text "\[Alt_L]\[Right]"" m:0x10 + b:9 # "Cruise Control" "xvkbd -text "\[Page_Up]"" m:0x10 + b:11 "xvkbd -text "\[Page_Down]"" m:0x10 + b:12 ==EvDev== This info will help you get your MX1000 or other evdev device working with X.org 6.9/7.0. This version of X.org has the evdev driver and does not need to be patched. First, edit (or create) your /etc/udev/rules.d/10-local.rules file and add the following line: KERNEL=="event*", SYSFS{../manufacturer}=="Logitech", SYSFS{../product}=="USB Receiver", NAME="input/mx1000", MODE="664", GROUP="plugdev" This gives you a /dev/input/mx1000 node after running udevstart or rebooting. If your mouse is different, dig through sysfs and use lsusb and udevinfo to find your manufacturer and product. They need to match. Next edit your /etc/X11/xorg.conf, add/change your mouse section to this: Section "InputDevice" Identifier "Logitech MX1000" Driver "evdev" Option "Device" "/dev/input/mx1000" EndSection NOTE that you no-longer specify "ZAxisMapping" or "Buttons", the evdev driver takes care of this for you. Your ServerLayout section should be adjusted if you changed the Identifier line above: InputDevice "Logitech MX1000" "CorePointer" You no-longer need Xmodmap to remap the scroll wheel buttons. Remove any system-wide and user Xmodmap/.Xmodmap files (or sections you have in those files pertaining to your mouse). You still need xbindkeys and xvkbd as listed above to bind forward/back and pageup/down buttons. (This info was gathered from a much better and thorough guide, you should check it out. http://floam.sh.nu/index.xhtml?page=guides&section=mx1000) ==X.org 7.1== You do not need to use the udev tricks above, this just makes things more difficult. Instead, now X will read your evdev device in a much more sane way. Here is my config for an MX1000 and X.org 7.2. This will work for nearly all USB mice, and is the preferred Driver since it eliminates the need to specify Buttons, ZAxisMapping, Xmodmap, etc. All of your buttons will work and be mapped correctly. Section "InputDevice" Identifier "MX1000" Driver "evdev" Option "Name" "Logitech USB Receiver" Option "CorePointer" EndSection You may have to use "Dev Name" if "Name" does not work. You can find the "Name" by doing <code>cat /proc/bus/input/devices</code> I: Bus=0003 Vendor=046d Product=c50e Version=2500 N: Name="Logitech USB Receiver" P: Phys=usb-0000:00:1d.3-1/input0 S: Sysfs=/class/input/input2 H: Handlers=mouse0 event2 B: EV=7 B: KEY=ffff0000 0 0 0 0 0 0 0 0 B: REL=143 36e04878c2607be548ff37b3512553b20300c84f Permissions and Umasks 0 30 39 2009-05-28T23:56:59Z Erik 1 Manual copy of old data. wikitext text/x-wiki ==Normal Permissions== On *nix-like systems, traditionally every file has an owner, an assigned group, and a list of permissions (although POSIX Access Control Lists are getting more popular). You can change the owner of a file with the "chown" command: : <code>fred@linux:~> chown someUser foo</code> You can change the group of a file with the "chgrp" command: : <code>fred@linux:~> chgrp someGroup foo</code> Alternatively, you can do both at once: : fred@linux:~> <code>chown someUser.someGroup foo</code> or: : fred@linux:~> <code>chown someUser:someGroup foo</code> For every file, you can set the following for the User, Group, and Others: r - can read w - can write x - can execute These are set with the "chmod" command: : fred@linux:~> <code>chmod u=rwx,g=rx,o=r foo</code> : fred@linux:~> <code>ls -l foo</code> : -rwxr-xr-- 1 fred users 0 2004-10-26 11:38 foo You don't need to set all the permissions - you can just modify them, for example, to make a file executable: : fred@linux:~> <code>chmod +x foo</code> You can also change the permissions just for either the User, Group, or Others: : fred@linux:~> <code>chmod o-x foo</code> ==Octal Permissions== You can also specify permissions with a number. To find out which numbers, add up the numbers from this table: r w x 4 2 1 For example, rwxr-xr-- would be: U G O 4 4 4 +2 +0 +0 +1 +1 +0 =7 =5 =4 So to give a file rwxr-xr-- permissions: : fred@linux:~> <code>chmod 754 foo</code> ==Umasks== umasks define which permissions can not be set (in octal). For example, the default umask on slackware is 0022: : fred@laptop:~$ <code>umask</code> : 0022 Ignoring the first digit, this means that the owner can do anything, but group and others are unable to write (2 == w). A more secure umask (possibly more suitable for your ~/) is 0077, meaning that group and others have no access to your files. ==More Umask== The following is based on [[User:Sandman1|Sandman1]]'s Umask tutorial. Well first this is a pretty boring topic to write about, So im going to get right to the point. When you set a umask you set what permission NOT to set. So when you create a file it uses the umask to set the file permissions. All of this might not make sense now but it will later. Now type: : <code>umask</code> Now on slackware you will get "0022", First ignore the first 0. Now we have 022. The first 0 makes sure the owner has ALL the permissions of a file. You can tell that becuase you have no permissions you want to turn off. Now the next two numbers you have a 2 for. The 2 indicates that you NEVER want to set write permissions. Now that method above of trying to find a umask is a bit confusing. All you do is set the number what you DON'T want the user to have. Now there is an easier way of finding out a umask. You can subtract the permission from 777. Example: 777 - 750 = 027 That is the umask of the 750 permission. Now you may be asking yourself what is this usefull for. Well you can set the umask by typing "umask 027" in bash and when you create a file/directory it goes by umask 027 instead of the 0022. Now another reason for setting a umask is becuase you want to access a filesystem such as NTFS,VFAT,Samba,etc as a regular user. You can set the umask and allow regular users to write to the filesytem. It is really easy, in the fstab all you add is "umask=027" and remount the filesystem. See [[Windows_Partitions]] for more information (and a potentially better option than setting umask options). [[Category:Tutorials]] a733e385a9bde5877ec30fda985673302ca6c137 Resource Limits 0 31 48 2009-05-29T00:17:30Z Rworkman 13 Move from old wiki wikitext text/x-wiki = Purpose = This page does not attempt to explain the different types of system resource limits or when it is (or is not) appropriate to change them; see '''man ulimit''' and [[http://google.com Google]] for that discussion. However, some users run into problems with the linux kernel's default limit settings, so we'll attempt to explain how to modify them to suit special needs. = Overview = The default settings provided by the kernel are sane values for most multi-user machines. Issuing the command '''ulimit -Hn''' should show the following: user@host:~$ ulimit -Hn 1024 and '''ulimit -n''' should show this: user@host:~$ ulimit -n 1024 The first command shows the hard limit set by the kernel, and the second command shows the soft limit set by the user. An unprivileged user can increase the soft limit (up to the hard limit value), and he is also able to lower the hard limit (but then is unable to increase it, as an unprivileged user cannot raise the hard limit at all). There are some situations which might require a larger hard limit for users, and the obvious "solution" is to add a line in /etc/profile to increase it. However, this will not work, because normal users cannot increase their hard limits (as indicated above). = Solution = To increase the hard limits for users, you will need to create '''/sbin/initscript''' and place appropriate commands inside it. The easiest way is to copy the file '''/sbin/initscript.sample''' to '''/sbin/initscript''' and edit the copy, but you are certainly free to "roll your own." If you decide to create your own, make sure it is executable or it will not work. Using the following '''/sbin/initscript''' file: PATH=/bin:/sbin:/usr/bin:/usr/sbin export PATH # Increase the hardlimit for open files ulimit -Hn 4096 # Execute the program. eval exec "$4" You should get the following after a reboot: user@host:~$ ulimit -Hn 4096 user@host:~$ ulimit -n 1024 Notice that the hardlimit is now 4096 (as specified in /sbin/initscript), but the softlimit is still 1024. In other words, you will still need to use /etc/profile (or some other shell init file - see below for recommendation) to raise the desired users' softlimits. With some creative scripting, you can be more selective about which users have what limits. Rather than editing the system /etc/profile, it's recommended to create a custom file in /etc/profile.d and make it executable. This way, you don't have to worry about trying to merge your changes to /etc/profile when doing Slackware upgrades to new versions. = Other Resources = * '''man initscript''' * '''man ulimit''' [[Category:Tutorials]] 7a3550a5c0730a78ccebae57e4fab68cb1393f29 Windows Partitions 0 32 49 2009-05-29T00:19:35Z Rworkman 13 Moved from old wiki wikitext text/x-wiki One of the frequent questions on ##slackware is something along the lines of "How can I allow normal users to access my Windows partition?" There are *at least* two different ways of doing this. For a FAT partition, you *could* add umask=0000 to /etc/fstab's options, but I personally don't recommend doing that. It's *your* computer, so you make the call, but I would do something along these lines: 1. If you want *every* user to be able to read and write to the partition, then you can add dmask=0000 and fmask=0111 to /etc/fstab's options and be done with it - problem solved. /dev/hda1 /mnt/win98 vfat rw,dmask=0000,fmask=0111 0 0 The reason for dmask/fmask as opposed to umask is quite obvious (though I hadn't thought about it until elohim on ##slackware pointed it out): The FAT and NTFS file systems don't "understand" the executable (-x) bit, so it's automatically present on every file in such a filesystem. There's no need for normal files to be executable (and it can indeed be a security risk), so we use fmask to turn off those permissions. 2. If you only want some users to be able to read and write to the partition, but you want *every* user to have read access, then you'll want something along these lines. First, create a special group called "windows" (change the name if you wish) by adding it to /etc/group using your favorite editor and add to this group the users you want to have write access. nogroup:x:99: users:x:100: console:x:101: windows:x:102:user1,user2,user3 Next, edit your /etc/fstab line for that partition and specify that it be mounted with group ownership of the "windows" group, and that write access be removed from others. /dev/hda1 /mnt/win98 vfat rw,gid=102,dmask=0002,fmask=0113 0 0 An NTFS partition will be mounted read-only, so you won't have write access for anyone, but the central idea is the same. If you don't want everyone else to even have read access to the partition, you can easily do that with the above fstab line modified a bit: /dev/hda1 /mnt/winXP ntfs ro,gid=102,dmask=0227,fmask=0337 0 0 If you prefer write access to the partition, then you can use ntfs-3g instead and something like this: All users can read the partition; only members of gid 102 can write: /dev/hda1 /mnt/win98 ntfs-3g rw,gid=102,dmask=0002,fmask=0113 0 0 Users of gid can read and write; nobody else can do anything: /dev/hda1 /mnt/winXP ntfs-3g rw,gid=102,dmask=0007,fmask=0117 0 0 For more information, see the [[Permissions and Umasks]] and [[Fstab]] pages. --rworkman (thanks to Erik for the pointers about dmask and fmask) [[Category:Tutorials]] 6e47018ae54c8b5bd08edc300568e012b97465bc User:Rworkman 2 33 50 2009-05-29T00:20:50Z Rworkman 13 Added talk page wikitext text/x-wiki http://slackware.com/~rworkman/ http://rlworkman.net/ ec5b5dedb4f8fc93827f7e35cca099280fbce09c User:Rworkman 2 33 51 50 2009-05-29T00:21:28Z Rworkman 13 wikitext text/x-wiki http://slackware.com/~rworkman/ http://rlworkman.net/ aeafff34f91018979591ed5612cd9896cf89821f Links 0 3 52 35 2009-05-29T00:36:32Z Rworkman 13 Removed one of my links wikitext text/x-wiki ==Slackware Links== * http://www.slackware.com - the home of Slackware * http://www.slackwaregallery.com - our ugly mugs :) * ftp://termserver.niesc.org/pub/sandman1 - Packages mostly by [[User:Sandman1|Sandman1]] * http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ - Slackware FAQ by [[User:juhl|juhl]] (Jesper Juhl) * http://slackware.wordpress.com - Slackware Blog by [[User:Tyler|Tyler]] * http://www.slackbook.org - updated version of the slackware book * http://fredemmott.co.uk/rss.php - RSS feeds for slackware 10 patches and the slackware-current ChangeLog * http://slackware.it/en/rss - RSS feeds for stable Slackware release and -current ChangeLog * http://userlocal.com/ - A focal point for the online Slackware Linux community * http://www.slackware.com/getslack - Extensive listing of Slackware mirrors * http://www.slackbasics.org/ - "Slackware Linux Basics" by Daniel de Kok * http://uselesstree.org/ - The Complete Slacker * http://shilo.is-a-geek.com/ - Shilo's tutorial * http://www.linuxquestions.org/questions/forumdisplay.php?forumid=14 - Slackware forum * http://www.kde-look.org/content/show.php?content=23384 - Slack-Track - a superkaramba theme to track the slackware-current changelog on your desktop, created by [[User:omal|omal]] * http://www.slacklife.com.br - Slackware Brazillian Community - by [[User:Redhate|redhate]] * http://www.slackware-peru.org - Slackware Peruvian Community - by [[User:R1CHARD|R1CHARD]] * http://slackware.linux.or.id - Indonesian Slackware Community - by [[User:Willysr|Willysr]] * http://open-eslack.org/ - Spanish Slackware community * http://sbopkg.org - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs * http://www.themedepot.org/ - Generalized theme site for X11 based programs ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==Free packages== * [http://slackware.com/~alien/ http://slackware.com/~alien/] Eric Hameleers' packages * [http://rlworkman.net/pkgs/ http://rlworkman.net/pkgs/] rworkman's packages * http://www.linuxpackages.net/ * [http://www.slacky.eu/repository/slackware-11.0/ Slacky.eu] Italian Slackware site * [http://www.audioslack.com/packages/ Audioslack.com] Audio software packages * [http://straterra.info/Packages/ http://straterra.info/Packages/] Straterra's packages * [http://www.sekurity.com/packages/ Sekurity.com] dadexter's packages * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware * [http://scxd.info/en/ Slackware Current eXtended Desktop] Packages for Slackware Current * [ftp://termserver.niesc.org/ ftp://termserver.niesc.org] Sandman1's packages ==.SlackBuild Repositories== * http://slackbuilds.org - The SlackBuilds.org Project * http://slackbuilds.net - The French SlackBuilds Repository * http://www.slackware.com/~alien/slackbuilds/ - Eric "Alien" Hameleer's SlackBuilds * http://contrib.slamd64.com - [http://contrib.slamd64.com buildcontrib] can build and fetch these packages for you. Primarily for Slamd64, but work on x86 as well * http://slackbuild.strangeworlds.co.uk - cathectic's SlackBuilds * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. * http://textlinux.slackadelic.com/slackbuilds/ - A repository dedicated to command line (friendly) applications * http://scxd.info/pub/slackbuilds/ - Slackware Current eXtended Desktop's SlackBuilds ==Live CD's based on Slackware== * [http://www.remote-exploit.org/index.php/Main_Page BackTrack] The result of the merging of two Innovative Penetration Testing live Linux distributions: Whax and Auditor * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://alien.slackbook.org/ Alien Bob's Wiki] * http://open-eslack.org/wiki/ - Wiki of the Slackware spanish community * http://slackware.linux.or.id/wiki/ - Indonesian Slackware Wiki c16a3719679499acf0fcff976ee18ac592ac96bf 53 52 2009-05-29T02:33:21Z Erik 1 Removed dead, porn, and otherwise redirecting links. Also fixed a few. wikitext text/x-wiki ==Slackware Links== * http://www.slackware.com - the home of Slackware * http://www.slackwaregallery.org - our ugly mugs :) * http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ - Slackware FAQ by [[User:juhl|juhl]] (Jesper Juhl) * http://slackware.wordpress.com - Slackware Blog by [[User:Tyler|Tyler]] * http://www.slackbook.org - updated version of the slackware book * http://dev.slackware.it/rss/ - RSS feeds for stable Slackware release and -current ChangeLog * http://userlocal.com/ - A focal point for the online Slackware Linux community * http://www.slackware.com/getslack - Extensive listing of Slackware mirrors * http://www.slackbasics.org/ - "Slackware Linux Basics" by Daniel de Kok * http://www.linuxquestions.org/questions/slackware-14/ - Slackware forum * http://www.kde-look.org/content/show.php?content=23384 - Slack-Track - a superkaramba theme to track the slackware-current changelog on your desktop, created by [[User:omal|omal]] * http://www.slacklife.com.br - Slackware Brazillian Community - by [[User:Redhate|redhate]] * http://slackware.linux.or.id - Indonesian Slackware Community - by [[User:Willysr|Willysr]] * http://open-eslack.org/ - Spanish Slackware community * http://sbopkg.org - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==Free packages== * [http://slackware.com/~alien/ http://slackware.com/~alien/] Eric Hameleers' packages * [http://rlworkman.net/pkgs/ http://rlworkman.net/pkgs/] rworkman's packages * http://www.linuxpackages.net/ * [http://www.slacky.eu/repository/slackware-11.0/ Slacky.eu] Italian Slackware site * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware * [http://scxd.info/en/ Slackware Current eXtended Desktop] Packages for Slackware Current ==.SlackBuild Repositories== * http://slackbuilds.org - The SlackBuilds.org Project * http://slackbuilds.net - The French SlackBuilds Repository * http://www.slackware.com/~alien/slackbuilds/ - Eric "Alien" Hameleer's SlackBuilds * http://slackbuild.strangeworlds.co.uk - cathectic's SlackBuilds * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. * http://scxd.info/pub/slackbuilds/ - Slackware Current eXtended Desktop's SlackBuilds ==Live CD's based on Slackware== * [http://www.remote-exploit.org/ BackTrack] The result of the merging of two Innovative Penetration Testing live Linux distributions: Whax and Auditor * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://alien.slackbook.org/ Alien Bob's Wiki] * http://open-eslack.org/wiki/ - Wiki of the Slackware spanish community * http://slackware.linux.or.id/wiki/ - Indonesian Slackware Wiki 5a3f2c00982d8ab7975ed42adf92d609725dbf50 54 53 2009-05-29T02:36:07Z Erik 1 Added RSS section and Category tag wikitext text/x-wiki [[Category:Information]] ==Slackware Links== * http://www.slackware.com - the home of Slackware * http://www.slackwaregallery.org - our ugly mugs :) * http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ - Slackware FAQ by [[User:juhl|juhl]] (Jesper Juhl) * http://slackware.wordpress.com - Slackware Blog by [[User:Tyler|Tyler]] * http://www.slackbook.org - updated version of the slackware book * http://userlocal.com/ - A focal point for the online Slackware Linux community * http://www.slackware.com/getslack - Extensive listing of Slackware mirrors * http://www.slackbasics.org/ - "Slackware Linux Basics" by Daniel de Kok * http://www.linuxquestions.org/questions/slackware-14/ - Slackware forum * http://www.kde-look.org/content/show.php?content=23384 - Slack-Track - a superkaramba theme to track the slackware-current changelog on your desktop, created by [[User:omal|omal]] * http://www.slacklife.com.br - Slackware Brazillian Community - by [[User:Redhate|redhate]] * http://slackware.linux.or.id - Indonesian Slackware Community - by [[User:Willysr|Willysr]] * http://open-eslack.org/ - Spanish Slackware community * http://sbopkg.org - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==Free packages== * [http://slackware.com/~alien/ http://slackware.com/~alien/] Eric Hameleers' packages * [http://rlworkman.net/pkgs/ http://rlworkman.net/pkgs/] rworkman's packages * http://www.linuxpackages.net/ * [http://www.slacky.eu/repository/slackware-11.0/ Slacky.eu] Italian Slackware site * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware * [http://scxd.info/en/ Slackware Current eXtended Desktop] Packages for Slackware Current ==.SlackBuild Repositories== * http://slackbuilds.org - The SlackBuilds.org Project * http://slackbuilds.net - The French SlackBuilds Repository * http://www.slackware.com/~alien/slackbuilds/ - Eric "Alien" Hameleer's SlackBuilds * http://slackbuild.strangeworlds.co.uk - cathectic's SlackBuilds * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. * http://scxd.info/pub/slackbuilds/ - Slackware Current eXtended Desktop's SlackBuilds ==Live CD's based on Slackware== * [http://www.remote-exploit.org/ BackTrack] The result of the merging of two Innovative Penetration Testing live Linux distributions: Whax and Auditor * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://alien.slackbook.org/ Alien Bob's Wiki] * http://open-eslack.org/wiki/ - Wiki of the Slackware spanish community * http://slackware.linux.or.id/wiki/ - Indonesian Slackware Wiki ==RSS Feeds== * http://dev.slackware.it/rss/ - RSS feeds for stable Slackware release and -current ChangeLog * http://slackbuilds.org/mirror/rss/ - ChangeLog RSS feeds for 8.1 through -current 37fa00faf563afe117c1e44d3933f409e71cc3bf 3ware 3DM2 0 34 55 2009-06-02T02:57:02Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] ==3DM2== 3DM2 is 3ware's web-based interface for controlling and status checks for their RAID cards. It contains a small web server that allows configuration and maintenance to the RAID array and provides status reports. It has an email notification feature that reports RAID problems and glitches. ==Installing 3DM2 On A Slackware Box== (written from a 3DM2 V9.3.0.7 and Slackware 11 perspective) 1) Gunzip and un-tar the 3DM2 archive. 2) As root, run <code>install.3dm install</code> to install. ::This script does four things- :::a) It complains that you aren't running RedHat or Suse and therefore will not automatically install the 3DM2 init scripts in the <code>/etc/rc.d</code> directory. You have to manually do this, this is explained later in this instruction. :::b) It makes a <code>/tmp/3ware</code> directory and un-compresses the 3DM2 files there. :::c) It copies the <code>3dm2</code> binary to <code>/usr/sbin</code>. :::d) It makes a <code>/etc/3dm2</code> directory. ::''NOTE: the <code>/tmp/3ware</code> directory is NOT removed after install. It is not necessary to keep but, you may want to keep the <code>install.3dm2</code> binary in case you ever want to uninstall 3DM2.'' 3) Edit <code>/etc/rc.d/rc.local</code> and add the following line: ::<code>/usr/sbin/3dm2</code> 4) ''If you are running a restrictive firewall'', open port 888. 5) Start 3DM2 by: <code>3dm2</code> 6) Using a web browser, browse to your RAID machine, port 888. ::'''If your web-browser is on the same box as your RAID array'''- click here:[https://localhost:888 http'''s'''://localhost:888] ::'''If your web-broswer is NOT on the same box as your RAID array'''- ::::a) Edit your <code>/etc/3dm2/3dm2.conf</code> file and change the <code>RemoteAccess 0</code> to <code>RemoteAccess 1</code> ::::b) Browse to your machine using HTTPS and port 888- ::::::EXAMPLE: <code> https://192.186.1.2:888</code> ::::::::or <code>https://server.mydomain.net:888</code> 7) Once the web interface loads up, log in as ADMINISTRATOR (default password is "3ware") and complete the configuration. 8) To activate the help files, you'll need to copy them to the correct location. ::::a) View your /etc/3dm2/3dm2.conf file. ::::b) Make a note of the Help entry. 9) Go to /tmp/3ware/. 10) Untar the file 3dm-help.tgz. A directory corresponding to your language with all the help files in it will be created. For this example (English), the directory was called en. 11) Copy the en directory into the location you made a note of in 8b above. Copy the whole directory, not just the files inside the directory. 12) Now when you are logged in to the 3dm2 application inside a browser and you click on help, you will get the help screens. -------------------------------------------------------------------------------------------- (written from a 3DM2-Linux-9.3.0.4 and Slackware '''12.0''' perspective) Using the 3DM2-Linux-9.3.0.4 seems to be ideal for slackware. I have it running on Slackware 10.2 Slackware 11.0 (2.4 and 2.6 kernels) Slackware 12.0 (Defult 2.6 kernel) with the following cards: 7006-2 Series 8006-2LP Serise 9500S Series The directions I found to work best are as follows. 1a) Download 3DM2-Linux-9.3.0.4.tgz from: http://www.3ware.com/support/download.asp 2a) Please select your 3ware product. = $YOUR_CARD_MODEL 3a) Please Select Item = *LEAVE BLANK* 4a) Latest = 9.3.0.4 5a) Please select the item to download = 3DMD2 Management Utility 6a) Then select Linux as your OS, select 3DM2-Linux-9.3.0.4.tgz to download, read the EULA, and download somewhere reachable by your Linux OS. For the sake of instructions, we'll say /usr/src/3ware. 01) cd /usr/src/3ware 02) tar xfvz 3DM2-Linux-9.3.0.4.tgz 03) run: ./install -i This extracts files to: /tmp/3ware ...moves the appropriate binary to: /usr/sbin/3dm2 ...and creates the directory: /etc/3dm2 Now we need to create another directory. For the sake of instructions, we'll say /3ware/. 04) mkdir /3ware 05) run: cp -rf /tmp/3ware/* /3ware/ 06) run: cp /usr/src/3ware/3dm-lnx.tgz /3ware/ 07) run: cd /3ware 08) run: ./install To the following questions, answer the defaults: Was RPM used to install the Escalade driver and/or 3dm?? (Y/N) [N] Please enter the location of the help documentation. [/usr/local/doc/3dm] Now you will get what appears to be an error. "3dm binary missing. Installation stopping." Don't worry, the binary file is already in place. If you notice though, the /etc/3dm2 directory is empty. 09) run: /usr/sbin/3dm2 This will populate that directory with the default config file, that you may edit to your satisfaction. If you leave the config file as is, you should be able to connect to your server from the local host at https://localhost:888 (*https* is very important). In order to connect from another PC, edit /etc/3dmd2/3dmd2.conf line RemoteAccess 0 to RemoteAccess 1 1b) run: killall 3dm2 2b) run: /usr/sbin/3dm2 The default password for both "USER" and "ADMINISTRATOR" = "3ware" 29c316149f72ed7db953c6f461ea8685902079c9 ALSA 0 35 56 2009-06-02T02:58:03Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] ==Non-USB Cards== I'm sure that everyone has had their share of audio problems in Slackware, Well I'm going to try and get that audio working for you. First you want to know what kind of sound card you have, usually PCI so type this in: : <code>/sbin/lspci</code> This will let you know the audio card you have, now that you have it written down we are going to run a program to configure your card: : <code>/usr/sbin/alsaconf</code> This will configure your sound and hopefully detect it. Well there are many reasons of why it wouldn't have detected your card, so I'm just going to make a list for you: # alsa-driver's package isn't compiled for the kernel you are running. # If you don't have alsa-drivers package, then your 2.6 kernel (hopefully because 2.4 doesn't have built in drivers for alsa) doesn't have the drivers compiled in. # Your modules are screwed up :) ==All Cards== Now that we have all of that together, try to play an MP3 sound file as root: : <code>mpg321 file.mp3</code> Now if that plays you are good to go, but if it doesn't then you might want to check on the things above. If it doesn't work then you type this in: : <code>cat /proc/asound/cards</code> Now this will show all the cards that alsa has loaded modules for and what alsa detected. Now with one driver you will see a modem occupying sound device 0. We do not want that because it will conflict. The module for the sound card is snd-intel8x0. Now we need to add the module for the modem to the blacklist: : <code>echo "snd-intel8x0m" >> /etc/hotplug/blacklist</code> Now make sure you use two >'s because if you use only 1, it will overwrite the file and we do not want that. Now restart your machine and you will now have a non conflicting sound module for the intel 8x0 cards. Now we also want to change permissions: : <code>chmod 666 /dev/dsp*</code> : <code>chmod 666 /dev/snd/*</code> Now this will make sure OSS and ALSA have permission for everyone to access the sound devices, Now in slackware 10 you just add yourself to the audio group, but Slackware 9.1 doesn't have that option. Now say you want to change the volume levels? : <code>alsamixer</code> When you type that you will get an ncurses based mixer program:) This is great for changing volumes and muting certain things. Per default all channels are muted (alsaconf will unmute a few though). You can unmute them with M. Channels that you should watch are PCM and Master. Those often control the sound level. Now say you have the sound mixers perfect and you want to save them: : <code>alsactl store</code> This stores the config and is restored at bootup. You can also restore later on if you screw them up to by typing the following: : <code>alsactl restore</code> There is one tip for the Sound Baster 5.1 cards, sometimes you want to MUTE digital out so you can hear on all the speakers, in alsamixer you just press M on the <tt>Analog/Digital Output Jack</tt> item. 15044c77be56287862303eb3ed26100ead7e4696 ATI Graphics 0 36 57 2009-06-02T02:58:40Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Hardware]] ===Introduction=== ATI drivers come in two flavours: 1) X.Org open source 'radeon' driver - full support (accelerated 2D and 3D) for the Radeon 9200 and earlier. (Also supported for the 9200 - X850 for Slackware -current, or any Slackware newer than 11.0) 2) ATI's proprietary closed source 'fglrx' driver - support for the 9500 and above (all support for earlier cards has now been dropped). This is the only driver with any support, either 2D or 3D, for the X1xxx series of cards (R500 and newer). ====Kernel==== AGPGART: If you have an AGP card, you should ensure AGPGART and support for your specific GART are built in the kernel (built in or module is fine) PCI Express: If you have a PCI Express card, you should ensure PCI Express support is built in the kernel. ==Seting up the 'radeon' driver== ===Preparing Your System=== ====Kernel==== Direct Rendering Manager (DRM): Module or built in, plus the module under this for "ATI Radeon" ===Initial Setup=== Edit /etc/X11/xorg.conf In Section "Module" add: Load "glx" Load "dri" At the end of the file, add Section "DRI" Mode 0666 EndSection (Or use 'Xorg -configure' to generate a new xorg.conf to autodetect the ATi card) ===Tweaking=== To increase performance for Radeon users (in particular, R300 and R400), you may also want to add the following under the "Device" section for the radeon: ====AGP users==== Option "AGPMode" "8" # Modify accordingly if you don't have an AGP 8x card Option "AGPFastWrite" "true" # This one has big warnings all over it, so test it first! ====Mobility card users==== Option "DynamicClocks" "true" # The equivalent of ATi's PowerPlay Option "BIOSHotkeys" "true" # You _might_ need this for some special function keys on your laptop ====All users==== Option "EnablePageFlip" "true" Option "ColorTiling" "true" ===Final Check=== Run 'glxinfo | grep render'. It will return something like the following (the last line will vary depending on R300/ R400, PCI/ PCIE or AGP, etc). The important thing is that this reports "direct rendering: yes". direct rendering: Yes OpenGL renderer string: Mesa DRI R300 20060815 AGP 8x x86/MMX+/3DNow!+/SSE TCL ===Notes=== '''R300 - R400:''' Please note that these cards do not have accelerated hardware support in X.Org < 6.9 (i.e. Slackware 11.0 or older) '''R500 (X1xxx and above)''' Sorry, there is no open source accelerated support in X for these cards. Either use fglrx or vesa. ==Setting up the 'fglrx' driver== ===Preparing Your System=== ====Libraries==== The fglrx driver requires that you have the package cxxlibs installed on your system to build it. '''(Slamd64)''': You will also need the 32 bit compatibility libraries from c/ ====Kernel==== Direct Rendering Manager (DRM): Must *not* be built into the kernel - it should be a module (and not loaded) or not built. Frame Buffer: Must *not* be built into the kernel - it should be a module or not built (it is not compatible with the current fglrx drivers). ===Installing the Driver=== You will need to download the 'ATI Driver Installer' package (the RPM packages do not have support for X.Org 6.9). Once you have downloaded the installer, run it (I reccommend using sudo, as you need root permissions but also need access to the X server. You could use xhost+ and then su, but this is not safe). sudo sh ati-driver-installer-$VERSION-$ARCH.run You need to select the 'Install driver' (the ATI installer cannot generate a Slackware package), and then it is reccommended you choose "automatic" on the next screen. The driver will now install itself. Make sure that you mount tmpfs for 3D acceleration, or you can get unexpected results. ie: 'FGLTexMgr: open of shared memory object failed (Function not implemented) __FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!! fglX11AllocateManagedSurface: __FGLTexMgrCreateObject failed!!' Add the following to /etc/fstab: tmpfs /dev/shm tmpfs defaults 0 0 then 'mount /dev/shm' on a console ===Patching the Driver=== If you are running the latest kernel, more often than not you will need to patch the fglrx driver. At the very least, you will need to manually rebuild it if you change your kernel - follow instruction 1 if necessary, then 2 and 3. There is no central repository of these, so it is not possible to point you to a specific place to check for them (although the [http://ati.cchtml.com Unofficial ATI Bugzilla] or [http://www.rage3d.com/board/forumdisplay.php?f=88 Rage3D Linux Drivers forum] are good places to check). Once you have downloaded the patches: 1. Apply them in /lib/modules/fglrx (or /lib/modules/fglrx/build_mod) cd /lib/modules/fglrx/build_mod cat somepatch.diff | patch -p1 2. Rebuild the fglrx module sh /lib/modules/fglrx/build_mod/make.sh N.B. Modules built are kernel specific - you can only build a module for the kernel you are currently running. 3. Install the module sh /lib/modules/fglrx/make_install.sh ===Configuring the X server=== If you have not installed the fglrx driver before, run: aticonfig --initial --input=/etc/X11/xorg.conf aticonfig --ovt=Xv This will add an fglrx 'Section "Device"' to /etc/X11/xorg.conf and enable video overlay (enables video playback) Edit /etc/X11/xorg.conf (you need to do this with root permissions) Find: 1) A 'Section "Device"' that contains fglrx 2) 'Section "Screen"' Then: 1) Under the Section "Device" that contains fglrx<br /> 1A). Make a note of the value of "Indentifier"<br /> 2) Under Section "Screen", replace the value of "Device" with the value you just noted from fglrx At the end of /etc/X11/xorg.conf, add this section (This allows all users to access the direct rendering mode - without it, you can't use acceleration as a user): Section "DRI" Mode 0666 EndSection Restart the X server ===Final Check=== To check that fglrx has been installed and setup correctly, run 'fglrxinfo' in a terminal under X. It should return something like: display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: MOBILITY RADEON X700 Generic OpenGL version string: 2.0.5642 (8.22.5) (The 'renderer' string will vary depending on the chip your card actually has). ===Uninstalling the driver=== With root permissions, run: sh /usr/share/fglrx/fglrx-uninstall.sh 90c3b73913e0ef4ca26f28edd33eec0b61daa08d Acer Aspire 502x(WLMi) 0 37 58 2009-06-02T02:59:26Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an Acer Aspire 5020 series== This article is based on an Aspire 5021WLMi. The 5021WLMi is an an AMD Turion 64 based laptop - it mainly differs from other laptops of the 5020 series only in the specific processor model and some other models come with built in bluetooth - the 5021 has an ML-28 and no bluetooth, I believe the 5024 uses an ML-34 and does have built in bluetooth, so most of this should apply to the 502x series as well. (This is a work in progress, and therefore far from finished). I have installed my own bluetooth module into the 5021 - this is not very difficult to do (just rather fiddly), but the instructions for operating the bluetooth apply to any 5020 series laptop with bluetooth installed. Also, this was done using Slamd64 - where anything differs from a normal Slackware install, it will be prefixed with 'Slamd64'. ==Hardware== Output of lspci:<pre> 00:00.0 Host bridge: ATI Technologies Inc RS480 Host Bridge (rev 01) 00:02.0 PCI bridge: ATI Technologies Inc RS480 PCI-X Root Port 00:07.0 PCI bridge: ATI Technologies Inc RS480 PCI Bridge 00:13.0 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller 00:13.1 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller 00:13.2 USB Controller: ATI Technologies Inc IXP SB400 USB2 Host Controller 00:14.0 SMBus: ATI Technologies Inc IXP SB400 SMBus Controller (rev 11) 00:14.1 IDE interface: ATI Technologies Inc Standard Dual Channel PCI IDE Controller ATI 00:14.3 ISA bridge: ATI Technologies Inc IXP SB400 PCI-ISA Bridge 00:14.4 PCI bridge: ATI Technologies Inc IXP SB400 PCI-PCI Bridge 00:14.5 Multimedia audio controller: ATI Technologies Inc IXP SB400 AC'97 Audio Controller (rev 02) 00:14.6 Modem: ATI Technologies Inc ATI SB400 - AC'97 Modem Controller (rev 02) 00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration 00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map 00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller 00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control 01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility X700 (PCIE) 06:05.0 Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02) 06:06.0 CardBus bridge: Texas Instruments PCIxx21/x515 Cardbus Controller 06:06.2 FireWire (IEEE 1394): Texas Instruments OHCI Compliant IEEE 1394 Host Controller 06:06.3 Mass storage controller: Texas Instruments PCIxx21 Integrated FlashMedia Controller 06:06.4 Class 0805: Texas Instruments PCI6411/6421/6611/6621/7411/7421/7611/7621 Secure Digital Controller 06:07.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10) </pre> ===Overview=== * AMD Turion 64 ML-28 at 1.6 GHz with 128 KB L1 cache and 512 KB L2 cache * 512 MB of DDR333 memory * 15.4" Samsung LTN154X3-L01 WXGA LCD panel (1280 x 800) * ATi Mobility Radeon X700 (128MB dedicated memory) * 80GB (4200 RPM) (P)ATA Hard Drive ([http://www.seagate.com/cda/products/discsales/marketing/detail/0,1081,638,00.html Seagate Momentus 4200.2 - ST9808210A]) * Slot DVD Writer (DVD-R/RW, DVD+R/RW, DVD+R Dual Layer) * Texas Instruments (TI7421) 6-in-1 card reader * Gigabit Ethernet (Realtek RTL-8169 chipset?) * 802.11 b/g Wireless LAN (Broadcom AirForce One 54g (BCM4318)) * ATi SB400 AC'97 Soundcard + Modem * 1 x IR port * 1 x IEEE-1394 (Firewire) port * 4 x USB ports * 1 x S-Video port * 1 x VGA port * 1 x PCMCIA slot ===Working=== * Video Card: ATI Mobility X700 (1280x800 - fglrx and radeon & r300) * Broadcom Wireless LAN Card (acer_acpi + ndiswrapper with bcmwl564.sys driver, available as 80211g.zip from Acer driver download area. Slamd64 - need Windows XP 64 driver). * Soundcard (snd-atiixp as of alsa-driver-1.0.9b or kernel) * Function/Hot Keys (have not tried all though; extra configuration required for 'multimedia' keys) * Touchpad (Doesn't need a driver for basic functions) * USB * CD/RW, DVD+/-RW * Ethernet card (works with Realtek 8169 driver) * Battery Status * PCMCIA * 6-in-1 card reader (SD/ MMC & MemoryStick/ Pro only at the moment - [http://tifmxx.berlios.de/ driver in progress]) * Bluetooth ===Not Tested, but probably works=== * Firewire * Infra Red * VGA out ==Kernel Configuration== You will need to use a 2.6.19 or newer kernel to get this laptop to work properly in Linux without any extra kernel patching (see Troubleshooting for more information). I would *strongly* recommend you always use the latest stable 2.6.x kernel with this laptop, since there are a lot of fixes going in that relate to this laptop (ATI chipset, apic, yenta socket, wireless drivers (b43), etc). This should be very similar to any other AMD64 laptop with an ATi chipset (like the Acer Ferrari 4000 series- enable anything with 'ATI IXP', plus the relevant ACPI options. I'll put up more here about any necessary specific options later. However, I have *disabled* the framebuffer, as it doesn't play well with the X video drivers. When building a new kernel make sure that you use the following options, if you want to use the ATI/fglrx driver:<br> use '/dev/agpgart' as module<br> turn off, the 'Direct Render Manager'<br> (so you dont select 'radeon'..)<br> ==Hardware Package and Software Dependencies== ===Graphics=== Follow the instructions here [http://slackwiki.org/ATI_Graphics on the SlackWiki ATI Graphics Chip] to install and set up your video driver, using either radeon & r300 or fglrx (both work fine on this laptop). It is also recommended that you enable the powersaving features of the driver of your choice, to reduce power consumption (particularly important when running from battery). Note: These options do not work when you use dual-head (CRT+LCD) ====fglrx==== Use the latest versions, as these have support for ATi's "PowerPlay", allowing you to switch to low power modes (these modes trade off speed for reduced power consumption). The Mobility X700 has three; state 1 is the most energy efficient, state 3 the least efficient but best performing. You can list the available and currently selected powerstate modes with (while running X): aticonfig --list-powerstates and change the powestate with (again, while running X): aticonfig --set-powerstate=2 --effective=now Generally, state 2 should be adequate for most of your needs (a lower state also helps keep the heat down on the laptop), state 1 for running off battery. Be aware that you cannot set the powerstate dynamically with fglrx - ATI recommend you change it instead using ACPI events and shell scripts (Working examples required). ====radeon==== Edit /etc/X11/xorg.conf, add this to your radeon device section and restart X: Option "DynamicClocks" "on" Unfortunately, DynamicClocks is not as good at saving power as fglrx, and you have no control over the power states. ===Mouse=== To get advanced features, you will need to install the [http://web.telia.com/~u89404340/touchpad/ Synaptics Mousepad driver for X] and change your mouse driver in xorg.conf to use 'synaptics'. (I use the Synaptics driver mostly to disable 'Tap-to-Click') To ensure the touchpad always has the same device name, create /etc/udev/rules.d/local.rules (if it doesn't exist) and add the following: BUS=="serio", SYSFS{description}=="i8042 Aux-3 Port", KERNEL=="mouse*", NAME="input/%k",SYMLINK+="input/touchpad" You can now point xorg.conf towards /dev/input/touchpad for the touchpad (/dev/input/touchpad will always be a symlink to whichever device the touchpad is - this can vary depending on whether you plug another mouse into the system before or after booting). ===xorg.conf=== TBA ===Modem=== This is a Conexant HSF modem - it is incompatible with slmodemd (you therefore do _not_ need snd-atiixp-modem). The only drivers available for this modem are from [http://www.linuxant.com Linuxant] (the free-of-charge drivers are limited to 14.4K, you will need to pay if you want full 56.6K speeds and fax). ===Wireless=== To use the built in wireless, you need to firstly switch on the wireless, then load the b43 driver. You will also need to obtain the firmware for this card - see [http://linuxwireless.org/en/users/Drivers/b43#devicefirmware Linux Wireless] on where to get it from. 1. Enable Wireless '''2.6.24:''' * Download, build and install [http://code.google.com/p/aceracpi acer_acpi] * Load acer_acpi: modprobe acer_acpi wireless=1 '''2.6.25 or newer:''' * echo 1 > /sys/devices/platform/acer-wmi/wireless * Or create /etc/modprobe.d/acer-wmi and add "options acer-wmi wireless=1" to do this at boot time 2. Install b43 firmware * Download, build and install b43-fwcutter - use the [http://www.slackbuilds.org SlackBuilds.org] Slackbuild for thos * Follow the instructions on [http://linuxwireless.org/en/users/Drivers/b43#devicefirmware Linux Wireless] for your kernel version to extract the firmware and install it to /lib/firmware (The orange light for the wireless at the front should turn on now) 3. Configure the wireless in /etc/rc.d/rc.inet1.conf Note: I deleted rc.wireless.conf as it is unecessary and keeps trying to override rc.inet1.conf (besides, configuring wireless in rc.inet1.conf is the future). ===Bluetooth=== The bluetooth is an internal USB dongle. To turn it on: '''2.6.24:''' * Download, build and install [http://code.google.com/p/aceracpi acer_acpi] * Load acer_acpi: modprobe acer_acpi bluetooth=1 '''2.6.25 or newer:''' * echo 1 > /sys/devices/platform/acer-wmi/bluetooth * Or create /etc/modprobe.d/acer-wmi and add "options acer-wmi bluetooth=1" to do this at boot time The bluetooth device can now be seen with lsusb (it is not visible when bluetooth if you don't enable it through acer_acpi/ acer-wmi). ===Special Keys=== There is a keymap for the special keys available [http://www.fwconsult.com/acer-install/index.html here]. However, I have had problems with it on my UK layout keyboard so would not recommend using it at the moment. ===Special Keys with X=== ====HAL==== You will need, at a minimum, HAL 0.5.10 and hal-info 20070725. The Aspire 5020 has been submitted to HAL as part of their keyboard quirk project, so the extra keys which generated dmesg messages, will now generate proper keycodes. ====X==== There is now a generic acer_laptop keyboard layout in upstream xkeyboard-config (which works in tandem with HAL to map the extra keys). This will be in the next xkeyboard-config release after 1.0 (it is therefore unlikely to make the next X.Org release). You can also use the evdev layout instead. ===Hardware Monitoring=== Unfortunately, the extent of 'hardware monitoring' on this system comes through 3 thermal zones provided by ACPI. You can play around with using I2C to access the SMBus, but the hardware on the other end of it appears to be a National Semiconductors chip of sorts that is not supported under Linux (and based on comments on the lm_sensors mailing list, due to various problems, is not very likely to be either). ===Suspend=== Suspend does work on this laptop (assuming you don't have any funny PCMCIA, USB or Firewire devices attached that will break it). '''In a terminal''' You will need either vbetool or a 2.6.17-rc (or newer) kernel with s2ram (found in [http://suspend.sourceforge.net suspend]). Using s2ram: s2ram -f -p Using swusp (run this command after resuming): vbetool post '''In X''' Works with either radeon or fglrx (you don't need to run s2ram if you suspend from X). ===Card Reader=== This card reader is not fully supported in Linux yet. There is an in development driver, [http://tifmxx.berlios.de tifmxx], that currently supports MMC/ SD, and Memory Stick/ Pro. If you want to help out the project, hardware donations are welcome for unsupported hardware (be aware that the developer's card reader can not physically support SmartMedia cards). ==Troubleshooting== ===HPET=== Not available on this laptop - locks hard with hpet=force (I suspect HPET's are only available on the newer SB480 chipsets). ===DVDs will not play back=== You need to set the DVD region before you can play any DVDs. The 'regionset' tool for Linux will let you do this (otherwise you will have lots of strange error messages in dmesg). ===Suspend/ Resume does not work=== Please be aware that kernel updates can break this. If that's the case, I will try and update this page to reflect that. Otherwise, go back and make sure you have applied the necessary patch specified earlier in "Suspend" to your kernel. Also, try unplugging any devices attached to the laptop, rebooting (some drivers can be a bit funny otherwise) and then try suspend/ resume. If it now works, then one of your devices or a driver somewhere is breaking suspend - in which case, you should report the bug to the relevant person/ place. ==Contributors== *[http://slackwiki.org/User:Cathectic Carlos Corbacho (aka cathectic)] *[http://slackwiki.org/User:Funmain Funmain] ==External Links/ References== * [http://forums.slamd64.com/viewtopic.php?t=27 fglrx on Slamd64] * [http://www.fwconsult.com/acer-install/index.html Installing Gentoo (2005.0) on an Acer 5021NWLCi] * [http://gentoo-wiki.com/HARDWARE_Gentoo_Acer_Ferrari_4005WLMi_Manual Gentoo Acer Ferrari 4005WLMi Manual] * [http://website.lineone.net/~bryanrpoole/atiixp-modem.html ATI-IXP MC97 Modem Development / Configuration Information] * [http://bugzilla.kernel.org/show_bug.cgi?id=3927 Kernel Bugzilla entry for AMD64/ ATi timer running fast problem] * [http://doube.net/3023wlmi.html Linux and Windows on an Acer Aspire 3023WLMi] c8242f398c29fa85440c90f09aa6c83436c5c0b0 Administration (General) 0 38 59 2009-06-02T03:00:21Z Erik 1 Copy from old wikitext text/x-wiki == Hostname == You can change a Slackware box's <code>hostname</code> by two methods: 1) Edit <code>/etc/HOSTNAME</code> 2) Use the hostname command- :On any running Linux system you can change its hostname with the command ‘hostname‘. ::'''<code>#hostname</code>''' without any parameter it will output the current hostname of the system. ::'''<code>hostname –fqd</code>''' will output the fully qualified domain name (or FQDN) of the system. ::'''<code>hostname NEW_NAME</code>''' will set the hostname of the system to NEW_NAME. This is active right away and will remain like that until the system will be rebooted (because at system boot it will set this from some particular file configurations - see bellow how to set this permanently). You will most probably need to exit the current shell in order to see the change in your shell prompt. [[Category:Tutorials]] dad382dc6f1776b651312404979a0d67f0bd1425 Anti-Torrent Activity Block 0 39 60 2009-06-02T03:01:01Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] Many ISP's have recently begun to actively seek out and stop torrents from seeding, legal or otherwise. The most notorious offender is Comcast, who blocks torrents by sending a Terminate signal to one of the clients; these packets tell the Bit Torrent client to close the connection. In the interest of being able to share legal media, such as linux iso's, you may add the following to your IP tables to have these malicious packets dropped: <pre>iptables -A INPUT -p tcp --dport <YOUR TORRENT PORT> --tcp-flags RST RST -j DROP</pre> Credit goes to user "James" in the comments section of a Reg newspost, which you can find here: http://www.theregister.com/2007/10/20/comcast_denies_bittorrent_busting_again/comments/ 2224bb3cb6353681f4a25dcd282256c53e545057 Apache-cgi 0 40 61 2009-06-02T03:02:50Z Erik 1 Copy from old, had no category, placed in Tips wikitext text/x-wiki [[Category:Tips]] ==To enable a cgi directory for each user== In order to give each user their own cgi-bin directory, edit the: :Apache1 (Slackware pre-12.0): <code>/etc/httpd/httpd.conf</code> file<br> :Apache2 (Slackware 12.0+): <code>/etc/httpd/extra/httpd-users.conf</code> file<br> ::...and add: :<code><Directory /home/*/public_html/cgi-bin/></code> :<code>Options ExecCGI</code> :<code>SetHandler cgi-script</code> :<code></Directory></code> Then, presuming that UserDir is set to public_html, a cgi program example.cgi could be loaded from that directory as: ::<code>http&#58;//example.com/~rbowen/cgi-bin/example.cgi</code> ==To enable a cgi directory for each virtual host== In the Virtual Host section of your apache config file (<code>/etc/apache/httpd.conf</code>) add the <code>ScriptAlias</code> line below. :<code><VirtualHost *:80></code> :::<code>ServerName www.''MyDomain''.org</code> :::<code>DocumentRoot /home/''MyDomain''/public_html</code> :::<code>ErrorLog /var/log/''MyDomain''/error.log</code> :::<code><b>ScriptAlias /cgi-bin/ "/home/''MyDomain''/public_html/cgi-bin/"</b></code> :<code></VirtualHost></code> f9fd21516915f636a94ec865ddb7fdfd624926f5 Bash Autocompletion 0 41 62 2009-06-02T03:03:48Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] Did you know that Bash has a really powerful autocompletion system, which can and usually will make your life easier? If you have used ZSH, you probably know what I'm talking about. For example, you can type svn co''<TAB><TAB>'' and bash will attempt to auto complete as it does normally with paths and variables, but instead it will output: ismael@damned_02:~/src/chkout$ svn co''<TAB><TAB>'' co commit copy ismael@damned_02:~/src/chkout$ svn co Then you can type: ismael@damned_02:~/src/chkout$ svn com''<TAB>'' and BASH will auto complete to: ismael@damned_02:~/src/chkout$ svn commit Or if you're running as root and want to get rid of that *$@& module wich keeps crashing your machine: root@damned_02:~# rmmod n''<TAB>'' root@damned_02:~# rmmod nvidia If you think all that is neat, all that you have to do to enable this kind of auto completion in Slackware is to install the bash-completion package, which can be found under [http://slackware.osuosl.org/slackware-11.0/extra/bash-completion/bash-completion-20060301-noarch-1.tgz /extra]: root@damned_02:~# mount /mnt/cdrom root@damned_02:~# installpkg /mnt/cdrom/extra/bash-completion/bash-completion-20060301-noarch-1.tgz ... (BTW, bash-completion also autocompletes ''installpkg, upgradepkg'' and ''removepkg'' with .tgz files and installed packages for ''removepkg''. It can also fill mount commands with data from fstab). Then you can just logout and login again or source /etc/bash_completion and ''voila''! You can see which commands have autocompletion by issuing: complete -p | sed -e's/.* \([^ ]\+\)/\1/' | sort | less You can also add your own commands at /etc/bash_completion.d/ You may want to see the available completions to understand how they work. For your own personal user account you can edit your ~/.bash_completion file. Here is a sample BASH completion function I made to give the script 'test' 3 completion options: <pre> _test () { local cur cur=${COMP_WORDS[COMP_CWORD]} if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-option -test -foobar' -- $cur )) else _filedir fi } complete -F _test test </pre> I put that into my ~/.bash_completion file and now $ test -<tab> -foobar -option -test brings up those three options (-option,-test and -foobar). You have to reload your terminal first to see the changes or re-source /etc/bash_completion $ . /etc/bash_completion or just re-source your ~/.bash_completion $ . ./.bash_completion adcb7eb632105ef5e55cac606464c718f3a83a79 Booting 0 42 63 2009-06-02T03:04:36Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] ==How To Boot Into Single User Mode== During your LILO startup where it pauses for 5 or 30 seconds, at the <code>boot:</code> prompt, if you type <code><i>image_name</i> 1</code>, the boot will continue but you will be in [[Single User Mode]]. :EXAMPLE: On my dual boot system, my Linux image is named "Linux" and my Windows image is named "windoz". To boot into single user mode, at the <code>boot:</code> prompt I would type: <code>boot: <b>linux 1</b></code> TIP: If you did not install your system with a pause, you should really run [[liloconfig]] and put at least a 5 second pause in. Sometimes it's useful. 764cbb264d3c9ae59342df38de141e9306b287d1 Captive NTFS 0 43 64 2009-06-02T03:06:00Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] [http://www.jankratochvil.net/project/captive/ Captive NTFS] project implements the first full read/write free access to NTFS disk drives. You can mount your Microsoft Windows NT, 200x or XP partition as a transparently accessible volume for your GNU/Linux. Tutorial written by Thomas York straterra@gmail.com '''Read through the whole thing several times before attempting!''' ===Step 1: Download these files=== You will need to download several files. A: http://www.jankratochvil.net/project/captive/dist/lufs-0.9.7captive8.tar.gz B: http://www.jankratochvil.net/project/captive/dist/gnome-vfs-httpcaptive-2.3.8captive2.tar.gz C: http://www.jankratochvil.net/project/captive/dist/captive-1.1.5.tar.gz D: http://linux-ntfs.sourceforge.net/snapshots/ntfsprogs-200510151016.tar.bz2 Note, if you cannot download the ntfsprogs file, browse http://linux-ntfs.sourceforge.net/snapshots/ and pick up the latest snapshot ===Step 2: Uncompress the archives.=== We will now uncompress the archives to get ready for compiling. If you do not know how to do this, You can use the commands below. 1: tar xzvf lufs-0.9.7captive8.tar.gz 2: tar xzvf gnome-vfs-httpcaptive-2.3.8captive2.tar.gz 3: tar xzvf captive-1.1.5.tar.gz 4: tar xjvf ntfsprogs-200503060058.tar.bz2 Step 3: Compiling ===A. NTFS Programs package=== We will now start by compiling the most necessary of packages first. You need to start with ntfsprogs. Use the example below. 1: cd ntfsprogs-200503060058 2: ./configure --prefix=/usr 3: make 4: su Now, here is where you have to make a decision. It is highly advised that you make a package over using 'make install.' If you wish to make a package, merely run : 1: checkinstall If you wish to use the 'make install' method, just run : 1: make install ===B. Gnome VFS package=== Next, we will compile Gnome VFS for the graphical installer. Run the command below : 1: exit 2: cd .. 3: cd gnome-vfs-httpcaptive-2.3.8captive2 4: ./configure --prefix=/usr 5: make 6: su Again, you must make a decision. It is HIGHLY recommended that you use checkinstall to create a package. If you want to create a package, run : 1: checkinstall If you wish to use the 'make install' method, merely run : 2: make install BUG FIX. If when you run make, you have an Error 1, try using this patch: http://bugs.gentoo.org/attachment.cgi?id=48015 ===C. LUFS Package=== BUG FIX. If you use a 2.6 kernel later than 2.6.9, then you need to follow the instructions located at http://www.jankratochvil.net/pipermail/captive-list/2004-December/000645.html before trying to compile LUFS. Thank you! Now, we make the tool that will provide interaction between the kernel and Captive! This is the most important package, so pay attention. Run the commands below : 1: exit 2: cd .. 3: cd lufs-0.9.7captive8 4: ./configure --prefix=/usr 5: make 6: su Again, you must decide on checkinstall or 'make install'. Either run : 1: checkinstall Or : 1: make install ===D. Captive NTFS Package=== This also is the most important package because without the Captive package, nothing will work! Now we need to setup the environment for captive..Run these commands! 1: groupadd captive 2: useradd -d /dev/null -g captive -s /dev/null captive 3: exit 4: cd .. 5: cd captive-1.1.5 6: ./configure --prefix=/usr --enable-install-pkg=yes 7: make 8: su Again, checkinstall or make install..you get the jist by now..Either : 1: checkinstall Or : 1: make install Now everything should be ready. Make sure you have your NTFS partition mounted already using the kernel's NTFS driver. If you do not know how to do this, try this command and play with it: 1: mount -t ntfs /dev/hda1 /mnt/windows Now, while you have X running, run these commands: 1: exit 2: xhost +localhost 3: su 4: captive-install-acquire When you run the captive-install-acquire command, you need to hit Forward, Hit Skip, Click Browse.. and point it to the mounted location of your NTFS partition (should already be mounted), hit Skip, Hit OK, and finally hit OK again. Then, continue with the command below. 1: captive-install-fstab --add Now, you should unmount the NTFS partition and remount it with captive-ntfs 1: umount /mnt/windows 2: mount -t captive-ntfs /dev/hda1 /mnt/windows By now, everything should be setup correctly and working. If you have ANY troubles, talk to me on irc.freenode.net ##slackware. 94a82aa83f23442ceb321dfaf81053f6d67647f9 Changes 10.2 11.0 0 44 65 2009-06-02T03:06:45Z Erik 1 Copy from old wikitext text/x-wiki = Purpose = The purpose of this file is to document the new packages (Package Additions) and removed packages (Package Removals) during the development cycle from Slackware 10.2 through Slackware 11.0, as well as to point out some potential "gotchas" that can users can avoid by arming themselves with a little knowledge. = Package Additions Since 10.2 = * a/pcmciautils * a/sharutils (split from bin) * a/acl (split from xfsprogs) * a/attr (split from xfsprogs) * a/sysfsutils * a/sysstat * ap/diffstat * ap/dmapi (split from xfsprogs) * ap/linuxdoc-tools * ap/lm_sensors * ap/xfsdump (split from xfsprogs) * d/git * d/mercurial * d/ruby * kde/amarok * kde/qca * kde/qca-tls * l/apr * l/apr-util * l/cairo * l/db42 (for backwards compatibility) * l/db44 (upgrade from db4; see 'Package Removals' and 'Other Concerns' for more information) * l/desktop-file-utils * l/freetype (split from x11) - see note in "Other Concerns" below * l/gd * l/gnome-icon-theme * l/hicolor-icon-theme * l/libgpod * l/libmtp * l/libmusicbrainz * l/libnjb * l/libtheora * l/libtunepimp * l/libvisual (library only, no plugins yet - but this should allow for compiling audio visualization plugins for amarok without a recompile of amarok itself) * l/mm (split from apache) * l/mpfr (split from gmp) * l/neon (split from subversion) * l/slang1 (renamed from slang) * l/slang (Added slang 2) * n/mailx (renamed from nail) * n/rdesktop * x/dejavu-ttf * x/fontconfig (split from x11) - see note in "Other Concerns" below * x/ttf-indic-fonts - see note in "Other Concerns" below * xap/seamonkey * xap/vim-gvim (renamed from xvim) - this package now depends on ap/vim * kernels/huge26.s/* - added a 2.6.17.13 kernel to the official (supported) package set. The user will be given a choice of whether to install the 2.4.33.3 or 2.6.17.13 kernel. If a 2.6 kernel is used, additional packages must be added after the installation -- at the very least the kernel-modules package. Possibly also the kernel-headers to provide /usr/include/sound used to compile ALSA applications. * extra/linux-smp-2.6.17.13/* - added a 2.6.17.13 kernel, modules, and headers with SMP and hyperthreading support, optimized for i686 or better cores (including dual core CPUs). = Package Removals Since 10.2 = * ap/sgml-tools (replaced with linuxdoc-tools) * d/python-demo (merged with python package) * d/python-tools (merged with python package) * l/db3 (moved to /pasture) * l/db31 (moved to /pasture) * l/db4-* (moved to /pasture) * n/nail (renamed to mailx - see "Package Additions") * xap/abiword (became a pure Gnome app) * xap/mozilla (replaced with seamonkey) * xap/xvim (renamed to vim-gvim) - see note above in "Package Additions" = Other Concerns = First of all, if you did not *upgrade* (in other words, you have a fresh installation), most of this is not relevant to you; you won't need to merge any config files or anything along those lines. However, this is still worth reading, as it gives you an idea of things to look for in future upgrades. * Both the 2.4.x and 2.6.x kernels included are now compiled with high memory support * Many old bison and db packages were pasture-ized from d/ and extra/ and so on; after upgrading/installing Slackware 11.0, you should have *one* bison package and *two* db packages (the db packages are listed in the package additions above) * n/php now depends on l/freetype (l/freetype was split from x/x11) * n/apache now depends on l/mm (l/mm was split from apache) * xap/xine-lib now depends on l/libtheora if you want to play ogg-files in xine (and Amarok using the xine engine) * a/devs was upgraded during the -current development cycle. You CANNOT upgrade this package while udev is running - you'll need to chmod -x /etc/rc.d/rc.udev, reboot, upgrade the devs package, and then reboot again. Actually, you don't *have* to reboot again, but if you know that, then you likely know how to go about it that way :) If you don't know the trick, here's how to do it (no secrets here): sh /etc/rc.d/rc.udev stop umount /dev/pts umount /dev/shm umount -l /dev installpkg devs*.tgz sh /etc/rc.d/rc.udev start mount -av Thanks to Richard Hoyle for this information on doing it without a reboot. * So long as we're on the subject of a/devs, be aware that this package is still *required* in order to boot, even if you're using a 2.6 kernel and udev, so don't remove it. * a/lilo and a/kernel-* were upgraded during the -current development cycle, so be sure to run /sbin/lilo prior to rebooting. * glibc was upgraded during the -current development cycle, so be sure to follow the instructions in [http://slackware.osuosl.org/slackware-11.0/UPGRADE.TXT UPGRADE.TXT] when upgrading (do the upgrade in runlevel 1). * There was a major upgrade to a/udev and a/sysvinit - make *sure* you merge the *.new scripts in /etc/rc.d prior to rebooting or you *will* have problems. * If you're having trouble with udev, make sure you've syncronized all of the .new config files and init scripts first. According to Pat Volkerding (the Slackware maintainer), most of these issues can "be fixed with a little bit of fine tuning, such as blacklisting unwanted modules in /etc/modprobe.d/blacklist and loading the desired replacements in /etc/rc.d/rc.modules," but simply blacklisting them will often result in udev loading the correct modules. Also, keep in mind that newer versions of udev (084+) require at least a 2.6.15.x kernel. Experiment with it before resorting to this, but if you simply must have one of them, there are alternate versions of udev in /extra. * If you're running a 2.6 kernel and new udev (084+) on a router, you'll probably need to uncomment (and possibly edit to suit) the rules in /etc/udev/rules.d/network-devices.rules to make your interfaces always get the same names assigned. Hotplugging events are generated (and processed) in random order by udev, so there's no guarantee that your current eth0 will *always* be eth0 unless you uncomment (and possibly edit) those rules. * If you need custom udev rules, DO NOT edit the default udev.rules file - any changes you make will be clobbered with the next udev upgrade. The correct way is to add a custom file to the /etc/udev/rules.d/ directory - most people use '10-local.rules' - and add your custom rules there. If there is some reason that one of the default rules needs changed, mail PiterPunk and/or Pat with an explanation. * The psmouse module is blacklisted by default in the /etc/modprobe.d/blacklist file due to problems with the default kernel options used when it loads; this allows you to load it (from rc.modules, for example) with option "proto=imps" if you need it, or you are certainly free to comment it out in the blacklist file if it works fine for you with the kernel defaults. * As indicated in the Package Additions section, freetype and fontconfig were split out of the main X11 packages. You need to upgrade the main x11 package first, then install fontconfig and freetype, then upgrade the remainder of the x11 packs; otherwise, they give an error during postinstall about not being able to load fontconfig libs. * xap/seamonkey was chosen to provide the Mozilla development environment (primarily because the official binaries are used for the Firefox package, and these do not contain the development headers). At this time, only GAIM links with SeaMonkey's libraries, but if you are planning to compile something needing "Mozilla" libraries and headers, be sure SeaMonkey is installed. * There have been quite a few reports that fonts are 'ugly' after upgrading; one way to fix it is to remove /etc/fonts/local.conf if it exists. If it doesn't exist, or that doesn't work, go into KControl's font settings, uncheck the box for antialiasing, and apply the changes. Then, recheck the box and apply the changes. This should create a $HOME/.fonts.conf file. Thanks to Pat for the initial suggestion with KControl, and thanks to ananke for working out exactly what changes are necessary to fix it. * Slackware's vim package now includes a $VIM/vimrc file (in this case, /usr/share/vim/vimrc) for vim's default configuration. This default should provide a suitable start for most and your ~/.vimrc will override it if not, but if you had previously not explicitly set, e.g., 'backup', because vim's compiled-in default resulted in no backups and that suited you, the $VIM/vimrc includes 'set backup' and you will suddenly be keeping backups. These settings can be overridden individually (in this case with 'set nobackup') but one of several ways to avoid having $VIM/vimrc affecting your configuration at all is to put this at the top of your ~/.vimrc, overriding everything in $VIM/vimrc: set all& " reset all options to compiled in defaults (thanks to deryni in #vim) unmap Q " remove mapping to gq syntax off " turn syntax off filetype plugin indent off " turn filetype detection off augroup! vimrcEx " delete the autocommand group that wraps text, etc. * If you have an ati radeon card and are experiencing problems with it locking up, there is a patched set of ati modules at /extra/x11-radeon-patched/ - if you are not experiencing problems, then don't install this, as it does tend to cause problems if you weren't already having them... * The ttf-indic-fonts package supports Bengali, Devanagari, Gujarati, Kannada, Malayalam, Oriya, Punjabi, Tamil, and Telugu. For information about fully enabling Indic support (including input), see: /usr/doc/Linux-HOWTOs/Indic-Fonts-HOWTO. * As part of the upgrade to nfs-utils and portmap, the /etc/rc.d/rc.portmap script has been replaced by /etc/rc.d/rc.rpc. The rc.rpc script does not have to be executable unless you plan on mounting nfs shares <b>manually</b>, as it will be run by other init scripts if any nfs shares or mounts are detected. * php5 and lvm2 are available in /extra if you would like to use them * cairo-1.2.4, flex-2.5.33, fontconfig-2.4.1, gutenprint-5.0.0, hplip-1.6.9, iptables-1.3.6, and wpa_supplicant-0.4.9 are available in /testing if you need/want them [http://www.slackforum.de/wiki/Aenderungen102110 german version] 13e19ada68315b7579510342fd63c10e6eb83701 Changes 9.1 10.0 0 45 66 2009-06-02T03:07:22Z Erik 1 Copy from old wikitext text/x-wiki = Purpose = The purpose of this page is to document the new packages (Package Additions) and removed packages (Package Removals) during the release cycle from Slackware 9.1 to 10.0, as well as any other relevant information for the upgrade. = Package Additions Since 9.1 = * a/udev-025-i486-1.tgz: Added udev-0.25 * ap/bpe-2.01.00-i486-1.tgz: (split from bin package) * ap/rzip-2.0-i486-1.tgz: Added rzip-2.0 (suggested by Daniel de Kok) * ap/mdadm-1.5.0-i486-1.tgz: Added mdadm-1.5.0 * ap/normalize-0.7.6-i486-1.tgz: Added normalize-0.7.6 * ap/sgml-tools-1.0.9-i486-11.tgz: Added docbook-utils-0.6.14 * ap/sgml-tools-1.0.9-i486-10.tgz: Added gtk-doc-1.2 * d/doxygen-1.3.4-i486-1.tgz: Added doxygen-1.3.4 (used by KDevelop) * gnome/gpdf-0.131-i486-1.tgz: Added gpdf-0.131 * gnome/epiphany-extensions-0.8.2-i486-1.tgz: Added epiphany-extensions-0.8.2 * gnome/gnome-keyring-0.2.1-i486-1.tgz: Added gnome-keyring-0.2.1 * gnome/gnome-netstatus-2.6.1-i486-1.tgz: Added gnome-netstatus-2.6.1 * gnome/gnome-themes-extras-0.7-i486-1.tgz: Added gnome-themes-extras-0.7 * gnome/gok-0.10.2-i486-1.tgz: Added gok-0.10.2 * gnome/hicolor-icon-theme-0.5-noarch-1.tgz: Added hicolor-icon-theme-0.5 * gnome/libcroco-0.5.1-i486-1.tgz: Added libcroco-0.5.1 * gnome/libxklavier-1.02-i486-1.tgz: Added libxklavier-1.02 * gnome/metacity-2.8.1-i486-1.tgz: Added metacity-2.8.1 * gnome/shared-mime-info-0.14-i486-1.tgz: Added shared-mime-info-0.14 * gnome/totem-0.99.11-i486-1.tgz: Added totem-0.99.11 * l/mhash-0.9.1-i486-1.tgz: Added mhash-0.9.1 * l/db4-4.2.52-i486-1.tgz: Added db-4.2.52 * l/db31-3.1.17-i486-1.tgz: Added for compatibility * l/libcaca-0.9-i486-1.tgz: Added libcaca-0.9 (Colour AsCii Art library) * l/netpbm-10.18.12-i486-1.tgz: Added netpbm-10.18.12 (this replaces libgr) * l/lcms-1.12-i486-1.tgz: Added lcms-1.12 * l/taglib-1.0-i486-1.tgz: Added taglib-1.0 * l/libwmf-0.2.8.2-i486-1.tgz: Added libwmf-0.2.8.2 * l/libwmf-docs-0.2.8.2-noarch-1.tgz: Added docs package for libwmf-0.2.8.2 * kde/kdeaccessibility-3.2.0-i486-1.tgz: Added kdeaccessibility-3.2.0 * kde/wv2-0.2.1-i486-1.tgz: Added wv2-0.2.1 (used by KWord to import various MS document formats) * n/dnsmasq-2.6-i486-1.tgz: Added dnsmasq-2.6 * n/irssi-0.8.9-i486-1.tgz: Added irssi-0.8.9 * n/iproute2-2.6.7_ss040608-i486-1.tgz (moved from /extra into mainline) * n/whois-4.6.16-i486-1.tgz: (split from tcpip package) * xap/gkrellm-2.2.0test1-i486-1.tgz: Added gkrellm-2.2.0-test1 = Package Removals Since 9.1 = * a/devfsd-1.3.25-i486-3.tgz: Obsolete, and retired to /pasture * ap/oggutils-1.0-i386-3.tgz: Removed. * gnome/acme-2.4.2-i486-1.tgz: Removed. * gnome/gal2-2.1.4-i486-1.tgz: Removed. * gnome/gnome-extra-themes-1.0.1-noarch-1.tgz: Removed (no need for theme bloat). * gnome/linc-1.0.3-i486-1.tgz: Removed. * l/db1-1.85-i386-1.tgz: Removed. (off to /pasture) * l/db2-2.4.14-i386-1.tgz: Removed. (off to /pasture) * freetype-1.3.1, gcl-2.4.4, libxml-1.8.17, and xview-3.2p1.4 - moved to pasture = Other Concerns = * a/utempter-1.1.1-i486-1.tgz: Moved from the L series * gnome/abiword-2.0.0-i486-1.tgz: Moved from XAP since version 2.0.0 now depends on several GNOME libraries * x/: Switched to X11R6.7.0 from X.Org. * extra/k3b/k3b-0.11.11-i486-1.tgz: k3b was added to /extra = DISCLAIMER = I wasn't running Slackware (I didn't even know what linux was at the time) during the 9.1 --> 10.0 jump, so this document was created by scanning the ChangeLog and double-checking with grep usage. If I've missed something important, I'm sorry, but that's the way it goes... :) --robw810 9330060c3505af2875123c3a5bb655be4d24722f Church of the SubGenius 0 46 67 2009-06-02T03:07:59Z Erik 1 Copy from old wikitext text/x-wiki There have been many stories, legends, and rumors involving the religious organization known as the Church of the SubGenius. The founder of the Church, J.R. "Bob" Dobbs, was assassinated in San Francisco in 1984; yet members of the Church claim that he has returned from the dead many times since then. As for the relationship between Slackware Linux and the Church of the SubGenius: Patrick "The Man" Volkerding is an ordained Church minister. The term "Slack" itself stems from the SubGenius phrase "[[Slack]]." This was the intent of Slackware: to achieve "Slack" through ease of use, reliability, durability, and the rejection of unnecessary, mainstream "flash and sizzle" utilities. The Church of the SubGenius has long endorsed and promoted Slackware. "Bob" and the Church have declared an apocalyptic prophecy that the end of the world will occur on the morning of July 5th, 1998. On this date (which has apparently not arrived yet, according to the Church), a fleet of alien flying saucers will arrive to destroy the "normal" civilization of Earth. Only the members of the Church of the SubGenius will be saved from the carnage, according to "Bob." Members of the Church gather in a festival campground in upstate New York at the beginning of July to celebrate the impending apocalypse, or "X-Day." Pat Volkerding himself is among the attendees each year, and he (along with other Church members) gladly greets all pilgrims and Church members who travel to New York to attend the festivities. === External Links === * http://www.subgenius.com -- Official home page of the Church of the SubGenius * http://www.modemac.com/x-day -- X-Day [[Category:Information]] ab38d4c296381944a114bdd4cf48d2e7b348a42d Compiz 0 47 68 2009-06-02T03:08:31Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] == Configuring X == == Compiz Setup == After you've configured X Properly, you can start setting up Compiz's configuration files. These configuration files are generated automatically by Compiz, given 2 conditions. 1. The existance of a .compiz directory in home <sub>mkdir ~/.compiz</sub> 2. Running Compiz, calling to read configuration files (although not present, yet) <sub>compiz --replace ini decoration & kde-window-decorator &</sub> This loads compiz up, creating default configuration files in "~/.compiz/options/", while enabling two plugins "ini" and "decoration". Ini to allow read/write of configuration files, and "decoration" to use window decorations (the title bar of programs). == Configuring Compiz == Once you've successfully loaded compiz and created config files in, you can now configure plugins. Open up ~/.compiz/options/general-allscreens.conf for editing. <sub>pico ~/.compiz/options/general-allscreens.conf</sub> Edit the first line to include Plugins you will want to use. Plugins are stored in /usr/lib/compiz/ as lib* files. My plugins line: <sub>active_plugins=ini,decoration,svg,png,wobbly,fade,minimize,cube,move,place,resize,rotate,scale,switcher,water,zoom,screenshot</sub> Save this file, now edit ~/.compiz/options/decoration-allscreens.conf and alter the line "command=" to look like this: <sub>command=kde-window-decorator</sub> Save and exit. Test your work, (and also create more config files) like this: <sub>killall -9 kde-window-decorator ; killall -9 compiz ; compiz --replace ini & </sub> You'll notice ~/.compiz/options/ is now populated with more configuration files. Filled with keybindings and behavior definitions. I'll leave figuring these out to you. Anytime you change and save a configuration file. Restart compiz to test. <sub>compiz --replace ini &</sub> Here are a few interesting config options. In general-screen0.conf <sub>hsize=4</sub> Change 4 to anything from 1 to 10 to change the number of sides of the "cube". In cube-screen0.conf image files are read from /usr/share/compiz/: <sub>images=picture</sub> This loads "picture.png" on the top of the cube, while : <sub>skydome_image=picture</sub> Loads "picture.png" as the background image behind the cube. 2161006c60837be7acb553c582964042efc3cf01 Console-Only Communication 0 48 69 2009-06-02T03:09:42Z Erik 1 Copy from old wikitext text/x-wiki HOWTO: access on-line resorces on the internet using only console-based tools. == Overview == Many times, particularly when things aren't working as expected, you may find yourself restricted to a console-only (non-X or non-graphical) session. If you have networking running, you can still access on-line support tools through your console. This tutorial shows you how to: * Use virtual consoles to increase the number of consoles you can use simultaneously; * Use the <tt>screen</tt> to create sessions that are persistant even after you close the console; * Use <tt>irssi</tt> to access the irc network and ##slackware on irc.freenode.org; * Use <tt>lynx</tt> and <tt>wget</tt> to access HTTP (web) server information; * Use <tt>lynx</tt> to pastebin a file when you need to send configuration information to an IRC channel, and; * Use <tt>wget</tt> to download a pastebin file to your local machine. == Prerequisites == This tutorial will assume you are comfortable with the following concepts: * Basic file management operations (<tt>cp</tt>,<tt>rm</tt>,etc); * Using a console-based file editor (<tt>pico</tt>,<tt>vi</tt>,etc); == Virtual Consoles == One of the handiest features if you're relegated to working from a console is the use of virtual consoles. This allows you to start multiple login sessions from the same console keyboard, mouse, and monitor. That way, you can have one virtual console logged into IRC so you can talk to ##slackware, one that you can use for web access, and another that you can use to test commands. Using virtual consoles is easy. Simply hold the ALT key while hitting the F2 key (ALT+F2) to switch to the second console. To switch back to the first console, use ALT+F1. You have virtual consoles available on F1 through F6. If you're using X, you can still access one of the virtual consoles, which is useful if X is hung up for some reason (especially if X won't restart using ctrl+alt+backspace). To access this virtual console, hold CTRL *and* ALT while pressing the F6 key (CTRL+ALT+F6). To switch back to your X session, press CTRL+ALT+F7. == Using <tt>screen</tt> == The <tt>screen</tt> utility allows you to start a console session which is persistent across login and logout. This is useful, for example, if you're using IRC -- perhaps you want to stay logged into your IRC channel even after you have logged out of your console session. The concept is straightforward: when you run screen, it gives you a bash prompt "inside of" the screen session. At this new bash prompt you can start your IRC session. When you wish to log out, you can detach from screen and log out -- but screen continues to run in the background. When you log back in, you can re-attach to your screen session and resume your IRC session. Visit [[Screen|this page]] for the specifics on attaching and detaching sessions using <tt>screen</tt>. == Using <tt>irssi</tt> == The <tt>irssi</tt> program is a console-based IRC client. Using irssi, you can access the ##slackware IRC channel on irc.freenode.net. *WARNING*: Whenever you are using any type of IRC client on any type of machine, make sure that you are not doing so as the superuser (root). Doing so is a security risk, since if for some reason an attacker is able to successfully attack your IRC client, the attacker will have root access to your machine. To access the ##slackware channel on irc.freenode.org using <tt>irssi</tt>, perform the following steps: * Start irssi: user@slackbox:~$ irssi * At the (status) prompt, connect to irc.freenode.org: [(status)] /connect irc.freenode.org * Once connected, set your nick: [(status)] /nick Myl33tNick * Join the ##slackware channel: [(status)] /join ##slackware * To exit irssi: [(status)] /quit Visit [[Irssi|this page]] for more information on using irssi. == Using <tt>lynx</tt> and <tt>wget</tt> == You can use <tt>lynx</tt> and <tt>wget</tt> to access http (web) servers from your console session. Lynx allows you to access a web site interactively, much like using a graphical browser such as Firefox, but through a text-only console session. <tt>Wget</tt> allows you to retrieve documents from web servers non-interactively, which is handy when you need to retrieve a certain document (say a tarball or a script file) from a web server in a very quick way. To start using lynx, from a bash prompt simply type: user@slackbox:~$ lynx "http://www.slackware.com" to visit Slackware's official website. To exit lynx, use CTRL+C. In the example above, the double-quotes are not strictly required. However, many URLs contain characters which have special meaning to the bash interpreter (such as the ampersand), and the double-quotes stop bash from trying to interpret those characters. Although wget has a wide array of options (visit man wget sometime), its basic use is very simple. For example, to download the latest kernel patch (as of this writing) from kernel.org, simply do: user@slackbox:~$ wget "http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.20.3.bz2" Again, the quotes here are not strictly required for this URL, but are required for certain URLs. It's good to get in the habit of always double-quoting URLs from a bash prompt. == Using <tt>lynx</tt> in conjuction with pastebin == You may find yourself on ##slackware and another channel member may ask you to "pastebin" information to them. The purpose of pastebin is so that you can share technical information (for example, the contents of a configuration file) with the other channel members, without pasting that information directly into IRC itself (which is generally disliked by other IRC members and will get you banned if you try it). "Pastebin" is a generic term for a web site which offers this sort of service. There are many pastebin sites out there; for simplicity's sake, this tutorial uses [http://pastebin.ca pastebin.ca]. You can use lynx to access the pastebin site, but what if you need to pastebin the contents of an entire file? You can do this using the <tt>lynx</tt> program: * use <tt>lynx</tt> to access pastebin.ca: user@slackbox:~$ lynx "http://pastebin.ca" * Page down until you see the large textbox area, move your cursor to the first line (where you see the X below): Create a New Pastebin Post Welcome to the Pastebin. For information on what this is, take a look at the What is This? page. You may also want to see the most recent post to the pastebin. Please enter your new post below (or upload a file instead): paste below X_____________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ (NORMAL LINK) Use right-arrow or <return> to activate. Arrow keys: Up and Down to move. Right to follow a link; Left to go back. H)elp O)ptions P)rint G)o M)ain screen Q)uit /=search [delete]=history list * Press Ctrl+X, then i, and enter the location of the file you wish to pastebin. Enter a filename: /etc/ssh/sshd_config * Page down until you see the "Submit Post" link, select it (it will turn yellow), and press the enter key. * On the next page, scroll down until you find the URL to your pastebin file. It will look something like this: paste added to database Your paste has been accepted an added to the database. You will be redirected to it momentarily. The URL for it is: http://pastebin.ca/398871 You may use that URL for referencing your submission from now on. * Give this URL to the person who requested the information on IRC. == Using <tt>wget</tt> in conjunction with pastebin == Every pastebin site should have a way to request any pastebin file in "raw" format, meaning without the added HTML code so that the pastebin information displays properly in a browser. Accessing the "raw" format means you can access exactly what was pastebinned, with nothing else added. This is useful if you want to download a configuration file from pastebin. If you know the raw URL of the pastebin page you need, you can use wget to retrieve the file. * Find the raw URL associated with the pastebin page. For pastebin.ca, this is just the regular URL with an extra "raw" directory inserted. For example, if your regular pastebin url is http://pastebin.ca/398871, then the raw version is at http://pastebin.ca/raw/398871. * use wget to retrieve the file, but rename it so that it's not named 398871 (in this example, the output is named "this.cfg"): user@slackbox:~$ wget "http://pastebin.ca/raw/398871" -O this.cfg You'll find you'll use commands like wget over and over again this way, even when you have access to a fully graphical web browser. [[Category:Tutorials]] efcf19613488e16a82ad6d20051d7720972495f4 Creating a Current ISO 0 49 70 2009-06-02T03:10:22Z Erik 1 Copy from old wikitext text/x-wiki The following was taken from: http://www.backslider.net/wordpress/?page_id=3 == Creating a Slackware-current iso: how-to == === Step numero uno: === Download slackware-current, grab it from ftp.nluug.nl. To save time and space, don’t bother downloading bootdisks/, extra/, pasture/, source/, testing/, zipslack/ and then within slackware, leave out gnome/, kde/ and kdei/. This will keep our image below 700MB. If you plan on installing KDE, go ahead and grab it now. === Step numero dos: === Run the following command to create the iso. You will need mkisofs installed via the cdrtools package. <code>mkisofs -o /somedir/slackware-current.iso -R -V “Slackware Install” -v -d -D -N -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux.bin -c isolinux.boot -A “Slackware Install CD”</code> If you did download kde/ or one of those other directories, you’ll need to exclude it from the mkisofs command like so, -x kde/. === Step numero tres: === Assuming I haven’t given bad advice, you now have a slackware-current iso that you can burn to cd now. You should be able to boot and then install off of it. I may check into how to create that second cd that would contain the gnome and kde packages, so check back at this page at a later time. == Update 5/14/2005 == You can download unofficial current isos here: ftp://ftp.slackware.no/pub/linux/ISO-images/slackware/Current-ISO-build/ This should save you some time for those of you who don’t need to customize your own iso. Please note that slackware.no only makes -current isos once a week every Tuesday at 0400 UTC [[Category:Tutorials]] 5318de152f4de8e57b8d58f5e8e0e783dd4b902f Antivirus 0 52 73 2009-06-02T03:16:09Z Erik 1 Copy from old wikitext text/x-wiki = Antivirus = Why would you want antivirus software on a Linux box, when there are so few Linux viruses out there? Maybe you don't want to spread them to Windows boxes, or maybe you're worried about getting windows viruses via Windows emulation software, or maybe you want a little extra insurance. The next question is which one? Depends on what you're looking for. A good thread on this is [http://www.linuxquestions.org/questions/slackware-14/antivirus-636562/?highlight=antivirus]. I'll talk about installing 2 antivirus programs, Clam and Antivir. '''Clam''': I haven't used it, but it has a command line scanner and a manual updater. Go to [http://www.slackbuilds.org] and search for clamav. Follow the instructions. '''Antivir''': The good: updates virus definitions automatically, and scans files in realtime on open/close (can also scan on execute). You can run scans manually from the command line, and there's a GUI if you want to use it. The bad: complicated setup, I don't think the free version scans samba shares, has spyware protection, and it won't automatically scan archive files until you extract them. The rest of this tutorial helps you setup Antivir for Slackware 12.1 and Slackware 12.0. This is a compilation of information from dazuko.org, the Antivir user manual, and my own personal experience. ==You need:== #latest dazuko kernel module from [http://www.dazuko.org/indexold.shtml] #antivir from [http://www.avira.com] #some time to kill ==Slackware 12.1== ===Dazuko=== *Extract dazuko somewhere: <code>tar xzvf dazuko-2.3.4.tar.gz</code>. There are 2 ways to install the kernel module, either via LSM or syscall hooks. The recommended way is via LSM, but I wasn't able to configure the Slackware 2.6.24.5 kernel to compile capabilities as a module (make menuconfig->Security Options->Default Linux Capabilities). I was able to do this with the old kernel in Slackware 12.0, but not the new one. View the FAQ at dazuko.org for more info. Also view <dazuko_dir>/README.linux26 for info on using syscall hooks. *Recompile the kernel (Tested). You only need to do this if you're using an SMP (multi-processor capable) kernel. I won't go into detail on how to recompile the kernel, as that's covered here [http://slackwiki.org/Kernel_Compilation]. Anyway, before you make the kernel, <code>cd /usr/src/linux</code>, and patch the kernel like this: **<code>patch fs/dcache.c <dazuko_dir>/patch_dpath.diff</code> **Finish recompiling the kernel, make sure everything boots up OK. **<code>cd <dazuko_dir></code> **<code>./configure --enable-syscalls --mapfile=/boot/System.map --disable-local-dpath</code> *if you don't need to recompile the kernel (non-SMP), do this: **<code>./configure --enable-syscalls --mapfile=/boot/System.map</code> *Don't recompile the kernel, and pass in different flags to <code>./configure</code> (Untested). I'm not totally sure if you lose any functionality by doing this, but up to you. **<code>cd <dazuko_dir></code> **<code>./configure --enable-syscalls --mapfile=/boot/System.map --disable-chroot-support</code> *<code>make</code> *<code>cd example_c</code> *<code>make</code> *<code>example /tmp</code> *in another terminal, create a test file in your /tmp directory. if you see output from example, dazuko is working correctly. *<code>cd ..</code> *<code>make test</code> *<code>make install</code> ===Antivir=== *Extract antivir somewhere. There is documentation under <code><antivir_dir>/doc/avserver_en.pdf</code>, along with some readmes. *Install with <code>./install</code>. Make sure that you specify to let antivir load the dazuko module (easier). The path to it is <code>/lib/modules/`uname -r`/extra/dazuko.ko</code>. You probably want the default options, including the 2 hr updates. *add users to the antivir group. <code>vim /etc/group</code>, and add usernames to the antivir group. *my personal preference is to move infected files to /home/quarantine. here's how you set it up: **<code>mkdir /home/quarantine</code> **<code>chown nobody:antivir /home/quarantine</code> **<code>chmod 775 /home/quarantine</code> *under <code>/etc/avguard.conf</code>, add/edit these lines: **<code>MoveConcerningFilesTo /home/quarantine</code> **<code>IncludePath /opt/downloads</code> (where I put all my downloads, /home already scanned by default) *restart avguard with <code>/usr/sbin/avguard restart</code> *test that it works by going to [http://www.eicar.org]. There's a link for downloading sample viruses. If everything works, the file should be moved immediately to <code>/home/quarantine</code>. For archive files (.zip, .tar, etc.), you will have to extract them before antivir will catch them. Lame free restriction. *files to remember: **<code>/etc/avguard.conf</code> **<code>/etc/avupdater.conf</code> **<code>/var/log/avguard.log</code> **<code>/var/log/avupdater.log</code> **<code>/usr/bin/antivir</code> **<code>/usr/bin/antivir-gui</code> **<code>/usr/sbin/avguard</code> **<code>/usr/sbin/avupdater</code> *commands to remember **to do a manual update ***<code>antivir --update</code> **to scan a directory manually, and all subdirectories, extracting archive files ***<code>antivir --allfiles -s -z --moveto=/home/quarantine <directory_to_scan></code> ==Slackware 12.0== ===Dazuko=== *Extract dazuko somewhere: tar xzvf dazuko-2.3.4.tar.gz. We can install this the recommended way, via LSM. You shouldn't need to recompile the kernel, as capabilities should be a module. To check, do this: **<code>lsmod | grep capab</code> **If you see it there, you're in luck. Otherwise you need to recompile the kernel with this option: ***make menuconfig->Security Options-><M>Default Linux Capabilities. *<code>cd <dazuko_dir></code> *<code>./configure</code> *<code>make</code> (probably need to be root) *<code>rmmod capability</code> (unload this for a second so we can try out dazuko). *<code>make test</code> *<code>cd example_c</code> *<code>make</code> *<code>example /tmp</code> *in another terminal, create a test file in your /tmp directory. if you see output from example, dazuko is working correctly. *<code>cd ..</code> *<code>make install</code> *<code>modprobe capability</code> (reload into memory) *edit <code>/etc/rc.d/rc.modules</code>, and add this line before the capability module is loaded: **<code>/sbin/modprobe dazuko</code> *There is an issue when the capability module is loaded first. The steps above load the dazuko module first, which should fix the problem. ===Antivir=== *Same as above, except tell antivir that the kernel will load the module. This is so that you can load dazuko before capabilities in <code>/etc/rc.d/rc.modules</code>. [[Category:Tutorials]] d45861ea8ad02a74e185994e5ab99ab218ba03e4 Apache 2.0.x installation 0 53 74 2009-06-02T03:16:38Z Erik 1 Copy from old wikitext text/x-wiki = Notice = This article is obsolete; Slackware 12.0 includes Apache 2 by default (the httpd package). This information is kept here for users of older versions of Slackware. = Introduction = Sometimes one needs Apache 2.0.x in Slackware, which comes with Apache 1.3.x by default. Apache 2.0.x is necessary for example for Subversion repository setup or for recent mod_python modules. '''Prerequisites:''' *checkinstall (from <tt>extra</tt>) *mm from http://www.ossp.org/pkg/lib/mm/ So, first go to http://httpd.apache.org/download.cgi and grab the latest <tt>httpd-2.0.x.tar.bz2</tt> file and unpack it: tar xfvj httpd-2.0.x.tar.bz2 Execute following script in directory just above your unpacked httpd-2.0. <pre> #!/bin/sh build_apache() { cd httpd-* cat >> config.layout <<EOF # Layout for Slackware Linux <Layout Slackware> prefix: /usr exec_prefix: \${prefix} bindir: \${prefix}/bin sbindir: \${prefix}/sbin libdir: \${prefix}/lib libexecdir: \${prefix}/lib/apache2 mandir: \${prefix}/man sysconfdir: /etc/apache2 datadir: /var/www iconsdir: \${datadir}/icons htdocsdir: \${datadir}/htdocs manualdir: \${datadir}/manual cgidir: \${datadir}/cgi-bin includedir: \${prefix}/include/apache2 localstatedir: /var runtimedir: \${localstatedir}/run logfiledir: \${localstatedir}/log/apache2 proxycachedir: \${localstatedir}/cache/apache2 infodir: \${exec_prefix}/share/info installbuilddir: \${datadir}/build errordir: \${datadir}/error </Layout> EOF ./configure --enable-layout=Slackware \ --enable-module=most \ --enable-mods-shared=most \ --enable-ssl=shared \ --enable-mime-magic \ --enable-expires \ --enable-headers \ --enable-usertrack \ --enable-cgi \ --enable-vhost-alias \ --enable-speling \ --enable-so \ --enable-rewrite \ --enable-deflate \ --enable-dav \ --enable-dav-fs \ --enable-proxy make clean time nice make su -c "checkinstall -y" } create_scripts() { cat > rc.httpd <<EOF #!/bin/sh # # Start the Apache web server # case "\$1" in 'start') /usr/sbin/apachectl start ;; 'stop') /usr/sbin/apachectl stop ;; 'restart') /usr/sbin/apachectl restart ;; *) echo "usage \$0 start|stop|restart" ;; esac EOF chmod 755 rc.httpd cat > apache2 <<EOF /var/log/apache2/*_log { sharedscripts monthly rotate 6 create compress postrotate /bin/kill -HUP `cat /var/run/httpd.pid 2> /dev/null` 2> /dev/null || true endscript } EOF } build_apache create_scripts </pre> This script will get the job done. It will compile and install Apache 2.0.x together with the startup scripts. [[Category:Tutorials]] b79dc78497ebb1463dc74fb1d0ce6f0b670ddd2a Automating tasks with BASH 0 54 75 2009-06-02T03:18:06Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] Often you will want to automate certain commands with BASH. The easiest way to do this is by using file globbing with wildcards otherwise called expansion. For example say I have a directory with the following files in it $ ls file1.txt file2.txt file3.txt If I type $ ls *.txt file1.txt file2.txt file3.txt The Shell will expand *.txt to match any file that matches the pattern of any number of characters followed by a .txt it then sends this list to the ls command. The ls command takes that list as a set and displays the directory listing for each one. Now most commands will work with file globbing but sometimes there are problems. For example if I wish to convert a heap of .jpeg files to 800x600 resolution with one line: $ ls *.jpeg img_2992.jpeg img_2994.jpeg img_2996.jpeg img_2998.jpeg img_3000.jpeg img_3002.jpeg img_2993.jpeg img_2995.jpeg img_2997.jpeg img_2999.jpeg img_3001.jpeg $ convert *.jpeg -resize 800x600 *.jpeg $ ls *.jpeg img_2992.jpeg img_2998.jpeg img_3002-10.jpeg img_3002-16.jpeg img_3002-3.jpeg img_3002-9.jpeg img_2993.jpeg img_2999.jpeg img_3002-11.jpeg img_3002-17.jpeg img_3002-4.jpeg img_3002.jpeg img_2994.jpeg img_3000.jpeg img_3002-12.jpeg img_3002-18.jpeg img_3002-5.jpeg img_2995.jpeg img_3001.jpeg img_3002-13.jpeg img_3002-19.jpeg img_3002-6.jpeg img_2996.jpeg img_3002-0.jpeg img_3002-14.jpeg img_3002-2.jpeg img_3002-7.jpeg img_2997.jpeg img_3002-1.jpeg img_3002-15.jpeg img_3002-20.jpeg img_3002-8.jpeg Of course that was not what we expected. There is an easier solution to this and that is to use BASH's for loop command. $ for var1 in *.jpeg; do convert $var1 -resize 800x600 $var1; done $ ls *.jpeg img_2992.jpeg img_2994.jpeg img_2996.jpeg img_2998.jpeg img_3000.jpeg img_3002.jpeg img_2993.jpeg img_2995.jpeg img_2997.jpeg img_2999.jpeg img_3001.jpeg What this command does is loop through all the .jpeg files in the directory and for each file it stores the name of that file in the variable $var1 which is then used as two arguments to convert, the input and output file names respectively. Basically it looks to the system like this convert img_2992.jpeg -resize 800x600 img_2992.jpeg convert img_2993.jpeg -resize 800x600 img_2993.jpeg convert img_2994.jpeg -resize 800x600 img_2994.jpeg convert img_2995.jpeg -resize 800x600 img_2995.jpeg convert img_2996.jpeg -resize 800x600 img_2996.jpeg convert img_2997.jpeg -resize 800x600 img_2997.jpeg convert img_2998.jpeg -resize 800x600 img_2998.jpeg convert img_2999.jpeg -resize 800x600 img_2999.jpeg convert img_3000.jpeg -resize 800x600 img_3000.jpeg convert img_3001.jpeg -resize 800x600 img_3001.jpeg convert img_3002.jpeg -resize 800x600 img_3002.jpeg You can play with this by echoing the output of the expansion to the console. $ for var2 in *.txt; do echo $var2 ;done file1.txt file2.txt file3.txt $ echo *.txt file1.txt file2.txt file3.txt Those are similar expansions but not exactly the same. Note: var1 and var2 are random variable names that I have picked. You can use other variable names like images or textfiles. 07fc4adfd087a317380a312f53b65e4d6664b0ae Bootsplash (old) 0 55 76 2009-06-02T03:18:48Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] == Prerequisites == * kernel source * a bootsplash patch for your kernel version [http://www.stadtwald21.de/mcbeister/bootsplash/index.html] bootsplash patch. * A bootsplash theme [http://kde-look.org/index.php?xcontentmode=61 kde-look themes] * Bootsplash utilites [http://www.yzzerdd.net/slackware/files/bootsplash/bootsplash-3.1.tar.bz2 download] == Setup == Start by patching and building a new kernel. Assuming Stock kernel configuration/source. And all your downloads are in /home/username/Downloads. <sub> cd /usr/src/linux patch -p1</home/username/Downloads/bootsplash*.diff rm .config zcat /proc/config.gz > .config make menuconfig</sub> *Note: If you insist on using the generic kernel. And are currently using it. Check to see if the .config in your /usr/src/linux directory matches /proc/config.gz <sub> zdiff /proc/config.gz /usr/src/linux/.config </sub> If they match, skip the "rm .config && zcat ..." part above You'll also want to converge your initrd.gz and bootsplash's initrd. More on that below. Edit these 2 options: <sub> Device Drivers ---> Graphics support ---> Logo configuration ---> [ ] Bootup logo Bootsplash configuration ---> [*] Bootup splash screen</sub> * If you aren't using a stock kernel configuration, or on another distro check these settings whileyou are still in the kernel configuration dialog: <sub><nowiki> Device Drivers ---> Block devices ---> <*> RAM disk support Graphics support ---> <*> Support for frame buffer devices</nowiki></sub> Now to make the patched kernel and install it <sub> make ; cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-bootsplash</sub> For slamd64, thats: <sub> make ; cp /usr/src/linux/arch/x86_64/boot/bzImage /boot/vmlinuz-bootsplash</sub> On to making a new bootsplash initrd. Compile and install the splash utility. <sub> cd /home/username/Downloads tar xf bootsplash-3.0.7.tar.bz2 cd bootsplash-3.0.7/Utilities/ make splash cp splash /usr/bin/ </sub> And use it to build your new initrd. Untar the theme file you downloaded, and check to see if it has a config directory and an image/s directory. Look in the config directory for an appropriately sized config file (usually bootsplash-1024x768.cfg). Edit this file, changing the directory it looks for images in (jpeg= option and silentjpeg= option) to point to the correct directory of the images for that theme. Example: /home/username/Downloads/bootsplashtheme/images/foo-bar.jpg Finish by making the initrd with splash: <sub> splash -s -f /home/username/Downloads/bootsplashtheme/config/bootsplash-1024x768.cfg >> /boot/initrd.splash </sub> For generic kernel users, you'll have to converge your stock initrd.gz and the bootsplash initrds. <sub>mkinitrd cp /boot/initrd.splash /boot/initrd-tree/ </sub> After putting the initrd-splash into the mkinitrd's initrd-tree you'll need to run mkinitrd again with some computer specific options. Example: <sub>mkinitrd -c -m reiserfs</sub> Remember to do this every time you make a new initrd.splash. Now edit /etc/lilo.conf with your favorite editor, adding the new kernel and bootsplash options. Sample: <sub> boot = /dev/hda message = /boot/boot_message.txt prompt timeout = 300 change-rules reset vga = 791 image = /boot/vmlinuz root = /dev/hda1 label = Linux read-only image = /boot/vmlinuz-bootsplash root = /dev/hda1 label = Bootsplash initrd=/boot/initrd.splash append="splash=silent" </sub> Substitue "initrd=/boot/initrd.gz" if you had to run mkinitrd for a generic kernel, then run lilo to update and you're set. <sub>root@slackware:~# lilo Added Linux Added Bootsplash </sub> Now you can Reboot to test everything. If boot fails for some reason. You still have your stock kernel and entry in lilo to boot into without worries. == Progressbar - rc.progress == Theres no set way to do this, you just need init to update /proc/splash correctly. The way I do it (with help from LinuxQuestiosn forums): create a new file in /etc/rc.d/ named rc.progress <sub> cd /etc/rc.d/ ; touch rc.progress </sub> edit it, and add this script: <sub><nowiki> #!/bin/sh # #rc.progress This file has a common subroutine used to update a # bootsplash progress bar. # # Count the number of times the progress bar is likely to gbe increased numu=$((`cat /etc/rc.d/rc.* | grep -c "^progressup"`)); numd=$((`cat /etc/rc.d/rc.* | grep -c "^progressdown"`)); function progressup(){ progress=$((`cat /var/run/progressbar`)); progress=$(($progress+1)); echo $progress > /var/run/progressbar echo "show $(( 65523 * $progress / $numu ))" > /proc/splash } function progressdown(){ progress=$((`cat /var/run/progressbar`)); progress=$(($progress-1)); echo $progress > /var/run/progressbar echo "show $(( 65523 * $progress / $numd ))" > /proc/splash } </nowiki></sub> Now *CAREFULLY* edit /etc/rc.d/rc.S at the top add the line (a new line by itself) <sub> . /etc/rc.d/rc.progress </sub> The . tells your system to include the functionality described in /etc/rc.d/rc.progress. Now scroll through and add "progressup" (the defined trigger in rc.progress) on a new line at the end of every subroutine where you want the progressbar to incriment up. Example section of my rc.S: <sub><nowiki> #!/bin/sh # # /etc/rc.d/rc.S: System initialization script. # # Mostly written by: Patrick J. Volkerding, <volkerdi@slackware.com> # . /etc/rc.d/rc.progress PATH=/sbin:/usr/sbin:/bin:/usr/bin # Mount /proc right away: </nowiki></sub> Don't add progressup till after your partition is mounted read/write it'll be at the end of a long segment of echo .. echo.. echo like this. <sub><nowiki> echo -n "Press ENTER to continue. " read junk; fi # Done checking root filesystem progressup </nowiki></sub> Do the same for /etc/rc.d/rc.6 adding progressdown instead of progressup. After you've finished that, you need to delete your temporary progressbar output cache. Since rc.local is run last during startup, it's best to accomplish this here. Edit rc.local: <sub><nowiki> #!/bin/sh # # /etc/rc.d/rc.local: Local system initialization script. # # Put any local startup commands in here. Also, if you have # anything that needs to be run at shutdown time you can # make an /etc/rc.d/rc.local_shutdown script and put those # commands in there. rm -fr /var/run/progressbar </nowiki></sub> == Progressbar - rc.bootsplash == An alternate script can also be used if you should have problems implementing the rc.progress script. In my case the prior script was not able to delete its progressbar file, and adding progressdown entries to rc.6 resulted in odd behaviors even during bootup when rc.6 should not of been a factor. Create a new file in /etc/rc.d/ named rc.bootsplash <sub> cd /etc/rc.d/ ; touch rc.bootsplash </sub> edit it, and add this script: <sub><nowiki> #! /bin/sh # # /etc/rc.d/rc.bootsplash: bootsplash functions. # This file does nothing if run, and is called by other rc. # files in order to make the progress bar and animations works. function progressbar() { if [ $# != 1 ] then echo "Usage: progressbar {progress}" exit 1 fi if [ -a /proc/splash ] ; then echo "show $(( 65534 * $1 / 100 ))" > /proc/splash fi } # function animate() { if [ $# = 0 ] then echo "Usage: animate {hook}" exit 1 fi splash "$*" } </nowiki></sub> Now *CAREFULLY* edit /etc/rc.d/rc.S at the top add the line (a new line by itself) <sub> . /etc/rc.d/rc.bootsplash </sub> Now scroll through and add "progressbar X" (where X is a number representing the percent to incriment to) on a new line at the end of every subroutine where you want the progressbar to incriment up. 0 is not a valid incriment. Only 1 - 100 are valid. Example rc.S <sub><nowiki> # Scan for new volume groups: /sbin/vgscan --mknodes --ignorelockingfailure 2> /dev/null if [ $? = 0 ]; then # Make volume groups available to the kernel. # This should also make logical volumes available. /sbin/vgchange -ay --ignorelockingfailure fi fi progressbar 5 # Open any volumes created by cryptsetup: if [ -f /etc/crypttab -a -x /sbin/cryptsetup.static ]; then # First, check for device-mapper support. if ! grep -wq device-mapper /proc/devices ; then # If device-mapper exists as a module, try to load it. # Try to load a device-mapper kernel module: /sbin/modprobe -q dm-mod fi cat /etc/crypttab | grep -v "^#" | grep -v "^$" | while read line; do LUKS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f1 -d' ') DEV=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f2 -d' ') PASS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f3 -d' ') OPTS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f4 -d' ') LUKSOPTS="" if echo $OPTS | grep -wq ro ; then LUKSOPTS="${LUKSOPTS} --readonly" ; fi # NOTE: we only support LUKS formatted volumes (except for swap)! if /sbin/cryptsetup.static isLuks $DEV 2>/dev/null ; then echo "Unlocking LUKS crypt volume '${LUKS}' on device '$DEV':" if [ -n "${PASS}" ]; then if [ -f ${PASS} ]; then /sbin/cryptsetup.static ${LUKSOPTS} --key-file=${PASS} luksOpen $DEV $LUKS elif [ "${PASS}" != "none" ]; then echo "${PASS}" | /sbin/cryptsetup.static ${LUKSOPTS} luksOpen $DEV $LUKS fi else for i in seq 1 3 ; do /sbin/cryptsetup.static ${LUKSOPTS} luksOpen $DEV $LUKS </dev/tty0 >/dev/tty0 2>&1 [ $? -eq 0 ] && break done fi elif echo $OPTS | grep -wq swap ; then # If any of the volumes is to be used as encrypted swap, # then encrypt it using a random key and run mkswap: echo "Creating encrypted swap on device '$DEV' mapped to '${LUKS}':" /sbin/cryptsetup.static --cipher=aes --key-file=/dev/urandom --key-size=256 create $LUKS $DEV mkswap /dev/mapper/$LUKS fi done fi # Enable swapping: /sbin/swapon -a progressbar 10 </nowiki></sub> Continue adding "progressbar X" entries in both rc.S and rc.M Do the same for rc.6 but instead incrimenting down 'X'. Example rc.6 <sub><nowiki> #! /bin/sh # # rc.6 This file is executed by init when it goes into runlevel # 0 (halt) or runlevel 6 (reboot). It kills all processes, # unmounts file systems and then either halts or reboots. # # Version: @(#)/etc/rc.d/rc.6 2.47 Sat Jan 13 13:37:26 PST 2001 # # Author: Miquel van Smoorenburg <miquels@drinkel.nl.mugnet.org> # Modified by: Patrick J. Volkerding, <volkerdi@slackware.com> # . /etc/rc.d/rc.bootsplash # Set the path. PATH=/sbin:/etc:/bin:/usr/bin progressbar 100 # If there are SystemV init scripts for this runlevel, run them. if [ -x /etc/rc.d/rc.sysvinit ]; then . /etc/rc.d/rc.sysvinit fi progressbar 90 # Set linefeed mode to avoid staircase effect. /bin/stty onlcr echo "Running shutdown script $0:" # Find out how we were called. case "$0" in *0) command="halt" ;; *6) command=reboot ;; *) echo "$0: call me as \"rc.0\" or \"rc.6\" please!" exit 1 ;; esac # Save the system time to the hardware clock using hwclock --systohc. if [ -x /sbin/hwclock ]; then # Check for a broken motherboard RTC clock (where ioports for rtc are # unknown) to prevent hwclock causing a hang: if ! grep -q -w rtc /proc/ioports ; then CLOCK_OPT="--directisa" fi if grep -q "^UTC" /etc/hardwareclock 2> /dev/null ; then echo "Saving system time to the hardware clock (UTC)." /sbin/hwclock $CLOCK_OPT --utc --systohc else echo "Saving system time to the hardware clock (localtime)." /sbin/hwclock $CLOCK_OPT --localtime --systohc fi fi progressbar 80 </nowiki></sub> 6d57a57211dc8013b3497e5c44ab1d5c10ddc57c CPU User Limiting 0 56 77 2009-06-02T03:19:51Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] == CPU / Performance Limits == To set limits on users (e.g. CPU usage), use <code>ulimit</code>. EXAMPLE: <code>ulimit -t;</code> From the manpage: <code>-a</code> All current limits are reported<br> <code>-c</code> The maximum size of core files created<br> <code>-d</code> The maximum size of a process's data segment<br> <code>-f</code> The maximum size of files created by the shell<br> <code>-i</code> The maximum number of pending signals<br> <code>-l</code> The maximum size that may be locked into memory<br> <code>-m</code> The maximum resident set size<br> <code>-n</code> The maximum number of open file descriptors (most systems do not allow this value to be set)<br> <code>-p</code> The pipe size in 512-byte blocks (this may not be set)<br> <code>-q</code> The maximum number of bytes in POSIX message queues<br> <code>-s</code> The maximum stack size<br> <code>-t</code> The maximum amount of cpu time in seconds<br> <code>-u</code> The maximum number of processes available to a single user<br> <code>-v</code> The maximum amount of virtual memory available to the shell<br> <code>-x</code> The maximum number of file locks<br> == Disk Space Limits == Use <code>quota</code>. e89f1dd55c86ffae9e859b1031dd1455ae8efc43 Changes 10.0 10.1 0 57 78 2009-06-02T03:20:35Z Erik 1 Copy from old wikitext text/x-wiki = Purpose = The purpose of this page is to document the new packages (Package Additions) and removed packages (Package Removals) during the release cycle from Slackware 10.0 to Slackware 10.1. = Package Additions From 10.0 to 10.1 = * l/libidn * n/vsftpd = Package Removals From 10.0 to 10.1 = * gnome/epiphany * gnome/epiphany-extensions * gnome/galeon = Other Concerns = These packages were sent to ./pasture: * pasture/fvwm95 * pasture/apsfilter * pasture/ifhp * pasture/fluxbox-0.1.14 41171411643c1af5220345dd2480c0ca3957d1b6 Changes 10.2 current 0 58 79 2009-06-02T03:21:25Z Erik 1 Copy from old, SOMEONE SHOULD WORK ON THESE! wikitext text/x-wiki = Purpose = The purpose of this file is to document the new packages (Package Additions) and removed packages (Package Removals) during the development cycle from Slackware 10.2 through Slackware 11.0, as well as to point out some potential "gotchas" that can users can avoid by arming themselves with a little knowledge. = Package Additions Since 10.2 = * a/pcmciautils * a/sharutils (split from bin) * a/acl (split from xfsprogs) * a/attr (split from xfsprogs) * a/sysfsutils * a/sysstat * ap/diffstat * ap/dmapi (split from xfsprogs) * ap/linuxdoc-tools * ap/lm_sensors * ap/xfsdump (split from xfsprogs) * d/git * d/mercurial * d/ruby * kde/amarok * kde/qca * kde/qca-tls * l/apr * l/apr-util * l/cairo * l/db42 (for backwards compatibility) * l/db44 (upgrade from db4; see 'Package Removals' and 'Other Concerns' for more information) * l/desktop-file-utils * l/freetype (split from x11) - see note in "Other Concerns" below * l/gd * l/gnome-icon-theme * l/hicolor-icon-theme * l/libgpod * l/libmtp * l/libmusicbrainz * l/libnjb * l/libtheora * l/libtunepimp * l/libvisual (library only, no plugins yet - but this should allow for compiling audio visualization plugins for amarok without a recompile of amarok itself) * l/mm (split from apache) * l/mpfr (split from gmp) * l/neon (split from subversion) * l/slang1 (renamed from slang) * l/slang (Added slang 2) * n/mailx (renamed from nail) * n/rdesktop * x/dejavu-ttf * x/fontconfig (split from x11) - see note in "Other Concerns" below * x/ttf-indic-fonts - see note in "Other Concerns" below * xap/seamonkey * xap/vim-gvim (renamed from xvim) - this package now depends on ap/vim * kernels/huge26.s/* - added a 2.6.17.13 kernel to the official (supported) package set. The user will be given a choice of whether to install the 2.4.33.3 or 2.6.17.13 kernel. If a 2.6 kernel is used, additional packages must be added after the installation -- at the very least the kernel-modules package. Possibly also the kernel-headers to provide /usr/include/sound used to compile ALSA applications. * extra/linux-smp-2.6.17.13/* - added a 2.6.17.13 kernel, modules, and headers with SMP and hyperthreading support, optimized for i686 or better cores (including dual core CPUs). = Package Removals Since 10.2 = * ap/sgml-tools (replaced with linuxdoc-tools) * d/python-demo (merged with python package) * d/python-tools (merged with python package) * l/db3 (moved to /pasture) * l/db31 (moved to /pasture) * l/db4-* (moved to /pasture) * n/nail (renamed to mailx - see "Package Additions") * xap/abiword (became a pure Gnome app) * xap/mozilla (replaced with seamonkey) * xap/xvim (renamed to vim-gvim) - see note above in "Package Additions" = Other Concerns = First of all, if you did not *upgrade* (in other words, you have a fresh installation), most of this is not relevant to you; you won't need to merge any config files or anything along those lines. However, this is still worth reading, as it gives you an idea of things to look for in future upgrades. * Both the 2.4.x and 2.6.x kernels included are now compiled with high memory support * Many old bison and db packages were pasture-ized from d/ and extra/ and so on; after upgrading/installing Slackware 11.0, you should have *one* bison package and *two* db packages (the db packages are listed in the package additions above) * n/php now depends on l/freetype (l/freetype was split from x/x11) * n/apache now depends on l/mm (l/mm was split from apache) * xap/xine-lib now depends on l/libtheora if you want to play ogg-files in xine (and Amarok using the xine engine) * a/devs was upgraded during the -current development cycle. You CANNOT upgrade this package while udev is running - you'll need to chmod -x /etc/rc.d/rc.udev, reboot, upgrade the devs package, and then reboot again. Actually, you don't *have* to reboot again, but if you know that, then you likely know how to go about it that way :) If you don't know the trick, here's how to do it (no secrets here): sh /etc/rc.d/rc.udev stop umount /dev/pts umount /dev/shm umount -l /dev installpkg devs*.tgz sh /etc/rc.d/rc.udev start mount -av Thanks to Richard Hoyle for this information on doing it without a reboot. * So long as we're on the subject of a/devs, be aware that this package is still *required* in order to boot, even if you're using a 2.6 kernel and udev, so don't remove it. * a/lilo and a/kernel-* were upgraded during the -current development cycle, so be sure to run /sbin/lilo prior to rebooting. * glibc was upgraded during the -current development cycle, so be sure to follow the instructions in [http://slackware.osuosl.org/slackware-11.0/UPGRADE.TXT UPGRADE.TXT] when upgrading (do the upgrade in runlevel 1). * There was a major upgrade to a/udev and a/sysvinit - make *sure* you merge the *.new scripts in /etc/rc.d prior to rebooting or you *will* have problems. * If you're having trouble with udev, make sure you've syncronized all of the .new config files and init scripts first. According to Pat Volkerding (the Slackware maintainer), most of these issues can "be fixed with a little bit of fine tuning, such as blacklisting unwanted modules in /etc/modprobe.d/blacklist and loading the desired replacements in /etc/rc.d/rc.modules," but simply blacklisting them will often result in udev loading the correct modules. Also, keep in mind that newer versions of udev (084+) require at least a 2.6.15.x kernel. Experiment with it before resorting to this, but if you simply must have one of them, there are alternate versions of udev in /extra. * If you're running a 2.6 kernel and new udev (084+) on a router, you'll probably need to uncomment (and possibly edit to suit) the rules in /etc/udev/rules.d/network-devices.rules to make your interfaces always get the same names assigned. Hotplugging events are generated (and processed) in random order by udev, so there's no guarantee that your current eth0 will *always* be eth0 unless you uncomment (and possibly edit) those rules. * If you need custom udev rules, DO NOT edit the default udev.rules file - any changes you make will be clobbered with the next udev upgrade. The correct way is to add a custom file to the /etc/udev/rules.d/ directory - most people use '10-local.rules' - and add your custom rules there. If there is some reason that one of the default rules needs changed, mail PiterPunk and/or Pat with an explanation. * The psmouse module is blacklisted by default in the /etc/modprobe.d/blacklist file due to problems with the default kernel options used when it loads; this allows you to load it (from rc.modules, for example) with option "proto=imps" if you need it, or you are certainly free to comment it out in the blacklist file if it works fine for you with the kernel defaults. * As indicated in the Package Additions section, freetype and fontconfig were split out of the main X11 packages. You need to upgrade the main x11 package first, then install fontconfig and freetype, then upgrade the remainder of the x11 packs; otherwise, they give an error during postinstall about not being able to load fontconfig libs. * xap/seamonkey was chosen to provide the Mozilla development environment (primarily because the official binaries are used for the Firefox package, and these do not contain the development headers). At this time, only GAIM links with SeaMonkey's libraries, but if you are planning to compile something needing "Mozilla" libraries and headers, be sure SeaMonkey is installed. * There have been quite a few reports that fonts are 'ugly' after upgrading; one way to fix it is to remove /etc/fonts/local.conf if it exists. If it doesn't exist, or that doesn't work, go into KControl's font settings, uncheck the box for antialiasing, and apply the changes. Then, recheck the box and apply the changes. This should create a $HOME/.fonts.conf file. Thanks to Pat for the initial suggestion with KControl, and thanks to ananke for working out exactly what changes are necessary to fix it. * Slackware's vim package now includes a $VIM/vimrc file (in this case, /usr/share/vim/vimrc) for vim's default configuration. This default should provide a suitable start for most and your ~/.vimrc will override it if not, but if you had previously not explicitly set, e.g., 'backup', because vim's compiled-in default resulted in no backups and that suited you, the $VIM/vimrc includes 'set backup' and you will suddenly be keeping backups. These settings can be overridden individually (in this case with 'set nobackup') but one of several ways to avoid having $VIM/vimrc affecting your configuration at all is to put this at the top of your ~/.vimrc, overriding everything in $VIM/vimrc: set all& " reset all options to compiled in defaults (thanks to deryni in #vim) unmap Q " remove mapping to gq syntax off " turn syntax off filetype plugin indent off " turn filetype detection off augroup! vimrcEx " delete the autocommand group that wraps text, etc. * If you have an ati radeon card and are experiencing problems with it locking up, there is a patched set of ati modules at /extra/x11-radeon-patched/ - if you are not experiencing problems, then don't install this, as it does tend to cause problems if you weren't already having them... * The ttf-indic-fonts package supports Bengali, Devanagari, Gujarati, Kannada, Malayalam, Oriya, Punjabi, Tamil, and Telugu. For information about fully enabling Indic support (including input), see: /usr/doc/Linux-HOWTOs/Indic-Fonts-HOWTO. * As part of the upgrade to nfs-utils and portmap, the /etc/rc.d/rc.portmap script has been replaced by /etc/rc.d/rc.rpc. The rc.rpc script does not have to be executable unless you plan on mounting nfs shares <b>manually</b>, as it will be run by other init scripts if any nfs shares or mounts are detected. * php5 and lvm2 are available in /extra if you would like to use them * cairo-1.2.4, flex-2.5.33, fontconfig-2.4.1, gutenprint-5.0.0, hplip-1.6.9, iptables-1.3.6, and wpa_supplicant-0.4.9 are available in /testing if you need/want them [http://www.slackforum.de/wiki/Aenderungen102110 german version] 13e19ada68315b7579510342fd63c10e6eb83701 Changing Window Managers 0 59 80 2009-06-02T03:21:59Z Erik 1 Copy from old wikitext text/x-wiki Well I'm sure you all want to change you window manager at some point in time:), well this tutorial is going to show you how in Slackware. First as a user run the following command: xwmconfig This will bring up an ncurses based menu to select the window manager you want. What this does for the user is copy the xinitrc from /etc/X11/xinit/. For instance, Say I want KDE to startup, all the tool would do is run: cp /etc/X11/xinit/xinitrc.kde $HOME/.xinitrc That is basicly what it does, Now say you want to start a program from when starting your window manager? Well thats easy, we shall open up the ~/.xinitrc: (I am going to use the fluxbox one) exec /usr/X11R6/bin/fluxbox That is what you see, so say you want to start a program before fluxbox, like a program that changes your background? Well here is an example: background-program & exec /usr/X11R6/bin/fluxbox You see you MUST have the & or fluxbox wont startup. I hope you learned from this. [[Category:Tutorials]] c9cbfa99b44c8d08d97606b46be63cc891e97ba6 Common Commands 0 60 81 2009-06-02T03:22:38Z Erik 1 Copy from old wikitext text/x-wiki Here is a list of common commands and some descriptions: cd : Changes the directory. Example: <code>cd /</code> rm <i>options filename</i> : Removes Files. Example: <code>rm <i>filename</i></code> ::Options: -R - Removes all files and subdirectories (very dangerous). Example: <code>rm -R /home/bill/public_html/</code> rmdir <i>directory</i> : Removes an Empty Directory. Example: <code>rmdir /home/bill/emptydir</code> mount : Mounts filesystems and partitions, etc ::Example: <code>mount /mnt/cdrom</code> <--Only useable if <code>/mnt/cdrom</code> is listed in [[Fstab|/etc/fstab]] ::Example: <code>mount -t iso9660 /dev/hdc /mnt/cdrom</code> ls <i>options optional_directory_path</i> (if no directory path is given, the current directory is listed) : Lists files and directories. Example: <code>ls</code> ::Options: :::-a - Lists ALL files and directories, even hidden ones. Example: <code>ls -a</code> :::-l - Lists files and directories with details (e.g. permissions) Example: <code>ls -l /home/bill/</code> :::-la - Lists ALL files and directories, even hidden ones with details. Example: <code>ls -la </code> gunzip <i>filename</i> : Uncompresses gzip'd files. Example: <code>gunzip somefile.tar.gz</code> tar <i>options filename</i> : Extracts files from .tar files. ::Options ::: -xvf - extract file.tar <code>tar -xvf file.tar</code> ::: -zxvf - uncompress and extract from a gzip'd tar archive (*.tar.gz or *.tgz) <code>tar -zxvf kernel-2.6.7.tar.gz</code> ::: -jxvf - uncompress and extract from a bzip2'd tar archive (*.tar.bz2) <code>tar jxvf kernel-2.6.7.tar.bz2</code> mc : Console File manager pico : Easy console text editor. NOTE: Pico is in the PINE package. If you didn't install Pine, you won't have pico. (You CAN install pico as a stand-alone binary). An alternative to Pico is [http://www.nano-editor.org/ GNU Nano]. It has many features, including syntax highlighting. vi, vim, elvis : Console text editors - depending on your setup, one of these is accessed as 'vi'. Vim & Elvis are Vi clones (with a few more features). Between Vim and Elvis, Vim is more featureful, but elvis is in /a and installed by default. You can install vim (or xvim/gvim, gui-enabled versions) instead of, or in addition to elvis. find : Program to find files. Example: <code>find / -name lilo.conf</code> cat : Shows what is currently in a text file. Example: <code>cat /proc/cpuinfo</code> grep : Searches for strings. Example: <code>grep "model name" /proc/cpuinfo</code> Add the option '-i' if you don't want your search to be case-insensitive less : You can control using arrow keys what is displayed in a text file. Example: <code>less /etc/lilo.conf</code> man : Manual pages for commands. Example: <code>man bash</code> apropos : Searches a whatis type database. Example: <code>apropos ftp</code> which : Shows the first match of a program in your path. Example: <code>which bash</code> whereis : Shows man pages, binaries, etc of a program. Example: <code>whereis bash</code> file : Determines the file type. Example: <code>file /usr/bin/bash</code> dmesg : Displays the kernel ring buffer information route : Configures the IP routing (used for setting the default gateway, etc.). ifconfig : Network interface configuration tool (used to bring the NIC up and down and set the IP). ssh : Secure SHell, allows you to login to remote machines. startx : A simple script to start X-Windows iwconfig : This is for configuring wireless cards chmod : Edits permissions on a file or directory (see [[Permissions and Umasks]]) netconfig : A tool to help you configure a network card on Slackware df : Shows the free space on your partitions. Example: <code>df -h</code> du : Calculates disk usage. Example: <code>du -hc</code> bunzip2 : Uncompresses .bz2 files. Example: <code>bunzip2 file.bz2</code> sort : Sorts data. A very useful option is '-f', which makes the sort case-insensitive (i.e. AaBbCc rather than ABCabc). Another useful option is '-n', which sorts by numbers. Try <code>du | sort</code> and then <code>du | sort -n</code> to see the difference. <h1>Piping</h1> You can mix commands to do certain things. dmesg | grep hd That will search dmesg and try to find the string "hd". Now piping is extremely useful. Another example of a pipe: dmesg | less Now this command you can see the dmesg fully and is easier to read. Redirection: This will save the dmesg information in your home directory in the file log.txt dmesg > ~/log.txt You can also redirect only the [[standard output|stdout]] by using '1>' or only the [[error messages|stderr]] by using '2>'. For instance, if you want to run a command that gives a lot of junk as output, and you just want to see any errors, you can redirect the output to the null device (<code>/dev/null</code>): mplayer /path/to/movie.avi 1> /dev/null <hr> <i>Section on piping moved to [[Piping]]. --sinope</i> [[Category:Tips]] 96272c3db843da5c8f1c152b81825a7a625dead5 Conexant Crypto F200 ADSL 0 61 82 2009-06-02T03:23:25Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] ''' '''Installation Guide for Crypto F200 0572:cb00 Conexant Systems (Rockwell), Inc. E-Tech ADSL Modem v2''' ''' This is a simple guide-howto for the installation of Crypto F200 ADSL modem (the one that comes with various ForthNet ADSL kits in Greece) on Slackware Linux. The following procedure was done on a Slackware 10.2 system (full installation) with kernel 2.6.17.1. The main guide that helped me setup my DSL connection is found in http://accessrunner.sourceforge.net .Excellent site - lots of usefull information . The reason for writting this guide is that some of the stuff on that site and a some howtos found on the net is out of date and a bit confusing. A lot of steps are not necessary when you use a new kernel like 2.6.17.1 . Having not set up a dsl modem on linux before I spent quite some time to figure out the new stuff from the old stuff - the things i had to do with 2.6.17.1 from the things i would have to do with an older kernel. In this guide I will just share with you what I figured out. So there are 5 simple steps you have to follow. '''1.'''Set up your new kernel so that it is capable of dealing with your Crypto Modem '''2.'''Make sure hotplug is up to date (only if you have an old distro) '''3.'''Grab your modem's windows drivers (tricky part you may have to use alternative drivers from other similar modems), locate CnxEtU.sys and by using the appropriate utility extract the modem´s firmware from it. '''4.'''Setup your pppd by editing /etc/ppp/peers/adsl , /etc/ppp/pap-secrets and /etc/ppp/chap-secrets '''5.'''Run pppd call adsl - You are on the net. Killall pppd to stop the internet connection. '''1.Kernel configuration:(this was done in 2.6.17.1)''' Networking -> Networking Options -> Asynchronus Transfer Mode (ATM) (EXPERIMENTAL) (ATM) Device Drivers -> USB Support -> Support for Host-side USB (USB) Device Drivers -> USB Support -> USB DSL modem support (USB_ATM) Device Drivers -> USB Support -> USB DSL modem support -> Conexant AccessRunner USB suppport (USB_CXACRU) '''2.Hotplug with firmware loader support utility must be available''' In Slackware 10.2 hotplug is ready. /etc/rc.d/rc.hotplug is by default exexutable. '''3.Extract the firmware from the files contained in the windows driver files.''' All conexant access runner based adsl modems (crypto f200 is one of them) work like this: When you plug it in (usb) , your pc sends it its firmware without which the modem does not work (it is the state when the led is permanently off). After it gets the firmware the led starts blinking. It is now that it tries to synchronize with the adsl line. If it succeeds then the led stops blinking and everything works. So the first thing we do is find the firmware for the modem. Downlaod cxacru-fw tool (this is the program that extracts the firmware from the file found in windows driver) You can find it in http://accessrunner.sourceforge.net/firmware.shtml -> Obtaining firmware (cxacru-fw.bin) Build cxacru-fw.c by typing gcc cxacru-fw.c -o cxacru-fw Extracting the firmware from the driver is easy: Locate CnxEtU.sys in windows driver files. Use cxacru-fw tool to extract the firmware: name it cxacru-fw.bin Place cxacru-fw.bin in /lib/firmware/ (/etc/rc.d/rc.hotplug grubs the firmware from there) Check if your modem works: Check the LED on top of the modem (On not blinking) Check /var/log/messages (up) Check /proc/net/atm/cxacru:0 (Line Up) If this works and the Led on top of the ADSL modem stops blinking a little after you plug it in then (you are lucky) go to step 4. The Hardest part is to find the appropriate windows driver (the appropriate CnxEtU.sys file) as the cd that came with my Crypto F200 (with CnxEtU.sys 9/12/03) had a firmware that would not let the adsl modem synchronize. This is what happens when the modem does not synchronize:(look at /var/log/messages) Attempt to synchronize Fail Second attempt Nothing else and the led on top of the adsl modem keeps blinking for ever. What I did was to search for drivers for other adsl usb modems with the same chip as Crypto F200 had (conexant) and the same Vendor and Product ID (which you can get with lsusb (0572:cb00)) Here is a list (posted in http://accessrunner.sourceforge.net) Conexant ADSL modem (Hasbani project) *AusLinx AL-2006 ACORP Sprinter@ADSL USB *Amigo HMX-CA85UR-K8 *Digicom Michelangelo Usb C *Origo ASU 8000 Atlantis Pocket USB ADSL Modem (A01-AU2) *These are known to work I was lucky . AusLinx AL-2006 Driver V099.061 had CnxEtU.sys with working firmware !!! (look at /var/log/messages) Jun 25 00:16:27 Itmy kernel: usb 2-2: configuration #1 chosen from 1 choice Jun 25 00:16:29 Itmy kernel: cxacru 2-2:1.0: found firmware cxacru-fw.bin Jun 25 00:17:27 Itmy kernel: ATM dev 0: ADSL line: attempting to activate Jun 25 00:17:52 Itmy kernel: ATM dev 0: ADSL line: training Jun 25 00:17:57 Itmy kernel: ATM dev 0: ADSL line: channel analysis Jun 25 00:18:02 Itmy kernel: ATM dev 0: ADSL line: up (512 kb/s down | 128 kb/s up) '''4.Final step: Setup pppd in order to connect to the internet.''' -Load pppoatm module: Slackware:add pppoatm in /etc/modules.conf in other distros it may be in /etc/modules -Set pppd options: Create /etc/ppp/peers/adsl Edit /etc/ppp/peers/adsl: # General configuration options for PPPD: lock kdebug 1 defaultroute noipdefault holdoff 4 persist maxfail 25 usepeerdns passive asyncmap 0 lcp-echo-interval 2 lcp-echo-failure 7 user put.your.username.here plugin /usr/lib/pppd/2.4.4b1/pppoatm.so 8.35 Edit /etc/ppp/pap-secrets "put.your.username.here" * "putyourpasswordhere" * Edit /etc/ppp/chap-secrets "put.your.username.here" * "putyourpasswordhere" * '''5.Connect to the internet !!!''' Start the connection pppd call adsl If everything goes well you will see something like this: Plugin /usr/lib/pppd/2.4.4b1/pppoatm.so loaded. PPPoATM plugin_init PPPoATM setdevname_pppoatm - SUCCESS:8.35 Stop the connection killall pppd [[Link title]] 5b2a2037b683be73b2dca95cc15f3a0adc35a420 Customising the install disk 0 63 84 2009-06-02T03:24:31Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] [[Category:Slamd64]] This is from my experience working with [http://www.slamd64.com Slamd64], and will probably grow as people ask more things. ==Adding a new kernel to the disk== Firstly, copy the kernels/bare.i/config to .config in your kernel source directory. You then need to configure your kernel as appropriate, and build it. Once you've done this, go to the kernels/ subdirectory of the tree, and make a new directory for your kernel, then run these commands: cd /usr/src/linux cp .config /path/to/slackware/tree/kernels/$KERNELNAME/config cp arch/x86_64/boot/bzImage /path/to/slackware/tree/kernels/$KERNELNAME/bzImage gzip -9 System.map cp System.map.gz /path/to/slackware/tree/kernels/$KERNELNAME/System.map.gz You then need to add a new section to the isolinux/isolinux.cfg file for the kernel, for example, if $KERNELNAME = 3ware.s (from Slamd64): label 3ware.s kernel /kernels/3ware.s/bzImage append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=11719 rw root=/dev/ram SLACK_KERNEL=3ware.s11 690ed08b049b5efec526bdd275902a8f76278995 ACPI Modules 0 64 85 2009-06-02T03:25:02Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] These are the kernel modules that need to be loaded in order to use some of the features of ACPI. * ac - AC adapter information * battery - Battery information * fan * button - Enables accesing info about ACPI-controlled buttons (like the Power button and the LID button) * video * thermal - Driver for the Thermal Zone (/proc/acpi/thermal_zone) * processor - Loads the ACPI processor driver (/proc/acpi/processor) * container - Loads the ACPI container driver * vendor-specific drivers (eg acer_acpi, [http://www.thinkwiki.org/wiki/Thinkpad-acpi thinkpad-acpi]) a1f62a5b9a0a02eca3d6d924c4076b0ae8077c45 ACX100 Wireless 0 65 86 2009-06-02T03:26:43Z Erik 1 Copy from old, had no category, placed in Hardware wikitext text/x-wiki [[Category:Hardware]] == Introduction == This is a Howto on how I was able to get the ACX100 open source driver to work with my card and Slackware. There are several other good resources for this driver on the 'net, but I thought it would be good to create one more that included the specific steps I took in Slackware to get my wireless internet running. For the time being, this is mostly just a placeholder, I will update this when I can find some spare time. Check out http://acx100.sourceforge.net for more info. == ACX100 Readme == This tarball is targeted at 2.6 inclusion only. Not designed to work or even compile with 2.4. Contact: netdev@vger.kernel.org acx100-devel@lists.sourceforge.net acx100-users@lists.sourceforge.net Bug reports: Visit http://www.catb.org/~esr/faqs/smart-questions.html Please describe your wireless setup, manufacturer and type (acx100/acx100usb/acx111?) of your hardware. Which firmware image(s) are you using? If problem is reproducible, #define ACX_DEBUG 2 in acx_config.h and modprobe driver with debug=0xffff. Post resulting kernel log (bzipped). It is large but very useful for bug hunting. Try older versions of the driver. Firmware images: You should not supply firmware_dir= parameter anymore. Driver will try to load the following images via hotplug (not from /usr/share/acx directory as older driver did, hotplug firmware directory location varies for different distros, try /lib/firmware or /usr/lib/hotplug/firmware): PCI driver: 'tiacxNNNcMM' (NNN=100/111, MM=radio module ID (in uppercase hex)): combined firmware for specified chipset and radio. Failing that, it will try to load images named 'tiacxNNN' (main firmware for specified chipset) and 'tiacxNNNrMM' (corresponding radio module). For example, my firmware is in file named 'tiacx111c16'. Alternatively, I may remove it and use pair of files 'tiacx111' and 'tiacx111r16' instead. USB driver: image is named 'tiacxNNNusbcMM' Build instructions: * Create drivers/net/wireless/acx subdirectory inside your kernel tree. * BTW, if your kernel has drivers/net/wireless/tiacx directory, you already may have acx driver (some different version). Decide which one do you want. * Unpack tarball into drivers/net/wireless/acx directory. * Add a line to drivers/net/wireless/Makefile: obj-m += acx/ * Build your modules as usual (perhaps "make modules modules_install"). This will create acx module. Remove "acx-obj-y += usb.o" line in Makefile and "#define CONFIG_ACX_USB 1" line in acx_config.h if you want PCI-only driver. Ditto for USB-only one. USB snooping: If you are an USB driver developer and need to see USB traffic, http://benoit.papillault.free.fr/usbsnoop/ may be useful. Another very good way to snoop the USB frames is under Linux if your driver happens to run under ndiswrapper (which is often the case), either by savage printk's, or by using the USB snooping facilities from Pete Zaitcev. From: Per Bjornsson <perbj@stanford.edu> To: ACX100 user mailing list <acx100-users@lists.sourceforge.net> Date: Fri, 08 Jul 2005 13:44:26 -0700 Hi, Just a note for those who, like me, prefer not to bother recompiling their whole kernel: It's not at all difficult to compile Denis's snapshots out of tree, despite what the readme file says! At least in somewhat recent 2.6.x kernels, there's a special syntax for compiling modules in a particular directory (as noted in the kernel docs in Documentation/kbuild/modules.txt): * Unpack Denis's tarball in a new directory (note that the tarballs currently don't contain a root directory, just the files, so you want to do the untarring in an empty directory) * If you're building for the currently running kernel, build the modules with the command make -C /lib/modules/`uname -r`/build M=`pwd` * Install the modules (must be root for this step, so use 'su' if that's your preferred method of doing root stuff) with make -C /lib/modules/`uname -r`/build M=`pwd` modules_install I figured that the snapshots might get more testing if more people know that they don't have to muck around with the whole kernel source in order to build this. I tested this on Fedora Core 4; sane distributions should be using this setup for accessing the kernel build files (if they listened to Linus's suggestions anyways). The one trick is that you might need a special "kernel development files" package; on Fedora Core, the files are included in the regular kernel package for FC2 and 3 but you need the 'kernel-devel' package for FC4. And finally, the kernel won't figure out that the module has been installed until you run 'depmod -ae' as root. You can check that something useful got picked up with 'modinfo'. (Both of these commands are likely installed in /sbin so you might need the full path unless you're fully logged in as root.) The latest snapshot (acx-20050708.tar.bz2) generally seems to work well for me, except that it's somewhat noisy and reports a lot of DUPs in the system log. However, it appears to associate more consistently with my access point that the old versions (when I had those modprobed on boot and brought up by the system network scripts, the card would often just sit and scan around and never actually associate until I manually restarted the connection) - admittedly I've only tried a couple of times yet so I don't know just how consistent this is. My hardware is a Netgear WG311v2, using the firmware from the latest Netgear Windows driver. (Can't check the details right now since I'm not at that computer, sorry - it got too late when I was mucking with this and other stuff yesterday for me to get a message sent...) Cheers, Per -- Per Bjornsson <perbj@stanford.edu> Ph.D. Candidate, Department of Applied Physics, Stanford University cb763581eddb7ff55006518a528e5c6cd5dc6fec AllixD Firewall Script 0 66 87 2009-06-02T03:28:07Z Erik 1 Copy from old wikitext text/x-wiki I use this. It does not allow any incoming data, so it's no good for NFS servers. #!/bin/sh IPT="/usr/sbin/iptables" # Let's make sure forwarding is DISABLED: echo "0" > /proc/sys/net/ipv4/ip_forward # Let's enable SYN cookies (to protect against SYN floods): echo "1" > /proc/sys/net/ipv4/tcp_syncookies # Let's disable TCP timestamps to reduce the TCP stack workload: echo "0" > /proc/sys/net/ipv4/tcp_timestamps # Let's enable reverse path filtering for anti-spoofing: echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter # Let's ignore PINGs which have been BROADCAST: echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts # Let's disable source routed packets as they are ridiculous: echo "0" > /proc/sys/net/ipv4/conf/all/accept_source_route # Let's allow redirects from trusted gateways only: echo "1" > /proc/sys/net/ipv4/conf/all/secure_redirects # Let's log any UFOs which are spotted: echo "1" > /proc/sys/net/ipv4/conf/all/log_martians # Let's flush-out all the chains in our tables: $IPT -F $IPT -F -t nat $IPT -F -t mangle # Let's delete every non-builtin chains in our tables: $IPT -X $IPT -X -t nat $IPT -X -t mangle # Let's set our INPUT policy to DROP: $IPT -P INPUT DROP # Let's set our OUTPUT policy to ACCEPT, because we can # appreciate this kinda flexibility on a Home PC: $IPT -P OUTPUT ACCEPT # Let's accept incoming packets which belong to connections # that have ALREADY been initiated: $IPT -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # Let's allow all packets initiating new connections LOCALLY: $IPT -A INPUT -i lo -m state --state NEW -j ACCEPT # Let's log every packet that reaches this rule, right before # it hits our INPUT policy and gets a DROP: $IPT -A INPUT -j LOG --log-prefix "INPUT DROP: " # Let's load the module allowing Connection Tracking for FTP: /sbin/modprobe ip_conntrack_ftp # Let's load the module allowing Connection Tracking for IRC: /sbin/modprobe ip_conntrack_irc # No rc.firewall script is complete without the ubiquitous echo: echo "So let it be written. So let it be done." [[Category:Security]] bab170863061646b57bacd635f02d2b78a6837b5 Apache 0 67 88 2009-06-02T03:30:00Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] ==Tuning logs== I'm sure all of you have gotten x90's and other worm hits flooding your apache logs. Well its an easy fix, just edit a few things. First find and edit your log entries: : <code>CustomLog /var/log/apache/access_log common env=good</code> : <code>CustomLog /dev/null common env=!good</code> You can use an actual file to log errors, instead of dumping them to <tt>/dev/null</tt> Now we find a section that looks similiar below Now lets tell it what to log :) Notice WHAT TO LOG <IfModule mod_setenvif.c> SetEnvIf Request_Method "HEAD" good SetEnvIf Request_Method "GET" good SetEnvIf Request_Method "POST" good SetEnvIf Request_URL "^/script" !good SetEnvIf Request_URL "^/default.ida" !good SetEnvIf Request_URI (.*)default\.ida !good SetEnvIf Request_URI (.*)cmd\.exe !good SetEnvIf Request_URI (.*)scripts !good SetEnvIf Request_URI (.*)root\.exe !good </IfModule> Notice how there are 2 goods, One is with the ! and one without. The first one without the ! is what apache will log. The second !good, that tells apache what you dont want to log. In the above example i have SetEnvIf Request_URI (.*)default\.ida !good. This would actually find anything with default.ida and not log it. This would stop the default.ida?XXXXXXX in the logs. That will match anything with default.ida. This next example would block the IP address you set: : <code>SetEnvIf Remote_Addr "192\.168\.0\.1" !good</code> Again you notice that it wont log anything coming from that IP. ==Enabling PHP in Apache== Enabling PHP in slackware is fairly easy, all you have to do is open /etc/apache/httpd.conf - as SU - and edit 1 line!. Find the line below - it is near the bottom: #Include /etc/apache/mod_php.conf Then you just make it look like this: Include /etc/apache/mod_php.conf When you restart apache you might want to put a small php script in your htdocs directory and test it. To restart apache: apachectl graceful ==CGI-BIN== See [[Apache-cgi]] 62103ff09d31ed909ea056b1557ea9028978c06d Basic Security Fixes 0 69 90 2009-06-02T03:31:08Z Erik 1 Copy from old wikitext text/x-wiki Small tips to increase the security of your Slackware box: * Use strong passwords! The most common way Linux systems get hacked is through weak user passwords and SSH. * Use a firewall! [http://www.freshmeat.net Freshmeat.net] has lots of automatic tools to help with configuration, and we have some example scripts posted [[Iptables_Scripts|here]]. * Tell X not to listen for TCP connections: ** KDM: Add "ServerArgsLocal=-nolisten tcp" under section [X-:*-Core] to /opt/kde/share/config/kdm/kdmrc ** XDM: Add "-nolisten tcp" to the line calling X in /etc/X11/xdm/Xservers. ** Console: Use 'startx -- -nolisten tcp' rather than 'startx', possibly with the aid of an alias. ***: You can also edit startx and, at line 168 (where it calls xinit), append '-nolisten tcp' at the end, but this is a dirty hack. * Close any services you do not require, especially since most run as root. Think about what you will use them for. For instance, would you really want to run an sshd 24/7 when you will only perhaps access it remotely once in a blue moon, of which you will most likely know about in advance at which point you can run the required deamon prior too accessing remotely. ** To disable startup services in /etc/rc.d, unset the executable bit of the rc script. You can still start and stop services by executing the rc script later using 'sh'. ** You can also edit /etc/rc.d/rc.M directly and comment out lines that calls the other rc scripts. * Disable the "time" service, by commenting out lines 22 and 23 in /etc/inetd.conf - you will need to restart inetd after making the changes. (If you need to run inetd at all!) * Look for any services/daemons that you don't know about by running "netstat -luntp". * Run 'ps -e u' several times and become familiar with your usual processes to establish a "baseline". Then keep monitoring regularly to spot when something doesn't seem right. * If you suspect intrusion or have suspicious files, scan your system for rootkits with 'chkrootkit'. You can also scan for win32 "malware" with 'clamav' for instance if you're using your system as a mail/ftp server. * Add the following line to hosts.deny to disallow access by any host to your system... 'ALL: ALL' - note that this only affects services built with libwrap (tcpwrappers), but it's one layer of security. A further layer would be to add the following to /etc/hosts.allow... 'ALL: ALL: DENY' * Fine tune logrotate by editing /etc/logrotate.conf and add more log rotations in /etc/logrotate.d/ * If you want to restrict who is able to use the su command to switch to certain users, you can use /etc/suauth. The basic format for /etc/suauth is "to-id:from-id:ACTION" :Example: root:foobar:DENY :would stop the user foobar from using su to become root. :Another example: root:ALL EXCEPT GROUP wheel:DENY :would only allow users in the wheel group to su to root. :You can also allow users to su with no password required (why you would do this is beyond me), and can require that a user enter their OWN password before switching users. For more information, please consult the man page for /etc/suauth. :(Thanks to cubicool for informing me of the existence of /etc/suauth) :A similar, though perhaps not as fine-grained, way to control who can use su is to change ownership and permissions of /bin/su. First, add the user(s) that you want to be able to use su to the wheel group in /etc/passwd. Next, change the ownership of /bin/su to group wheel, and change its permissions to 4750. chown root:wheel /bin/su chmod 4750 /bin/su :This makes /bin/su executable *only* by members of the wheel group. * Another way to restrict the users who can become root is to edit the file /etc/login.defs and change the value of SU_WHEEL_ONLY to yes. [[Category:Tips]] [[Category:Security]] 5f3827f2c6a6dd53eb27b78e16058b0b0ebb469e Bluetooth 0 70 91 2009-06-02T03:31:37Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] == Introduction == This tutorial is meant to simplify the process of configuring a GNU/Linux Distribution, specifically Slackware, to use Bluetooth wireless technology. I will show you step by step how I setup my system and got Bluetooth functioning. Since it is unlikely that you have the exact same hardware that I do, you may need to modify a few steps to fit your needs. == Example System Information == This is a list of my specific hardware that applies to this topic. Do not worry if your's is not exactly the same because you can still use this information to guide you through the process. ;Motherboard (USB Ports) :[http://www.msicomputer.com/product/p_spec.asp?model=K8N_Neo4_Platinum/SLI MSI Neo4 Platinum/SLI] ;Bluetooth USB Dongle :[http://www.amazon.com/gp/product/B0001Q5SZ0/103-7636612-6018206?v=glance&n=172282 Kensington Bluetooth USB Adapter (33085)] ;Cell Phone :[http://www.motorola.com/motoinfo/product/details.jsp?globalObjectId=72 Motorola V551] ;[http://www.slackware.org Slackware-Current (as of 5/31/06)] ;[http://www.kernel.org Kernel 2.6.16.16] (worked on 2.6.15.6 also) == Kernel Configuration == The first step is enabling the drivers for USB and Bluetooth in your kernel. I'm not sure exactly which kernel version began including Bluez Bluetooth drivers, but my 2.6.15.6 kernel had them. [http://www.westmaster.com/zidek/p900/bluetooth/ From this page], it looks like 2.6.5 did not have Bluetooth drivers and needed to be patched. If you are running an older kernel, follow the directions on that page to apply the Bluez patch. If you are unfamiliar with the kernel configuration/compilation sequence, then check out the [[Kernel26Compilation]] tutorial before proceeding. === USB support === For the less-advanced user (like myself), it is safe to go through and answer `M` to everything that you can, and `Y` to everything that can not take `M`. You should not enable any of the "debug" options, I'm not 100% sure why, but I'm pretty sure that these options will give you verbose output that is only needed for kernel hackers. Below, you can see the options I have set in my .config file for my kernel. The options listed are just those that I thought pertained to getting my USB ports working and able to recognize my USB dongle. # # USB support # CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y CONFIG_USB=y # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y CONFIG_USB_BANDWIDTH=y # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_SUSPEND is not set # CONFIG_USB_OTG is not set # # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=m CONFIG_USB_EHCI_SPLIT_ISO=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_ISP116X_HCD=m CONFIG_USB_OHCI_HCD=y # CONFIG_USB_OHCI_BIG_ENDIAN is not set CONFIG_USB_OHCI_LITTLE_ENDIAN=y CONFIG_USB_UHCI_HCD=y CONFIG_USB_SL811_HCD=m === Bluetooth support === Again, it is safe to enable everything that says "Bluetooth" as a Module. Below are the options from my .config file that I thought might be relevant. # # FIR device drivers # CONFIG_USB_IRDA=m CONFIG_SIGMATEL_FIR=m CONFIG_NSC_FIR=m CONFIG_WINBOND_FIR=m CONFIG_TOSHIBA_FIR=m CONFIG_SMC_IRCC_FIR=m CONFIG_ALI_FIR=m CONFIG_VLSI_FIR=m CONFIG_VIA_FIR=m CONFIG_BT=m CONFIG_BT_L2CAP=m CONFIG_BT_SCO=m CONFIG_BT_RFCOMM=m CONFIG_BT_RFCOMM_TTY=y CONFIG_BT_BNEP=m CONFIG_BT_BNEP_MC_FILTER=y CONFIG_BT_BNEP_PROTO_FILTER=y CONFIG_BT_HIDP=m # # Bluetooth device drivers # CONFIG_BT_HCIUSB=m CONFIG_BT_HCIUSB_SCO=y CONFIG_BT_HCIUART=m CONFIG_BT_HCIUART_H4=y CONFIG_BT_HCIUART_BCSP=y CONFIG_BT_HCIBCM203X=m CONFIG_BT_HCIBPA10X=m CONFIG_BT_HCIBFUSB=m CONFIG_BT_HCIVHCI=m CONFIG_IEEE80211=m # CONFIG_IEEE80211_DEBUG is not set CONFIG_IEEE80211_CRYPT_WEP=m CONFIG_IEEE80211_CRYPT_CCMP=m CONFIG_IEEE80211_CRYPT_TKIP=m Now, just compile the kernel and reboot in to it. == Userland == At a bare minimum, you need to install bluez-libs and bluez-utils from http://www.bluez.org. I used the binary package provided by [http://www.develia.org/tarballs.php?p=networking develia.org], but that was before I knew about SlackBuild scripts. If you can not find a SlackBuild script and you do not want to create your own, you should use [[Checkinstall]] at the very least. At this time, you might as well install KDE-Bluetooth, also. I think I grabbed my binary package from [http://www.linuxpackages.net LinuxPackages], but that was also before I knew better. You can either grab the source code on it's own from [http://sourceforge.net/project/showfiles.php?group_id=89888 SoureForge] or as a part of [ftp://ftp.kde.org/pub/kde/snapshots/kdeextragear-multimedia.tar.bz2 KDE Extra Gear]. Again, use a Slackbuild script or [[Checkinstall]] to install these. For more information on SlackBuild scripts, you can see the following tutorials: [[SlackBuild Scripts]], [[Writing A SlackBuild_ Script]], [[Slack-desc]], [[Different Approach To Buildscripts]], [[Checkinstall]] == Configuration == Now, should have all of the tools you need to start connecting your computer to your bluetooth devices. First, check the status of the bluetooth dongle with hciconfig. # hciconfig hci0: Type: USB BD Address: 00:11:22:33:44:55 ACL MTU: 377:10 SCO MTU: 16:0 UP RUNNING PSCAN ISCAN RX bytes:385 acl:0 sco:0 events:18 errors:0 TX bytes:322 acl:0 sco:0 commands:18 errors:0 If yours says "UP RUNNING" then you are good to go. If not, you need to bring the interface up. # hciconfig hci0 up # hciconfig hci0 hci0: Type: USB BD Address: 00:11:22:33:44:55 ACL MTU: 377:10 SCO MTU: 16:0 UP RUNNING PSCAN ISCAN RX bytes:385 acl:0 sco:0 events:18 errors:0 TX bytes:322 acl:0 sco:0 commands:18 errors:0 Since the dongle works, it's time to configure the programs that will make the actual connections. Use your favorite text editor to edit the PIN in /etc/bluetooth/pin: # gvim /etc/bluetooth/pin The PIN needs to be all digits. I'm not sure if it needs to be exactly four (4) digits, but four (4) works well. Here is an example: PIN:1234 Then you need to edit /etc/bluetooth/hcid.conf # # HCI daemon configuration file. # # HCId options options { autoinit yes; #security auto; security user; pairing multi; pin_helper /opt/kde/lib/kdebluetooth/kbluepin; #pin_helper /usr/bin/bluepin; #pin_helper /usr/bin/pin; #dbus_pin_helper; } device { name "BlueZ %h (%d)"; class 0x3e0100; #pkt_type DH1,DM1,HV1; iscan enable; pscan enable; lm accept; lp rswitch,hold,sniff,park; # Authentication and Encryption (Security Mode 3) #auth enable; #encrypt enable; } === Choosing a PIN Helper === From all the other HOWTO's I read, I got the impression that the /usr/bin/bluepin script supplied with the Bluez-utils was junk. I found a nice, simple replacement script on this page http://orin.meinlschmidt.org/~znouza/doc/r51/. I will duplicate it here just for ease, but all rights and respect go to whoever made that page. Use your favorite text editor and create the new file /usr/bin/pin: #!/bin/bash # original script from http://orin.meinlschmidt.org/~znouza/doc/r51/ cat /etc/bluetooth/pin when you are done editing, save and close the file, then make it executable. Choose your permissions wisely. # chmod 710 /usr/bin/pin # ls -la /usr/bin/pin -rwx--x--- 1 root root 35 2006-04-09 19:19 /usr/bin/pin This /usr/bin/pin script will suffice for pretty much any way you want to connect to your phone. If you want to use kdebluetooth to connect to your phone, then use kbluepin. The example hcid.conf file above is already setup to use kbluepin. To use /usr/bin/pin, simply comment out the kbluepin line and remove the comment character(#) from the /usr/bin/pin line. === Making the Connection === Next, you need to start up the hcid and sdpd daemons. It is a good idea to add these to /etc/rc.d/rc.local so they start automatically with each reboot. At the command line type: # /usr/sbin/hcid # /usr/sbin/sdpd and add these lines to /etc/rc.d/rc.local /usr/sbin/hcid /usr/sbin/sdpd Then, you can set your phone to "discover" mode, allowing other devices to see it is present, and scan for it. On the Motorola V551 you go to Settings > Connection > Bluetooth Link > Setup > Find Me. # hcitool scan Scanning ... 00:12:34:56:78:9A Motorola Phone Using the hardware address from the scan above, you can find out a lot of information about your phone. # sdptool records 00:12:34:56:78:9A Service Name: Dial-up networking Gateway Service Description: Dial-up networking Gateway Service Provider: Cingular Service RecHandle: 0x10001 Service Class ID List: "Dialup Networking" (0x1103) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 1 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 code_ISO639: 0x6672 encoding: 0x6a base_offset: 0xd800 code_ISO639: 0x6573 encoding: 0x6a base_offset: 0xd803 code_ISO639: 0x7074 encoding: 0x6a base_offset: 0xd806 Profile Descriptor List: "Dialup Networking" (0x1103) Version: 0x0100 Service Name: Voice Gateway Service Description: Headset Audio Gateway Service Provider: Cingular Service RecHandle: 0x10003 Service Class ID List: "Headset Audio Gateway" (0x1112) "Generic Audio" (0x1203) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 3 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 code_ISO639: 0x6672 encoding: 0x6a base_offset: 0xd800 code_ISO639: 0x6573 encoding: 0x6a base_offset: 0xd803 code_ISO639: 0x7074 encoding: 0x6a base_offset: 0xd806 Profile Descriptor List: "Headset" (0x1108) Version: 0x0100 Service Name: Hands-Free voice gateway Service Description: Hands-Free voice gateway Service Provider: Cingular Service RecHandle: 0x10007 Service Class ID List: "Handfree Audio Gateway" (0x111f) "Generic Audio" (0x1203) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 7 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 code_ISO639: 0x6672 encoding: 0x6a base_offset: 0xd800 code_ISO639: 0x6573 encoding: 0x6a base_offset: 0xd803 code_ISO639: 0x7074 encoding: 0x6a base_offset: 0xd806 Profile Descriptor List: "Handsfree" (0x111e) Version: 0x0101 Service Name: OBEX Object Push Service Description: OBEX Object Push Service Provider: Cingular Service RecHandle: 0x10008 Service Class ID List: "OBEX Object Push" (0x1105) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 8 "OBEX" (0x0008) Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 code_ISO639: 0x6672 encoding: 0x6a base_offset: 0xd800 code_ISO639: 0x6573 encoding: 0x6a base_offset: 0xd803 code_ISO639: 0x7074 encoding: 0x6a base_offset: 0xd806 Profile Descriptor List: "OBEX Object Push" (0x1105) Version: 0x0100 Service Name: OBEX File Transfer Service Description: OBEX File Transfer Service Provider: Cingular Service RecHandle: 0x10009 Service Class ID List: "OBEX File Transfer" (0x1106) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 9 "OBEX" (0x0008) Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 code_ISO639: 0x6672 encoding: 0x6a base_offset: 0xd800 code_ISO639: 0x6573 encoding: 0x6a base_offset: 0xd803 code_ISO639: 0x7074 encoding: 0x6a base_offset: 0xd806 Profile Descriptor List: "OBEX File Transfer" (0x1106) Version: 0x0100 === Radio Frequency Communication (RFCOMM) === This is one way to use your phone as a modem. I believe that most Cingular and T-Mobile (GSM/GPRS) in the USA use channel 1 for the Dial-Up Gateway. One way to take advantage of this is to use rfcomm to connect to your phone. In order to do that, you will need to edit /etc/bluetooth/rfcomm.conf: # # RFCOMM configuration file. # rfcomm0 { # Automatically bind the device at startup bind yes; # Bluetooth address of the device device 00:12:34:56:78:9A; # RFCOMM channel for the connection channel 1; # Description of the connection comment "Motorola V551"; } Then connect to the phone by typing: # rfcomm connect 0 I won't go in to any more details because I don't use my phone as a modem. But, if you want to use your phone that way, there are plenty of resources out there to show you what to do. === KDE Bluetooth === I don't use KDE as my window manager/desktop, but kdebluetooth should automatically run when you start KDE. If you don't use KDE, like me, you can start up the taskbar daemon by typing "kbluetoothd" in a terminal. You can then use the KDE OBEX Push Client to transfer files to your phone. I haven't figured out how to get files off of my phone (like pictures), but I have seen [http://openobex.triq.net/obexftp/obexftp obexftp] and [http://openobex.triq.net/obexfs obexfs] which look promising. When I test those out, I will update this accordingly. == References == http://www.linuxquestions.org/hcl/showproduct.php?product=2879&cat=53 http://www.westmaster.com/zidek/p900/bluetooth/ http://www.bluez.org http://www.develia.org/tarballs.php?p=networking http://kde-bluetooth.sourceforge.net/ http://extragear.kde.org/ http://www.gentoo.org/doc/en/bluetooth-guide.xml 664ab6dbe9ea7bef43cd9a832c082f991e6071f3 Buzzedlightyears IPTables 0 71 92 2009-06-02T03:32:51Z Erik 1 Copy from old wikitext text/x-wiki #!/bin/sh IPTABLES=/usr/sbin/iptables #Allow incoming returning requests (Port Scans, Pings) $IPTABLES -A INPUT -j ACCEPT -m state --state ESTABLISHED -i eth0 -p icmp $IPTABLES -A INPUT -j ACCEPT -m state --state ESTABLISHED -i eth0 -p tcp $IPTABLES -A INPUT -j ACCEPT -m state --state ESTABLISHED -i eth0 -p udp #Allow incoming FTP Connections $IPTABLES -A INPUT -p tcp --dport 20 -j ACCEPT $IPTABLES -A INPUT -p tcp --dport 21 -j ACCEPT #Allow new incoming SSH connections #$IPTABLES -A INPUT -p tcp --dport 22 -m state --state new -j ACCEPT #Webserver #$IPTABLES -A INPUT -p tcp --dport 80 -j ACCEPT #Allow Pings $IPTABLES -A INPUT -p icmp -j ACCEPT #Allow All Local Host $IPTABLES -A INPUT -i lo -j ACCEPT #Drop all other and LOG to /var/log/firewall $IPTABLES -A INPUT -m limit --limit 3/s --limit-burst 5 -i eth0 -j LOG #$IPTABLES -A INPUT -i eth0 -j DROP $IPTABLES -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -m limit --limit 1/sec -j ACCEPT $IPTABLES -A FORWARD -p icmp -m icmp --icmp-type 8 -m limit --limit 1/sec -j ACCEPT $IPTABLES -A FORWARD -m state --state NEW,RELATED,ESTABLISHED,UNTRACKED -j DROP $IPTABLES -A INPUT -j DROP $IPTABLES -A INPUT -p igmp -j DROP [[Category:Security]] 47eb20f49e871b35b585ed906b8365d8121311c6 Changes 10.1 10.2 0 72 93 2009-06-02T03:33:26Z Erik 1 Copy from old wikitext text/x-wiki = Purpose = The purpose of this page is to document the new packages (Package Additions) and removed packages (Package Removals) during the release cycle from Slackware 10.1 to Slackware 10.2. = Package Additions From 10.1 to 10.2 = * xap/mozilla-firefox * xap/mozilla-thunderbird * n/cyrus-sasl * l/libgtkhtml * l/librsvg * l/libwpd * l/fribidi * d/subversion = Package Removals From 10.1 to 10.2 = * xap/netscape * l/orbit * gnome/* * xap/jre-symlink * xap/mozilla-plugins = Other Concerns = The following packages were moved from ./gnome when it was removed, so make sure they are still installed: * l/libidl * l/libmikmod 708e39be8c4d6d059796362cea55226257ada930 Changes 11.0 current 0 73 94 2009-06-02T03:34:26Z Erik 1 Copy from old, Well maybe not.. These DO need Categories however. wikitext text/x-wiki I've been doing this on SlackWiki previously, but this information is now available at Slackware.com - see the CHANGES_AND_HINTS.TXT file on any official Slackware mirror: For example, on OSUOSL: http://slackware.osuosl.org/slackware-current/CHANGES_AND_HINTS.TXT 280ec0280f26ff27cd28fe7b3aa47f5809e8a7c0 MySQL Configuration 0 74 95 2009-06-02T03:35:46Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] ''Have you just installed Slackware and now see a MySQL error at the login prompt?'' This is a VERY quick HowTo and should take maybe 30 seconds to complete at its slowest. The reason I decided to do a write-up is because of the sheer number of people asking how to fix it. == Option 1 == In a shell or xterm, type (you have to be logged in as superuser to use the mysql login): su mysql This logs you into the 'mysql' user account. Next, run: mysql_install_db This will create the needed databases and set their permissions properly. if your not logon as mysql user (root) Don't forget to chown folder /var/lib/mysql <pre> chown -R mysql.mysql /var/lib/mysql chmod 755 /etc/rc.d/rc.mysql </pre> You're now finished and should not see the typical MySQL errors at the login prompt. /etc/rc.d/rc.mysql start Now you should set a password for MySQL's root password: mysqladmin -u root password 'new-password-here' You can connect to your MySQL server with: mysql -u root -p For security reasons you should delete an empy user for localhost server <pre> mysql> SELECT user, host FROM user; mysql> DELETE FROM user WHERE host='localhost' AND user=''; </pre> *''This tutorial is currently linked at '' * ''http://www.unixfool.com/mysql-slack.shtml'' == Option 2 == 1. log in as <b>root</b> and install the mysql package 2. <code>killall -9 mysqld mysqld_safe</code> to kill any running MySQL processes. 3. copy one of the my-size.cnf files in /etc to my.cnf (picking an apporpriate size):<br> ::<code>cp /etc/my-medium.cnf /etc/my.cnf</code> 4. Install the MySQL database- ::'''Slackware 12.1''' (and later): ::::<code>mysql_install_db --user=mysql</code> ::'''Slackware 12.0''' (and before): ::::<code>su mysql</code> ::::<code>mysql_install_db</code> :::: <code>exit</code> (to get out of the mysql login and back to root). 5. <code>mysqld_safe --skip-grant-tables &</code> 6. <code>mysql -u root mysql</code> 7. <code>UPDATE user SET Password=PASSWORD('<i>new_password</i>') WHERE user='root';</code> 8. <code>FLUSH PRIVILEGES;</code> 9. <code>exit</code> 10. <code>killall -9 mysqld mysqld_safe</code> 11. <code>mysqld_safe &</code> to check the new password, (as root) type:<br> ::<code>mysqladmin -u root -p status</code><br> :::::...and enter the new password. == Option 3 == I'm starting from a [http://www.slackwiki.org/Minimal_System very basic install]. The only additional package needed is '''mysql''' in the '''AP''' group. <pre> # installpkg mysql-5.0.37-i486-1.tgz # su mysql $ mysql_install_db Installing all prepared tables Fill help tables ... $ exit # chmod 755 /etc/rc.d/rc.mysqld # /etc/rc.d/rc.mysqld start Starting mysqld daemon with databases from /var/lib/mysql </pre> MySQL is now installed, but there are no passwords defined yet. <pre> # mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.37 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. </pre> We can now set passwords from within the MySQL console. I know this can be achieved with '''mysqladmin''', but then, several ways lead to Rome. It's a simple matter of habit. <pre> mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | +--------------------+ 3 rows in set (0.01 sec) mysql> use mysql; Database changed mysql> select user, host, password from user where user = 'root'; +------+-----------+----------+ | user | host | password | +------+-----------+----------+ | root | localhost | | | root | slacktest | | +------+-----------+----------+ 2 rows in set (0.00 sec) </pre> As you can see, there are two 'root' users here (and none of them is our system's root user, don't forget): root@localhost... and root@slacktest. We have to set a password for both of them. In theory, these can be different, but why make things more complicated than they already are? ;o) <pre> mysql> set password for root@localhost = password('yatahongaga'); Query OK, 0 rows affected (0.00 sec) </pre> Let's repeat our query above to see the actual changes: <pre> mysql> select user, host, password from user where user = 'root'; +------+-----------+-------------------------------------------+ | user | host | password | +------+-----------+-------------------------------------------+ | root | localhost | *71CDE2704222D8D5A7608C92AF78C53F78DA5EBA | | root | slacktest | | +------+-----------+-------------------------------------------+ 2 rows in set (0.00 sec) </pre> You can see that root@localhost's password is displayed as a shadow password. Now let's set the password for root@slacktest (replace ''slacktest'' by your machine's hostname): <pre> mysql> set password for root@slacktest = password('yatahongaga'); Query OK, 0 rows affected (0.00 sec) </pre> What do we have now? <pre> mysql> select user, host, password from user where user = 'root'; +------+-----------+-------------------------------------------+ | user | host | password | +------+-----------+-------------------------------------------+ | root | localhost | *71CDE2704222D8D5A7608C92AF78C53F78DA5EBA | | root | slacktest | *71CDE2704222D8D5A7608C92AF78C53F78DA5EBA | +------+-----------+-------------------------------------------+ 2 rows in set (0.00 sec) </pre> Now we have some (very) basic security, we can leave the MySQL monitor. <pre> mysql> quit; Bye </pre> To connect to our MySQL database as MySQL's root user (who, remember, is ''not'' the system's root), we can do the following: <pre> # mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.0.37 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> </pre> If we have to do this often, we can create a /root/.my.cnf file and edit it as follows: <pre> [mysql] user = root password = yatahongaga </pre> Just to be on the safe side: <pre> # chmod 0600 /root/.my.cnf </pre> From now on, you can connect directly to the MySQL monitor, without having to type your password every time. 76136fd2d80d3001fe43e10cee3b3a752f9ae325 Converting From CRLF To LF 0 75 96 2009-06-02T03:37:08Z Erik 1 Copy from old, moved to Tips wikitext text/x-wiki =Explanation= There are several ways of converting the CRLF combination to LF and vice-versa. The simplest one under Slackware is to use the tools <code>fromdos</code> and <code>todos</code>, which receive the file from the standard input and write the result to the standard output. They are part of the <code>bin</code> package. =Examples= $ fromdos <input_file >output_file # Converts CRLF to LF $ todos <input_file >output_file # Converts LF to CRLF [[Category:Tips]] aa0875e66f3a86ace105ffb53e56e0b5af1ac930 Cron Jobs 0 76 97 2009-06-02T03:38:28Z Erik 1 Copy from old wikitext text/x-wiki Based on [[User:Sandman1|Sandman1]]'s tutorial. Well you are reading this tutorial because you need to schedule a certain task or a script on a certain day. First you need to know a few things about cron before we get started. One of those things is the table below: 1 = minute past the hour (0 through 59) 2 = hour (0 through 23) 3 = day of month (1 through 31) 4 = month of year (1 through 12) 5 = day of the week 0 = Sunday (This can also be 7) 1 = Monday 2 = Tuesday 3 = Wednesday 4 = Thursday 5 = Friday 6 = Saturday This table will be used later on in this tutorial. Now first part of editing a cron entry is typing in the following command: : <code>crontab -e</code> (I usually do this as root if the command needed to run requires root) Well this brings up the regular vi(elvis in slackware) screen. Most people don't use VI. There is a variable you can set to change the default cron editor. : <code>export VISUAL=pico</code> That will change the default editor for the session to pico. It's a little friendlier when it comes to editing for some people out there. There is also a GNU editor like pico called nano. Now we need to schedule a command for running. : <code>6 10 * * * /root/scripts/example</code> The example above here will run the command /root/scripts/example at 10:06 every day. The numbers above (on the table) symbolize the mark of where it belongs. So the 6 would be number 1 on the table and the 10 will be the hour. : <code>*/30 * * * * /root/scripts/example</code> The entry above will run the /root/scripts/example every 30 minutes of every day. Now save your entries and they will run when you tell them to. You also want to add 1> /dev/null on the end of your command so you send the output to /dev/null instead of roots email (this is default on slackware). Good luck! [[Category:Tutorials]] 964d9af1342aaa9167daceac5a8b71af7b4084c6 98 97 2009-06-02T03:38:57Z Erik 1 wikitext text/x-wiki Well you are reading this tutorial because you need to schedule a certain task or a script on a certain day. First you need to know a few things about cron before we get started. One of those things is the table below: 1 = minute past the hour (0 through 59) 2 = hour (0 through 23) 3 = day of month (1 through 31) 4 = month of year (1 through 12) 5 = day of the week 0 = Sunday (This can also be 7) 1 = Monday 2 = Tuesday 3 = Wednesday 4 = Thursday 5 = Friday 6 = Saturday This table will be used later on in this tutorial. Now first part of editing a cron entry is typing in the following command: : <code>crontab -e</code> (I usually do this as root if the command needed to run requires root) Well this brings up the regular vi(elvis in slackware) screen. Most people don't use VI. There is a variable you can set to change the default cron editor. : <code>export VISUAL=pico</code> That will change the default editor for the session to pico. It's a little friendlier when it comes to editing for some people out there. There is also a GNU editor like pico called nano. Now we need to schedule a command for running. : <code>6 10 * * * /root/scripts/example</code> The example above here will run the command /root/scripts/example at 10:06 every day. The numbers above (on the table) symbolize the mark of where it belongs. So the 6 would be number 1 on the table and the 10 will be the hour. : <code>*/30 * * * * /root/scripts/example</code> The entry above will run the /root/scripts/example every 30 minutes of every day. Now save your entries and they will run when you tell them to. You also want to add 1> /dev/null on the end of your command so you send the output to /dev/null instead of roots email (this is default on slackware). Good luck! [[Category:Tutorials]] e9425299551c7282495e0c56635cef849758f81b Customizing Bash Prompt 0 77 99 2009-06-02T03:39:24Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from "\033" or "ESC" commands into text commands for better reading, modifying, or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes. <pre> #.bashrc DULL=0 BRIGHT=1 FG_BLACK=30 FG_RED=31 FG_GREEN=32 FG_YELLOW=33 FG_BLUE=34 FG_VIOLET=35 FG_CYAN=36 FG_WHITE=37 FG_NULL=00 BG_BLACK=40 BG_RED=41 BG_GREEN=42 BG_YELLOW=43 BG_BLUE=44 BG_VIOLET=45 BG_CYAN=46 BG_WHITE=47 BG_NULL=00 ESC="\033" NORMAL="\[$ESC[m\]" RESET="\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]" BLACK="\[$ESC[${DULL};${FG_BLACK}m\]" RED="\[$ESC[${DULL};${FG_RED}m\]" GREEN="\[$ESC[${DULL};${FG_GREEN}m\]" YELLOW="\[$ESC[${DULL};${FG_YELLOW}m\]" BLUE="\[$ESC[${DULL};${FG_BLUE}m\]" VIOLET="\[$ESC[${DULL};${FG_VIOLET}m\]" CYAN="\[$ESC[${DULL};${FG_CYAN}m\]" WHITE="\[$ESC[${DULL};${FG_WHITE}m\]" BRIGHT_BLACK="\[$ESC[${BRIGHT};${FG_BLACK}m\]" BRIGHT_RED="\[$ESC[${BRIGHT};${FG_RED}m\]" BRIGHT_GREEN="\[$ESC[${BRIGHT};${FG_GREEN}m\]" BRIGHT_YELLOW="\[$ESC[${BRIGHT};${FG_YELLOW}m\]" BRIGHT_BLUE="\[$ESC[${BRIGHT};${FG_BLUE}m\]" BRIGHT_VIOLET="\[$ESC[${BRIGHT};${FG_VIOLET}m\]" BRIGHT_CYAN="\[$ESC[${BRIGHT};${FG_CYAN}m\]" BRIGHT_WHITE="\[$ESC[${BRIGHT};${BG_WHITE}m\]" REV_CYAN="\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]" REV_RED="\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]" PROMPT_COMMAND='export ERR=$?' </pre> If you happen to use Eterm or other advanced terminal its possible you need a ".bash_profile" here is one you can use if you don't have one, or just want some more in it. <pre> #.bash_profile source .bashrc if [ -f ~/.bashrc ]; then . ~/.bashrc fi #End Script </pre> Lets put it to work: I personally would comment out my currently working ##"PS1=" and put it below it in case you need to change it back for some reason. <pre> PS1="${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@yahoo.com${BRIGHT_YELLOW}]\n ${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} | ${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n ${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %> ${RESET}" </pre> Should look like this minus the colors: <pre> YOUR COMPANY NAME HERE[su_pyrow@yahoo.com] [13:57:23][590.478 MB|563.316 MiB][/media/cdrom] [503] %> </pre> Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past. Now... To get the sum of files in current working directory, I made two files which do the summing. "lsMB" and "lsMiB" which on my system are both located in ~/bin as executable. Here is lsMB: <pre> #!/bin/bash #lsMB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) suffix="kB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) suffix="MB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) suffix="GB" fi fi fi fi echo -n "$TotalSize $suffix" #End Script </pre> Finaly, this is the lsMiB executable file located in "~/bin" This has the modification for the conversion to KiB, MiB & GiB one could further the code to handle TiB easily by doing some research on it... Try wiki! <pre> #!/bin/bash #lsMiB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix2="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1024*.976 \nquit" | bc) suffix2="KiB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1048576*.954 \nquit" | bc) suffix2="MiB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1073741824*.931 \nquit" | bc) suffix2="GiB" fi fi fi fi echo -n "$TotalSize2 $suffix2" #End Script </pre> One would be able to see the changes if 1) Restart the Terminal or 2) type:<pre>$ source ~/.bashrc</pre> and you will instantly see the changes. Try it out, and see if it grows on you! 843af697c807be5f0b951ebda67d819501a6d04f DHCP Hostname Entry in DNS 0 78 100 2009-06-03T02:04:13Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] I have a Windows server that runs both the DNS server and DHCP server for my network. When I added a Slackware box, I needed the Windows server to update DNS when the slack box obtained a DHCP lease. Windows was already setup to do this, but the default slack install didn't send the correct information for the Windows DHCP server to setup the DNS A record. Here is what I did to get slack to work: First, slack uses ''dhcpcd'' for a dhcp client. Looking through the options and testing revealed that all I needed to do was send a: <pre>-h [hostname]</pre> with the dhcpcd command. In order to get slack to do this, I had to edit: <pre>/etc/rc.d/rc.inet1.conf</pre> and set: <pre>DHCP_HOSTNAME[0]=[hostname]</pre> then: <pre>/etc/rc.d/rc.inet1 restart</pre> and everything worked! ee1a613175808459ce24acdbcf57e86fc4557dac PPPoE 0 79 101 2009-06-03T02:04:54Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] == Setting Up PPPoE == As root, run '''pppoe-setup'''. Answer the questions. '''GOTCHA:''' on the last question, answer ''1 STAND ALONE''. == Connecting With PPPoE == As root, run '''pppoe-start'''. You should now be connected. PROBLEM: It reports connected but, I can't get to the internet. FIX: It's probably screwed up your routing table. ::route del default ::route ppp0 <---make note of the Destination IP ::route add default gw ''destination ip'' Your connection should be working now. a275add12a59e1e33e2a180e0b8bf36ee7f4ef1c PPPoE - Multiple Connections 0 80 102 2009-06-03T02:05:29Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] == How to setup multiple PPPoE connections == 1) Install multiple network devices (ethernet cards). : (you can probably do this with one and use eth0:0, eth0:1, etcetera but, it's a bad idea). 2) Make note of each device's MAC address. 3) Make sure the correct interface is assigned to the correct network card. : Edit <code>/etc/udev/rules.d/70-persistent-net.rules</code> file so that the MAC address of each card matches the interface you want. You must do this so the correct pppoe connection connects to the correct modem. 4) Run <code>pppoe-setup</code> and set up the connection for connection #1. 5) <code>mv /etc/ppp/pppoe.conf /etc/pppoe-connection1.conf</code> 6) Run <code>pppoe-setup</code> and set up the connection for connection #2. 7) <code>mv /etc/ppp/pppoe.conf /etc/pppoe-connection2.conf</code> 8) Repeat steps 6 & 7 for each of the remaining DSL connections. -setup is complete- == How to start the connections == 1) Run <code>pppoe-start /etc/ppp/pppoe-connection1.conf</code> 2) Run <code>pppoe-start /etc/ppp/pppoe-connection2.conf</code> 3) Repeat step 2 for all remaining connections. At this point, you should have ppp0, ppp1 and etc. ppp connections. Your routing table ''may'' be trashed at this point, you can clear it and use one as the default route by: :: route del default :: route add default gw ''ip_address_of_one_of_your_pppoe_connections'' NOTE: The above will set ONE connection as the default, you must adjust your routing to suit your needs from this point on. == How to setup routing and/or weighted routing == Too be added... 0576f2bc742939ee6e6bc7ee9ccaa506733fe130 DVB 0 81 103 2009-06-03T02:05:59Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps Eventually, my SlackBuild will be hosted here http://slackbuilds.rlworkman.net/CONTRIB/linuxtv-dvb-apps/ (thanks to robw810). == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ 32696d3ab7ed73d7fdcadd5931d45019269522af Dadexter iptables 0 82 104 2009-06-03T02:07:25Z Erik 1 Copy from old wikitext text/x-wiki * Script is based on another one I got here * allows connections to port 443 for web services * allows connections to port 8080 for ssh access * allows connections to port 8000 and 2323 for misc services (usually off anyway) #!/bin/sh # This is a very basic LAN NAT script, allowing only SSH to the firewall from # the external interface, allowing all outbound LAN traffic, and allowing only # established/related traffic back into the LAN. # # eth1 = external NIC (ISP) # eth0 = internal NIC (LAN) # # allows connections to port 443 for web services # allows connections to port 8080 for ssh access # allows connections to port 2323 and 8000 for internal forwarding, and shoutcast ipt=/usr/sbin/iptables extip=66.130.x.x # replace with your EXTERNAL IP - eth1 lan=192.168.100.0/25 # your LAN CIDR range - eth0 # start firewall start_firewall() { echo "Enabling IP forwarding." echo 1 > /proc/sys/net/ipv4/ip_forward echo "Enabling iptables firewall." # default policies $ipt -P INPUT DROP $ipt -P FORWARD DROP # NAT $ipt -t nat -A POSTROUTING -o eth1 -j SNAT --to-source $extip # INPUT chain $ipt -A INPUT -i lo -j ACCEPT $ipt -A INPUT -i eth0 -s $lan -j ACCEPT $ipt -A INPUT -i eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT $ipt -A INPUT -p tcp --destination-port 8080 -j ACCEPT $ipt -A INPUT -p tcp --destination-port 443 -j ACCEPT $ipt -A INPUT -p tcp --destination-port 8000 -j ACCEPT $ipt -A INPUT -p tcp --destination-port 2323 -j ACCEPT # FORWARD chain $ipt -A FORWARD -i eth0 -s $lan -j ACCEPT $ipt -A FORWARD -i eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT } # stop firewall stop_firewall() { $ipt -P INPUT DROP $ipt -P OUTPUT DROP $ipt -P FORWARD DROP # allow internal traffic $ipt -A INPUT -i eth0 -j ACCEPT $ipt -A OUTPUT -o eth0 -j ACCEPT } # flushing, removing and zeroing tables reset_firewall() { chains=`cat /proc/net/ip_tables_names` for i in $chains; do $debug $ipt -t $i -F $debug $ipt -t $i -X $debug $ipt -t $i -Z done } case "$1" in start|restart|reload) reset_firewall start_firewall ;; stop) reset_firewall stop_firewall ;; *) echo "Usage: $0 {start|stop|restart|reload}"; exit 1 ;; esac [[Category:Security]] b31f9e4925b7f6353e11aeeebbfbf114bbe381b0 Directory Permissions Defaults 0 83 105 2009-06-03T02:10:00Z Erik 1 Copy from old, had no category, placed in Tutorials wikitext text/x-wiki [[Category:Tutorials]] = Problem: Sharing Directories = My wife and I keep our pictures of our kids under a shared directory called /home/shared. We download them with Digikam and sometimes edit them to send out to relatives. The problem was this: if I download the pictures off the camera, then Megan can't edit them or read them. We also had problems with shared files (e.g., our accounting spreadsheets) that I would create and she would modify, or vice versa. = Solution: ACL = To set, in effect, default file-creation masks, you can use [[ACL]] (access control lists). The user commands you need to set up [[ACL]] are getfacl(1) and setfacl(1). == Edit /etc/fstab == Edit the fourth field of the fstab entry of the partition you want to use ACL on. In this case, it was /dev/sda6 on /home: <pre> /dev/sda6 /home ext3 defaults,acl 1 1 </pre> adding "acl" to the list of permissions. Without doing this, you'll get <pre> setfacl: /mnt/backup Operation not supported </pre> Then remount the partition: since I was doing this on /home, I rebooted (mount -a did not work). == ACL Commands == getfacl(1) shows you the current ACL status of a file: <pre> /media/multimedia: Zshell> getfacl /home getfacl: Removing leading '/' from absolute path names # file: home # owner: root # group: root user::rwx group::r-x other::r-x </pre> Once the partitions are properly set up (that was the easy part), enter the setfacl(1) commands: <pre> sudo setfacl --recursive -dm g:users:rwx /home/shared </pre> --recursive was important so that each directory beneath /home/shared inherits the default mask. Now getfacl(1) gives me this: <pre> /media/multimedia: Zshell> getfacl /home/shared getfacl: Removing leading '/' from absolute path names # file: home/shared # owner: joel # group: users user::rwx group::rwx other::r-x default:user::rwx default:group::rwx default:group:users:rwx default:mask::rwx default:other::r-x </pre> And when creating a file: <pre> /media/multimedia: Zshell> cd /home/shared /home/shared: Zshell> touch my_self /home/shared: Zshell> ls -l my_self -rw-rw-r--+ 1 joel users 0 2008-04-06 14:36 my_self </pre> The desired outcome! Note: this did what I wanted, but it's just a beginning. Read the setfacl(1) and getfacl(1) man pages for the full story. = Official Package Data = <pre> PACKAGE NAME: acl-2.2.39_1-i486-2 COMPRESSED PACKAGE SIZE: 139 K UNCOMPRESSED PACKAGE SIZE: 350 K PACKAGE LOCATION: ./acl-2.2.39_1-i486-2.tgz PACKAGE DESCRIPTION: acl: acl (tools for using POSIX Access Control Lists) acl: acl: This package contains a set of tools and libraries for manipulating acl: POSIX Access Control Lists. POSIX Access Control Lists (defined in acl: POSIX 1003.1e draft standard 17) are used to define more fine-grained acl: discretionary access rights for files and directories. acl: acl: acl: acl: acl: </pre> in slackware/a[http://packages.slackware.it/search.php?v=12.0&t=1&q=acl] [[User:Trashbird1240|Trashbird1240]] 14:49, 6 April 2008 (EDT) afd8f8e143128e4fb28df169b200853700888389 Disable dmix for alsa 0 84 106 2009-06-03T02:10:47Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] Open your favourite text editor and create the file "~/.asoundrc" for custom user configuration or "/etc/asound.conf" for global system configuration and write the following in it:<br> <font face=courier>pcm.!default {<br> type plug<br> slave.pcm hw<br> }<br> </font> taken from: http://www.pegasos.org/index.php?name=FAQ&id_cat=5 8074646868237faeee3fccd80f3ddfa701233d6b Editors 0 85 107 2009-06-03T02:12:08Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Information]] One late night, it came to our attention (a bunch of slackers) that Slackware comes with a long list of text editors... After discussing it, a list was made... so. The following editors are included in Slackware: Command Line/Text * Joe * Vi (elvis) * Vim * Emacs * Jove * Jed * Pico (from pine) * Ed * Nano X11 * Kwrite * xedit (xorg) * gvim * Emacs * kedit * kate. Other editors that may be useful to Slackware users, such as programmers, are: Command Line * RHIDE (with SETedit for dual-display debugging) * SETedit X11 * RHIDE * SETedit * TexMacs (such as for mathematics writing.) * Xemacs If you know more that we have forgotten, please add them to the list. 7d1383d88a2883d3174d6cd77b1504e1b3742e4d EeePC 0 86 108 2009-06-03T02:12:44Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Hardware]] == Kernel == === 2.6.24.4 === This is the default kernel that comes with Xandros. It is patched to work with a few things. It's ugly and some of the modules don't work correctly when the kernel is transplanted into Slackware. The source is available from Asus. === 2.6.26.3 === As of writing, 2.6.26.3 is the latest stable kernel. The acpi functionality has been merged into the kernel. but the ethernet and wireless require patching / external code to work === 2.6.27rc5 === As of writing this is still in testing. The ethernet patch is now in-kernel, not requiring a patch. The wireless still requires external code. == 701 == ===Wireless=== The 701 uses the Atheros chipset. Use madwifi-hal-0.10.5.6. *http://madwifi.org/ticket/1192 *http://wiki.eeeuser.com/ubuntu?s=madwifi#wireless_internet_using_native_madwifi_drivers == 901 == ===Network=== The network card uses the atl1e module, which requires a patch for the 2.6.26.3 kernel. as of writing it is slated to be merged into the 2.6.27 kernel. http://chopp.homelinux.com/EeePC/0001-atl1e-Atheros-L1E-Gigabit-Ethernet-driver.patch <pre>cd /usr/src/linux-2.6.26.3/ patch -p1 < 0001-atl1e-Atheros-L1E-Gigabit-Ethernet-driver.patch</pre> The following instructions have been tested (and work) on a fresh installation of Slackware 12.1 on the EEE 901 running the generic kernel 2.26.24-5-smp: http://www.patch-village.com/2008/oct/23/installing-ubuntu-804-server-asus-p5q/ The kernel source code was installed from the second installation disk (in directory 'k'). ===Wireless=== The wireless uses the rt2860sta module, an open source module from ralink.com. The source code can be downloaded from here: http://www.ralinktech.com/ralink/Home/Support/Linux.html Compiling is straightforward in Slackware 12.1 (see instructions below). It does however require patching to work with the 2.6.26.3 kernel. http://chopp.homelinux.com/EeePC/rt2860sta-patched.tar.gz There are some patches which need to be applied to this source both to get it to work, and to modify the code to the 2.6.26 way of using network devices, namely dev_nd->net is now dev_net(dev). The source above has the patches applied and the code fixed to work with 2.6.26.3 It should work with WPA, but I haven't tested it. <pre> tar -xzf rt2860sta-patched.tar.gz cd 2008_0708_RT2860_Linux_STA_v1.7.0.0 make make install modprobe rt2860sta </pre> ===Sound=== Front Mic does not work out of the box with Slackware 12.1. Compiling Alsa driver 1.0.18 solves this problem. However, doing this seems to remove the USB sound driver (copying back snd-usb-audio.ko resolves it). Be warned that other sound modules are missing after this procedure. This is a useful link: http://wiki.debian.org/DebianEeePC/HowTo/Sound ===ACPI=== The acpi extras require the eeepc_laptop module, kernel config is CONFIG_EEEPC_LAPTOP. In make menuconfig, it is under device drivers -> misc devices, near the bottom. You need to configure /etc/acpi to make acpi act on events. By default nothing happens. /etc/acpi/events/hotkey <pre> event=hotkey ATKD .* action=/etc/acpi/hotkey.sh %e </pre> /etc/acpi/hotkey.sh <pre> #!/bin/sh case $3 in #Fn+F2 #Wireless/Bluetooth button #Fn+F7 00000013) #Mute button amixer set Master toggle ;; #Fn+F8 00000014) #Volume Down amixer set Master 10%- ;; #Fn+F9 00000015) #Volume Up amixer set Master 10%+ ;; esac </pre> ===Camera=== The camera uses uvcvideo module: http://www.slackware.com/~alien/slackbuilds/linux-uvc/ {| border="1" |- ! module ! used by |- | uvcvideo | |- | compat_ioctl32 | uvcvideo |- | videodev | uvcvideo |- | v4l1_compat | uvcvideo,videodev |- | usbcore | uvcvideo |} ===X=== Slack 12.1 uses the same xorg version as the xandros that comes with the 901 linux eee currently. ====xorg.conf==== For the 901, for basic functionality, no configuration of X is required (no xorg.conf). The intel video driver from the 'x' directory of disc 1 is needed. This xorg.conf is a copy of the xandros one with a few changes. It allows you to scroll using two fingers and dragging, and middle click by tapping with two fingers. [[EeePC/xorg.conf|xorg.conf]] ====Touchpad==== http://rlworkman.net/pkgs/ Grab the xf86-input-synaptics package. Need synaptics for the touchpad. ====Battery Display==== gkrellm is a nice little program that can be made to show battery life. It comes with slack 12.1 ====Wireless Configuration==== Wicd works nicely to make connecting to wireless networks easy. http://rlworkman.net/pkgs/ Grab the Wicd package. ==Files== *http://chopp.homelinux.com/EeePC/ *http://www.ksandro.info/ *http://www.ksandro.info/rt2860sta-patched.tar.gz *http://www.ksandro.info/0001-atl1e-Atheros-L1E-Gigabit-Ethernet-driver.patch *http://rlworkman.net/pkgs/ 245c2d44ff96d26b654512186ca1e2e1092364f1 EeePC/xorg.conf 0 87 109 2009-06-03T02:13:20Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Hardware]] [[EeePC|Back to Main Article]] <pre>Section "ServerLayout" Identifier "Slackware" Screen 0 "Screen1" InputDevice "keyboard" InputDevice "mouse" InputDevice "synaptics" # make sure to have the synaptics driver EndSection Section "Files" ModulePath "/usr/lib/xorg/modules" # these paths had to be fixed FontPath "/usr/share/fonts/misc" FontPath "/usr/share/fonts/Type1" FontPath "/usr/share/fonts/75dpi" FontPath "/usr/X11R6/lib/X11/fonts/Type1" EndSection Section "Module" Load "glx" Load "dri" Load "extmod" Load "synaptics" EndSection Section "ServerFlags" Option "AllowMouseOpenFail" Option "BlankTime" "1" # power saving, but kinda annoying, minutes. Option "DontVTSwitch" "false" # turn this off. Option "AIGLX" "false" EndSection Section "InputDevice" Identifier "keyboard" Driver "kbd" Option "CoreKeyboard" Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "us" Option "XkbVariant" "basic" EndSection Section "InputDevice" Identifier "mouse" Driver "mouse" Option "Device" "/dev/input/mice" Option "Protocol" "IMPS/2" Option "Emulate3Buttons" "yes" Option "ZAxisMapping" "4 5" Option "CorePointer" EndSection Section "InputDevice" Identifier "synaptics" Driver "synaptics" Option "Device" "/dev/psaux" Option "Protocol" "auto-dev" Option "LeftEdge" "1400" Option "RightEdge" "5900" Option "TopEdge" "1400" Option "BottomEdge" "4500" Option "PalmDetect" "0" Option "SHMConfig" "true" Option "SendCoreEvents" "yes" Option "HorizScrollDelta" "0" Option "VertScrollDelta" "155" Option "RBCornerButton" "0" Option "RTCornerButton" "0" Option "TapButton2" "0" Option "MinSpeed" "0.095" Option "MaxSpeed" "0.38" Option "VertTwoFingerScroll" "1" Option "VertEdgeScroll" "0" Option "HorizEdgeScroll" "0" EndSection Section "Monitor" Identifier "Monitor1" VendorName "ASUS" ModelName "eeePC P701" Modeline "800x480" 29.58 800 816 896 992 480 481 484 497 -HSync +Vsync # 60 Hz Modeline "1024x600" 48.96 1024 1064 1168 1312 600 601 604 622 -HSync +Vsync EndSection Section "Monitor" Identifier "TV" VendorName "ASUS" ModelName "eeePC P701" Option "Ignore" "true" EndSection Section "Device" Identifier "Device1" Driver "intel" VendorName "Intel Corporation" BoardName "Mobile 915GM/GMS/910GML Express Graphics Controller" BusID "PCI:0:2:0" Option "Monitor-VGA" "Monitor1" Option "Monitor-LVDS" "Monitor1" Option "Monitor-TV" "TV" Option "XAANoOffScreenPixmaps" "true" Option "AccelMethod" "XAA" EndSection Section "Screen" Identifier "Screen1" Device "Device1" DefaultDepth 16 SubSection "Display" Depth 8 Virtual 1024 768 EndSubSection SubSection "Display" Depth 15 Virtual 1024 768 EndSubSection SubSection "Display" Depth 16 Virtual 1024 768 EndSubSection SubSection "Display" Depth 24 Virtual 1024 768 EndSubSection EndSection Section "DRI" Mode 0666 EndSection Section "Extensions" Option "Composite" "Disable" EndSection </pre> dfecaa24092417cfe759a8aebece58ad4e3120a2 Emacs from CVS 0 88 110 2009-06-03T02:14:17Z Erik 1 Copy from old, had no category, placed in Tutorials wikitext text/x-wiki [[Category:Tutorials]] The development version of GNU Emacs offers several features over the official Slackware release (Emacs 22), for example Unicode support, multi-TTY, multiple X client frames and font rendering with Xft. [http://www.unc.edu/~adamsonj/software/emacs-cvs/ Here] is a SlackBuild that creates a package for Emacs 23. Note that the SlackBuild pulls from the CVS server on Savannah, so you do not need to pull the repository first. If you do, put it in the indicated local cvs directory so that the script will do a "cvs update". == Installation == You should <code> removepkg emacs </code> before installing the Emacs 23 package, which will be installed as package emacs-cvs. == Automatic Updates == I put the following script into /etc/cron.weekly and each Monday I get a newly-updated version of Emacs. I always keep the old package in case there is any problem with the new version. <pre> #! /bin/sh cd <full path to parent directory> tar zxvf emacs-cvs.tar.gz cd emacs-cvs ./emacs-cvs.SlackBuild |mail <yourself> </pre> == Problems? Comments? == I have had no problems with the current script. If you notice anything, please let me know.[[User:Trashbird1240|Trashbird1240]] 98f5435d0c3e90bf9d7a47f3a93f3b7c902dbbef Embedded perl 0 89 111 2009-06-03T02:15:10Z Erik 1 Copy from old, had no category, placed in Tutorials wikitext text/x-wiki [[Category:Tutorials]] ==How to Install Embedded Perl on Slackware 12.0== First, I installed mod_perl: [[mod_perl|Installing Mod_Perl]]. Then, I used [[cpan|cpan]] to install Embed Perl. I ran "perl -MCPAN -e shell" and at the prompt typed "install Embperl". This prompted me for some dependencies, I had to do "install LWP" and then try "install Embperl" again. Eventually it worked. I added these lines to the section for my virtual host in /etc/httpd/extra/httpd-vhost.conf (they could also be added in the main httpd.conf to apply to the whole server if desired): <pre> # PerlModule HTML::Embperl PerlModule Embperl <Directory /home/rgr/public_html/embperl> SetHandler perl-script Options ExecCGI # PerlHandler HTML::Embperl::handler PerlHandler Embperl::handler </Directory> </pre> Note the parts that are commented out -- whose were in an online example I found, but they resulted in the "500 internal server error" message. I could see the detailed message in the apache error log, and perl was looking for HTML/Embperl.pm when it should have been looking for Embperl.pm. After that I set up an example file (see the tutorial below) and successfully tested it. ==Tutorial on Use== http://perl.apache.org/embperl/pod/intro/Intro.-page-3-.htm Here is an example file I created in /home/rgr/public_html/embperl/test.pl (it actually should be in which ever directory you set to be handled via embperl in the httpd.conf file or httpd-vhosts.conf file): <pre> <html> <body> First line.<br> [- $a = 5 -] Some stuff! [- $b = 6 if ($a == 5) -]<br> Now for some output:<br> [+ $a +] [+ $array[$b] +] [+ "A is $a" +] </body> <html> </pre> And here is the output of http://localhost/embperl/test.html: <pre> First line. Some stuff! Now for some output: 5 A is 5 </pre> Note that the code with [- -] is just run. The code with [+ +] is run, and the results are used to replace that part of the html file. You can also use [! !] which is for code that should only be run once, such as function definitions. The perldoc documentation or the apache page linked above has more complete explanations and tutorials: http://perl.apache.org/embperl/ fb19c4a907c951405b51f550da04d2a12d062393 Faster Console 0 90 112 2009-06-03T02:15:49Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] With the Frame Buffer enabled, scrolling large amounts of text (e.g. dmesg) and other drawing can be very slow. Give these options to your kernel at boot and scrolling will be much faster. video=vesafb:ywrap,mtrr:3 Brief explanation of options: vesafb use the VESA Frame Buffer ywrap enable display panning using the VESA protected mode interface mtrr:3 use Memory Type Range Registers in write-combining mode You may have to use <code>ypan</code> or another number with <code>mtrr:</code> depending on your video hardware. See <code>/usr/src/linux/Documentation/fb/vesafb.txt</code> for more details. If it works well, this can be added to your lilo.conf in the append line: append = "video=vesafb:ywrap,mtrr:3" Run <code>lilo -v</code> and reboot. 10bc668ea0e092ef5429bb5d141121ca3685914e Firewall-rworkman 0 91 113 2009-06-03T02:16:25Z Erik 1 Copy from old wikitext text/x-wiki Rather than having to update this at two different places, my firewall scripts are housed here: http://rlworkman.net/conf/firewall/ [[Category:Security]] 019f16de9e293319ff623610a772c88dcfbf8bb4 Forced Fsck 0 92 114 2009-06-03T02:16:58Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] A Forced Fsck (forced file check) happens on boot up due to one of three things: :1) The system was not cleanly shutdown previously (you just turned off the power) and the file system was not cleanly un-mounted. :2) The maximum number of sucessive re-boots (re-mounts ([[Mount Count|mount count]])) between fsck checks has been reached (you have reached [[Maximum Mount Count]]). :3) A period of time has passed between fscks that exceed the filesystem's last checked criteria. ==Manually Forcing a Forced Fsck== To force a check on the next boot, simply create the file '/etc/forcefsck' and reboot: :<code>touch /etc/forcefsck</code> ==Bypassing A Forced Fsck== <b>METHOD 1: Increase the Mount Count/Last-checked time span-</b><br> The only way to bypass a Forced Fsck is to boot the machine from another boot medium (e.g. a boot CD) and use <code>tune2fs</code> to increase the Maximum Mount Count or the Last-checked Time span. To increase the Maximum Mount Count: <code>tune2fs -c <i>new_mount_count filesystem</i></code><br> EXAMPLE: <code>tune2fs -c 50 /dev/hda1</code> - This will cause a fsck after 50 re-mounts. To increase the Last-checked Time span: <code>tune2fs -i <i>new_time_span filesystem</i></code><br> EXAMPLE: <code>tune2fs -i 3m /dev/hda1</code> - This will cause a fsck after 3 months. <b>GOTCHA:</b> If you are running a RAID Array, make sure you load a kernel image that supports RAID when booting! See the RAID Array tips. <b>METHOD 2: Manually run fsck-</b><br> See <i>Bypassing A Hung Forced Fsck</i> instructions below. ==Bypassing A Hung Forced Fsck== Sometimes, a forced fsck will occur and may not complete. It may hang or just keep starting over. To (down and dirty) fix this, boot the machine from a bootable disk (3.5" or CD), DO NOT mount the unchecked filesystem and manually run fsck. You may have to run any one of three modes to complete the check:<br> ::<code>fsck -f <i>filesystem</i></code> - Force checking even if the file system seems clean.<br> ::<code>fsck -c <i>filesystem</i></code> - This option causes e2fsck to run the badblocks program to find any blocks which are bad on the filesystem, and then marks them as bad by adding them to the bad block inode. If this option is specified twice, then the bad block scan will be done using a non-destructive read-write test.<br> ::<code>fsck -p <i>filesystem</i></code> - Automatically repair ("preen") the file system without any questions.<br> :::<b>NOTE: <code><i>filesystem</i></code> = boot partition (e.g. <code>/dev/hda1</code>)</b> <b>GOTCHA:</b> If you are running a RAID Array, make sure you load a kernel image that supports RAID when booting! See the [[RAID_Array_%28Hardware%29|RAID Array tips]]. After a successful completion of anyone of the above, your filesystem's [[Mount Count|mount count]] will be reset to zero and you should be able to boot normally again. de9986cd2e124d181576f2c796b8df71435d0bfb Fred87's Script 0 93 115 2009-06-03T02:17:36Z Erik 1 Copy from old wikitext text/x-wiki * Allows incoming SSH * Detects and blocks syn floods * Detects spoofed local packets * Makes sure "NEW" tcp packets have the syn flag set * Drops packets with both syn and fin set * Generated with [http://www.fredemmott.co.uk/index.php?page=kitg KIptablesGenerator] #!/bin/sh # Generated by KIptablesGenerator # Copyright (c) 2004 Fred Emmott <mail@fredemmott.co.uk> # See KIptablesGenerator for license information. # You probably want to make this a startup script, eg on # slackware you probably want to save this as /etc/rc.d/rc.firewall IPTABLES=/usr/sbin/iptables $IPTABLES -P INPUT DROP $IPTABLES -A INPUT -i lo -j ACCEPT $IPTABLES -A INPUT ! -i lo -d 127.0.0.0/8 -j DROP $IPTABLES -N Flood-Scan $IPTABLES -A INPUT -p tcp -m tcp --syn -j Flood-Scan $IPTABLES -A Flood-Scan -m limit --limit 1/s --limit-burst 20 -j RETURN $IPTABLES -A Flood-Scan -j LOG --log-prefix "OVER-LIMIT: " $IPTABLES -A Flood-Scan -j DROP $IPTABLES -A INPUT -p tcp -m tcp ! --syn -m conntrack --ctstate NEW -j DROP $IPTABLES -A INPUT -p tcp -m tcp --tcp-flags SYN,FIN SYN,FIN -j DROP $IPTABLES -A INPUT -p tcp -m conntrack --ctstate ESTABLISHED -j ACCEPT $IPTABLES -A INPUT -p tcp -m conntrack --ctstate RELATED -j ACCEPT $IPTABLES -A INPUT -p udp -m conntrack --ctstate ESTABLISHED -j ACCEPT $IPTABLES -A INPUT -p icmp -m icmp --icmp-type parameter-problem -j ACCEPT $IPTABLES -A INPUT -p icmp -m icmp --icmp-type time-exceeded -j ACCEPT $IPTABLES -A INPUT -p icmp -m icmp --icmp-type echo-reply -j ACCEPT $IPTABLES -A INPUT -p icmp -m icmp --icmp-type destination-unreachable -j ACCEPT $IPTABLES -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT [[Category:Security]] b2c891127d0c6c2f3d85d5c993e0b9fdbbe222b6 Fstab 0 94 116 2009-06-03T02:18:32Z Erik 1 Copy from old wikitext text/x-wiki The /etc/fstab file tells the system how and where to mount filesystems by default. ==Syntax== The syntax of the file is this: <table cellspacing="10"> <tr> <td align="right"><b>MAN PAGE-ese:</b></td> <td align="center">FS_SPEC</td> <td align="center">FS_FILE</td> <td align="center">FS_VFSTYPE</td> <td align="center">FS_MNTOPS</td> <td align="center">FS_FREQ</td> <td align="center">FS_PASSNO</td> </tr><tr> <td align="right"><b>IN ENGLISH:</b></td> <td align="center">DEVICE</td> <td align="center">MOUNT_POINT</td> <td align="center">FILESYSTEM</td> <td align="center">OPTIONS</td> <td align="center">DUMP</td> <td align="center">FSCK_ORDER</td> </tr><tr> <td align="right"><b>EXAMPLE:</b></td> <td align="center">/dev/hdb1</td> <td align="center">/mnt/windows</td> <td align="center">vfat</td> <td align="center">default</td> <td align="center">0</td> <td align="center">1</td> </tr> </table> ==Field Descriptions== FS_SPEC (DEVICE) - the device or remote filesystem to be mounted. FS_FILE (MOUNT_POINT) - the mount point for the filesystem. <i>NOTE: For swap partitions, this field should be specified as `none'. If the name of the mount point contains spaces these can be escaped as `\040'.</i> FS_VFSTYPE (FILESYSTEM)- the type of the filesystem. As of Slackware 10.2, the FILE_SYSTEM choices are: :auto, adfs, affs, autofs, coda, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, nfs4, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf, ufs, umsdos, vfat, xfs, xiafs and possibly others. <i>NOTE: for swap-able and portable devices (e.g. memory sticks and CDROMs), <code>auto</code> is the best choice because it allows the computer to determine the correct filesystem.</i> FS_MNTOPS (OPTION) - the (comma seperated) mount options. See the MOUNT command's MAN PAGE for the options because there are MANY! The most commonly used options are:<br> :noauto - do not mount this device/partition automatically on boot-up. :ro - mount this device/partition READ-ONLY (e.g. CDROM). :owner - Only allow the owner to mount and un-mount this device/partition. :users - Allow any user to mount or unmount this device/partition. FS_FREQ (DUMP) - used for these filesystems by the dump command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped. For the most part, this should be "0" (zero). FS_PASSNO (FSCK_ORDER) - used by the fsck program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked. ==Benefits Of fstab Entries== Once you have a device in the fstab, mounting become VERY easy. Instead of having to: :<code>mount -t iso9660 /dev/hdb1 /mnt/cdrom</code> every time you want to use the CDROM, you can just type: :<code>mount /mnt/cdrom</code> IF you have the entry in your fstab. ==Useful Examples== CDROM:<br> :/dev/hdc1 /mnt/cdrom auto noauto,ro,owner,users 0 0 [[USB Memory Stick]]:<br> :/dev/sda1 /mnt/memstick auto noauto,owner,users 0 0<br> (make sure to <code>mkdir /mnt/memstick</code> after changing your /etc/fstab). Note: For changing who can access the filesystem on NON-Native linux formats see [[Permissions and Umasks]] and [[Windows Partitions]] [[Category:Tutorials]] 868aa5c1f3711b7a2d7f50761ab86e19ad68d641 GNOME 0 95 117 2009-06-03T02:19:24Z Erik 1 Copy from old wikitext text/x-wiki As this questions seems to be popping up again and again. The question being either: “''Why was Gnome removed from Slackware''” or “''Why doesn’t Slackware ship with Gnome''”. In the development cycle of Slackware-10.1 -> 10.2 Patrick Announced that Slackware would drop support for GNOME: = Announcement in the ChangeLog = On Sat Mar 26 23:04:41 PST 2005 Patrick Volkerding announced that Gnome gets removed: <tt>gnome/*: Removed from -current, and turned over to community support and distribution. I'm not going to rehash all the reasons behind this, but it's been under consideration for more than four years. There are already good projects in place to provide Slackware GNOME for those who want it, and these are more complete than what Slackware has shipped in the past. So, if you're looking for GNOME for Slackware -current, I would recommend looking at these two projects for well-built packages that follow a policy of minimal interference with the base Slackware system: http://gware.sf.net http://gsb.sf.net There is also Dropline, of course, which is quite popular. However, due to their policy of adding PAM and replacing large system packages (like the entire X11 system) with their own versions, I can’t give quite the same sort of nod to Dropline. Nevertheless, it remains another choice, and it’s your system, so I will also mention their project: http://www.dropline.net/gnome/ Please do not incorrectly interpret any of this as a slight against GNOME itself, which (although it does usually need to be fixed and polished beyond the way it ships from upstream more so than, say, KDE or XFce) is a decent desktop choice. So are a lot of others, but Slackware does not need to ship every choice. GNOME is and always has been a moving target (even the “stable” releases usually aren’t quite ready yet) that really does demand a team to keep up on all the changes (many of which are not always well documented). I fully expect that this move will improve the quality of both Slackware itself, and the quality (and quantity) of the GNOME options available for it. Folks, this is how open source is supposed to work. Enjoy.</tt> = Links = * http://www.gware.org/ -- GWARE (GNOME for Slackware) * http://gsb.freerock.org/ -- Freerock GNOME * http://www.droplinegnome.org/ -- Dropline GNOME * http://www.slacky.eu/ -- Gnome Slacky [[Category:Information]] 02ed9f08a1a5bc526aba39b10543c02e27a83591 Google Earth 0 96 118 2009-06-03T02:19:53Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] You can download Google Earth from http://earth.google.com/ You have to set the .bin file that you download to be executatable, and then run it, to install. <pre> chmod a+x GoogleEarthLinux.bin ./GoogleEarthLinux.bin </pre> By default it installs itself in /opt/google-earth/ . It offers to make a link from /usr/local/bin/googleearth to the right executable, I recommend allowing it to do this. Once it is done, to run it you just type "googleearth" in an xterm (X must be running). You can make the appropriate desktop icon or menu item depending on what window manager you are using. If the splash screen shows up for some amount of time, and then all of X (the entire graphical environment) crashes (if you have graphical login set up, it will give you a login screen again, otherwise you will go back to the console), some people have found this to be solved by downloading the libGL.so library. It should be put in the /opt/google-earth/ directory: (as root) <pre> cd /opt/google-earth/ wget http://librarian.launchpad.net/7037027/libGL.so.1 -O libGL.so.1 </pre> Some places on the web also refer to downloading it from http://www.ground-impact.com/libGL.so.1.2 . Here are links to a few discussions of the issue: http://www.linuxquestions.org/questions/slackware-14/google-earth-crashes-x-598569/?s=3ff14bc2cdec277267c5547b7dee84d9 http://forum.mandriva.com/viewtopic.php?t=71691&highlight=googleearth '''Performance Issue with Google Earth:''' <pre> if google earth is slow in slackware Linux, check whether DRI is enabled or not, if Direct Rendering is enabled then disable "Atmosphere" effect from View menu -> [x] Atmosphere for smoother functioning of the graphics in Google Earth window. </pre> b2ad930a00343e4563141b3261b42c4da4d45198 HAL in Slackware 12 0 97 119 2009-06-03T02:20:24Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] == Preface == This page was started to provide documentation and examples of the "new" HAL feature in Slackware 12. Before reading or implementing anything that you've read here, be sure to first read the following two paragraphs from [http://ftp.slackware.pl/pub/slackware/slackware-12.0/CHANGES_AND_HINTS.TXT the CHANGES_AND_HINTS text file]: The /dev/cdrom line in /etc/fstab is commented out by default, as it interferes with HAL. HAL defaults to on, so if you do not wish to use it, you will need to chmod -x /etc/rc.d/rc.hald and uncomment the /dev/cdrom line in /etc/fstab Note that HAL will honor settings in /etc/fstab if a device is present there, so you could technically have removable devices defined in /etc/fstab, but if the fstab settings do not allow normal users to mount them (with the "user" or "users" option), then HAL/dbus will not allow them to be mounted either. Also note that you will need to run "/etc/rc.d/rc.messagebus reload" after adding any users to plugdev, power, or video groups so that it re-reads the /etc/group file. == Enabling HAL for Your Users == First, add your users to the secondary groups: cdrom, plugdev, power Second, restart the HAL and messagebus services with the following two commands (as root): # /etc/rc.d/rc.messagebus restart # /etc/rc.d/rc.hald restart === About the /etc/fstab Entry === The line that typically mounts the CDROM drive in /etc/fstab is commented out by default. Also, only root can give the command to mount /dev/cdrom by default. The original line looks something like #/dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0 CHANGES_AND_HINTS suggests that you leave this line commented out in order for HAL to work. It may be necessary, however, to uncomment this line for certain programs which expect the cdrom device to be mounted to a specific place (games running via WINE come to mind). To allow this, change the cdrom entry in /etc/fstab to look like /dev/cdrom /mnt/cdrom auto noauto,user,owner,ro 0 0 == Using HAL == Your users should now be able to take advantage of [[Autofs]], KDE's Storage Media settings and [http://ivman.sourceforge.net/ programs like ivman] in order to mount removable media to the appropriate places. == Other Reading == See rworkman's thread on LinuxQuestions.org about 12.0 and HAL: http://www.linuxquestions.org/questions/slackware-14/12.0-and-hal-read-this-566862/ 034d1b1458b67363ff12721141868cbdc0302438 International Language Support 0 98 120 2009-06-03T02:23:26Z Erik 1 Copy from old, had no category, placed in Tutorials wikitext text/x-wiki [[Category:Tutorials]] '''This tutorial is not finished yet. Come back at a later time.''' Last updated: --[[User:Apeitheo|apeitheo]] 21:58, 10 Apr 2005 (BST) The aim of this tutorial is to allow you to use Linux with the language of your choice. I often need to type German characters (ßüö䀄“) on my keyboard, but it took some time to copy the chosen character and paste it where needed. I could have changed the layout, but I prefer to use the English layout due to programming a lot, and I'm just generally more adapted to this layout. With the use of "compose" and "dead" keys you will be able to type foreign characters of your choice, while still preserving your current layout. The only requirement, which provides definitions for foreign characters, is the glibc-i18n package, which can be obtained from [http://slackware.com/pb/searchpkg.php?v=current&string=glibc-i18n The Slackware package browser] or on your Slackware cd in slackware/l. == Keyboard Support == This section will provide you with information on how to setup your keyboard for foreign characters. If you wish to use it both outside & inside of X, follow both sections. === X11 === ''-- Speak about xmodmap/xkb, rewrite parts reflecting "compose" keys'' In order to type foreign characters without modifying your current keyboard layout, we will make use of xmodmap and a "dead key" of your choice. To start, you should locate the corresponding xmodmap.* file that is for your current keyboard layout. Since I use an English keyboard, mine was found at "/usr/share/xmodmap/xmodmap.us". Once you've located it, copy it to your user directory and make it hidden, like this: cp /usr/share/xmodmap/xmodmap.us-101 /home/joe/.xmodmap Open this file up for editing with your favorite text editor: gedit /home/joe/.xmodmap Now is a good time to take a look at the long list of "keysyms" which are supported by xmodmap. This can be found [http://wiki.linuxquestions.org/wiki/List_of_Keysyms_Recognised_by_Xmodmap here]. Locate the special characters that you are missing on your current keyboard layout. In the .xmodmap file find the keys which you want to be used with the "dead keys." For example, so that I can use the 'u' key for ü and Ü, I would change: keycode 30 = u U udiaeresis Udiaeresis The first 'u' is what is usually pressed. The second character, "U" is what is typed when I push the shift key and the 'u'. The same thing goes for the second part, 'udiaeresis' is typed when I push my right alt key and 'u'. As you can expect, 'Udiaeresis' is typed when I push the right alt key, the shift key, and the 'u'. It's that simple. You may need to assign a key to be the Mode_switch key (which in my case, was the right alt key), or change it if you don't like the current one. This can be done by changing the specified keycode line to point to "Mode_switch," such as this: (Before Editing) keycode 113 = Alt_R Meta_R (After Editing) keycode 113 = Mode_switch '''NOTE:''' If you use Gnome or KDE, this next step will not be necessarily unless you manually load them up through ~/.xinitrc. Once you've finished modifying your custom .xmodmap file, save it, and then open up your ~/.xinitrc file and add the line: exec xmodmap ~/.xmodmap as well as appending an ampersand (&) to the line previous to the last. For example: (Before Editing) #!/bin/bash exec enlightenment (After Editing) #!/bin/bash exec enlightenment & exec xmodmap ~/.xmodmap Save this file, type startx, and you're ready to go. '''NOT FINISHED YET - elaborate on .xmodmap file (Mode_Switch), xev, and xmodmap -pke''' === Console === === Additional Notes === == Application Support == This section will provide you with information on how to setup your computer to display applications in the language of your choosing. ''-- Speak about LANG settings'' === Additional Notes === == Conclusion == == External Links == [http://slackware.com/pb/ The Slackware package browser] [http://wiki.linuxquestions.org/wiki/List_of_Keysyms_Recognised_by_Xmodmap List of Keysyms] cd4d59d25607f7896e6a8d06bd5bc051f3e34de7 Irssi 0 99 121 2009-06-03T02:25:03Z Erik 1 Copy from old wikitext text/x-wiki Irssi Quick tutorial - Based on http://www.irssi.org/documentation == Installation == If you did a full install of Slackware, you may already have irssi, and you can skip to the next section of this guide. However, if typing 'irssi' at the command line returns nothing, you will need to install the program. Irssi is located in the 'n' folder of Slackware mirrors - and once you have downloaded it, you only need to run 'installpkg irssi[tab]' as root to install it. == Usage == To start the client, "irssi" is entered from either the console or any xterm. Connecting is done by the /server command /server irc.freenode.net , would connect to the freenode server /connect does the same thing but is used to open a new connection in a new window /disconnect is to leave that server. If the nick or handle is already chosen, just issue /nick somenewhandle , this will change to a new name. Names that are registered on NickServ must be identified by /msg NickServ IDENTIFY <password> Or you can select window #2 by the alt key and number 2 and enter IDENTIFY <password>. N.B alt key 0-10 is for windows 0-10, Alt-q through Alt-o is for 11-19. To join a channel, issue /j #slackware, that will bring you to the wonderful people on Slackware's official channel on the Freenode IRC network. Ctrl-X is used to switch between network connections, if you are connected to multiple servers, e.g. irc.freenode.net and another server. /query and /q are used to initiate private convesationa with people. eg. /query linus would open a private chat window with the user 'linus'. /set in the first window, shows all the settings, where by help is found by issuing the command. e.g. /help dcc would bring up information on the dcc commmand. Window management /WINDOW NEW , splits the screen in half this new window will have a number assigned to it, to access just type alt 4, if the window is number 4. /WINDOW CLOSE , this closes the current window. /WINDOW BALANCE , this i am constantly using to keep the windows the same size. /window name hilight, whenever someone types your name in the channel, the line is highlighted in another colour. Don't forget to run the /save command, so that next time irssi loads, all the windows will be there. SET term_force_colors ON, is a very useful command, as certain xterms need this to display the colours correctly. [[Category:Tutorials]] 7742a32bc1484f8443e43b7be996352c254b67b2 Kernel26Compilation 0 100 122 2009-06-03T02:25:55Z Erik 1 Copy from old wikitext text/x-wiki How to build a 2.6.x Kernel on Slackware Note: Maybe this replaces the 2.6 part of the kernel compile tutorial already here. ==Warning!== If you work on your kernel and do something wrong you may destroy your system in a way you have to reinstall it. All actions on your own risk! Noone assures that all actions described here are 100% right and work in any case. We are not responsible for damages caused by following this tutorial! ==Prerequisites== * Get the kernel sources you want from ftp://ftp.de.kernel.org or from a mirror (http://www.kernel.org/mirrors/). * Make sure you are able to boot your Slackware original kernel after kernel update (You have to install 2.6.13 from "testing" to do this-slack12 uses 2.6.21.5 by default, no need to install it) image = /boot/vmlinuz-generic-2.6.13<br> root = /dev/ #Your root partition. Get this from another kernel entry or from original /etc/lilo.conf label = Backup read-only Now run "lilo" once as root * If you want to play safe you may now reboot and try if the kernel boots without errors. * Uncompress your kernel sources below /usr/src * The symlink /usr/src/linux has to point to the directory of the new kernel. For example: /usr/src/linux -> /usr/src/linux-2.6.14.4 ==Configure the kernel== * Change to the kernel directory. cd /usr/src/linux * Configure your kernel: ** From scratch, then you may choose from make config (You get prompted for all possible options) make menuconfig (You get a nice menu where you may navigate with cursor keys. Needs curses-5.x) make xconfig (You may configure in X, of course needs working X installation) make gconfig make qtconfig :* From old configuration: Copy the config file of the old kernel to ./.config. If you want to come from orignal Slackware kernel, then: cp /boot/config .config After that "make oldconfig" to configure new features (you may acceppt all questions with "Enter" to use the default values) and use "make menuconfig" (or any other of the above list) to change things if you like. Important! Be sure to compile the alsa modules (or you won't have sound). You have also to do this if you used "make oldconfig" (for example using "make menuconfig") as the original kernel is compiled without alsa. ==Compile and install kernel== * The real compiling can start: make (Now, depending on your computer, you may go drinking some coffee, watch a movie or go on your balcony to smoke one ;-) ) If this finished without errors (we assume this) then your kernel and your kernel modules should be compiled. * Remove symlinks. If you still run your original slackware kernel, then "vmlinuz" and "System.map" are Symlinks to the kernel files. To get sure that we don't override this files, we delete the symlinks rm /boot/vmlinuz /boot/System.map * Install the kernel Install the kernel modules with:<br> make modules_install and the kernel with:<br> make install * If all steps have been done successful you may now use your new (self-made) kernel. ==Troubleshooting== * Help, the kernel doesn't work! Choose your backup kernel on lilo, check your kernel configuration and recompile. * Choose your backup kernel sounds easy, but... Now you know why you should keep a running kernel before you install a new one. Either your system is as usable as you are able to check the kernel configuration or you may boot from your slackware setup CD, mount your root partition to /mnt, chroot /mnt and recompile your kernel from there or install slackware packages of a running kernel. [http://www.slackforum.de/wiki/Kernel26Kompilieren german version] [[Category:Tutorials]] fc9ff4331ec429c4ad75c9cd1fb6a859a3a7abb6 Kernel Checklist 0 101 123 2009-06-03T02:26:27Z Erik 1 Copy from old wikitext text/x-wiki # [&radic;] Make sure the filesystem type of your root partition is compiled into the kernel. To check what your root filesystem is type "mount". # [&radic;] Check that your networking card is compiled as a module or compiled into the kernel. # [&radic;] If you are using NVIDIA video card make sure you compile the AGP as a module # [&radic;] The sound card is important for listening to music; module it, or compile it in. # [&radic;] Another important thing that people miss out is the IDE chipset. This is important becuase you want to enable DMA on drives, and other important speed inhancements. # [&radic;] If you are going to use a camera that requires usb mass storage compile in SCSI Generic and USB-Mass storage. # [&radic;] Compile the sysfs feature in the kernel as that is an important for /sys. It is important for the 2.6 kernel. # [&radic;] If you must have framebuffer make sure you compile it in with the appropriate things. If you get a black screen set lilo.conf to vga = normal, then mess with it later. Also for nvidia users the rivafb is broken on many cards, so do not compile it in becuase it effects the nvidia driver for X. So use the vesafb instead. # [&radic;] Another usefull tool that i use is the .config in /proc (A must have I think) # [&radic;] ATA/ATAPI settings are also usefull for people, might want to make sure your kernel has that. # [&radic;] SATA/SCSI Make SURE YOU COMPILE it into the kernel and make sure you actually compile it in. If you have a SATA or SCSI hardware. # [&radic;] Iptables modules if you are going to use iptables or make a firewall. I use modules:) # [&radic;] I always recommend that in ALSA you compile or module OSS Emulation API # [&radic;] APM or ACPI is always somthing you might want to enable. This is not a feature needed by the kernel but, some people might need its features. Just a reminder that the root filesystem (SCSI/SATA/etc) should be compiled into the kernel for obvious reasons. [[Category:Tips]] 4238ea2c7a9cbaff0c3adc59223853f234ee987b Kernel Compilation 0 102 124 2009-06-03T02:26:59Z Erik 1 Copy from old wikitext text/x-wiki Kernel Compilation guide for the 2.4 series.<br> Written by Thomas York - straterra@hotmail.com [[User:Straterra|Straterra]]<br> Read over the ENTIRE GUIDE at least twice (2x) before trying to compile your first kernel.<br> Added 2.6 information -- [[User:erik|erik]]<br> ==Prequisites== # Download the latest kernel from kernel.org. # It is HIGHLY recommended that you create a folder just for your new kernel. It can be in your user directory or anywhere else you want it to be. # You must have the GCC Compiler # You must have NCurses. # You must have access as root. # You must have have a bootloader (grub and lilo, the two most popular, are described below) # You must be familiar with a text file editor (vi, nano, etc) ==Getting Ready to Compile== # Extract the tar.bz2 file by using <code>tar jxvf linux-VERSION.tar.bz2</code> # Change into the newly created directory by using the <code>cd</code> command. # Run the command <code>make menuconfig</code>. This command will open up a semi-graphical menu where you can pick what you want in your kernel. See [[Kernel Checklist]]. #* NOTE : If you already have a config file, you should instead run the command <code>make oldconfig</code>. Make sure that you have placed the config file in <code>/usr/src/linux-VERSION</code>, and that the config file has been named <code>.config</code>. #* NOTE : When you navigate through the menus, you use the keys 'M' to make the selection a module and 'Y' to compile it into the kernel. The difference is that if you compile it as a module, you can always unload it later. This is ideal if something causes conflicts. For this reason, I prefer to compile as much as possible as modules. It's your kernel, do what YOU want to do. :) Bear in mind that some options MUST be compiled into the kernel statically (not modular) - for example, support for your root filesystem type must be static. #* NOTE : If you are unsure what a certain selection does, you can press the '?' while having the confusing item selected. It is recommended you learn what EVERYTHING does your first time around, whether you will compile it in your not. This allows you to not have to press the '?' key every time..you already learned them! :) # When you exit out of menuconfig, it will ask if you want to save. Say YES. This is critical. If you do not answer YES you will have to go back and do it all over again. ==Compiling v2.4== # <code>make dep</code> - This will organize all module dependencies. # <code>make bzImage</code> - This option may take a while, depending on how much content you decided to compile directly into the kernel, processor speed, ram, etc.. # <code>make modules</code> - Again, if you selected for alot of content to be compiled as modules this may take some time. # <code>su</code> - Enter your root password. This allows you to have the access to install the compiled kernel. # <code>make modules_install</code> - This command will install all of your modules. # <code>cp System.map /boot/System.map</code> - To replace the old System.map file. # <code>cp arch/i386/boot/bzImage /boot/bzImage-VERSION</code> - Replacing the variable VERSION with the version of the 2.4 kernel you compiled. ==Compiling v2.6== # <code>make</code> - This will build the kernel (vmlinux), compressed kernel (bzImage), and modules. # <code>su</code> - Enter your root password. # <code>make modules_install</code> - Installs the modules. # <code>cp System.map /boot/System.map-VERSON</code> - Replace VERSION with the kernel version number. # <code>cp arch/i386/boot/bzImage /boot/bzImage-VERSION</code> - Replace VERSION with the kernel version number. ==Lilo Configuration== # Edit /etc/lilo.conf. This will open the lilo configuration file for editing. # Input the following lines at the end of the file, again replacing the variable VERSION with the kernel version, the variable y for the hard drive device location and the variable z for the Linux partition. #: image = /boot/bzImage-VERSION #: root = /dev/hdyz #: label = Linux-VERSION #: read-only # Save the file and exit. # Run the command <code>lilo -v</code>. This command (re)installed the lilo boot loader using the modified /etc/lilo.conf file. # Hit <tt>Alt-Ctrl-Del</tt>, or run the command <code>reboot</code> or <code>init 6</code>. This will switch to runlevel 6 and restart your computer. ==Grub Configuration== # Edit /boot/grub/grub.conf OR /boot/grub/menu.lst # Replace the variable VERSION with the kernel version # Using grub a device such as /dev/hda1 is not used. Instead a zero indexed system is used (based on all drives grub can see at boot). /dev/hda1 would become (hd0,0), and /dev/hdb3 would become (hd1,2). Note that the root= line is passed to the kernel itself, and is not used by grub - therefore put in the devfs device (/dev/hda1 perhaps) # First the relevant lines #: title Linux-VERSION #: root (hdx,x) #: kernel /boot/bzImage-VERSION root=/dev/hdxx # Now a complete one for reference #: default 0 #: timeout 30 #: splashimage=(hdx,x)/grub/splash.xpm.gz #: title Linux-VERSION #: root (hdx,x) #: kernel /boot/bzImage-VERSION root=/dev/hdxx # Hit <tt>Alt-Ctrl-Del</tt>, or run the command <code>reboot</code> or <code>init 6</code>. This will switch to runlevel 6 and restart your computer. ==Post-Compilation== # When the machine reboots, choose the option 'Linux-2.4.x' or 'Linux-2.6.x', where x is your kernel minor version. # Recompile any software that created a kernel module for your old kernel (nvidia, etc). ==NOTES== # If the compilation failed at ANY step, you must run the command 'make clean' while in the directory of the extracted kernel source. # If you try to boot up your new kernel, and you get errors, you can boot your old kernel using the old option in lilo. # Make sure to compile in support for your filesystem! # Historically, the kernel source is extracted to /usr/src/ and a <code>linux</code> symlink is made. So you have the following: #* /usr/src/linux-2.6.16 #* /usr/src/linux -> linux-2.6.16 #: This allows you to symlink /boot/System.map and /boot/config right to /usr/src/linux/System.map and /usr/src/linux/.config - this way they are always pointing to the correct file and never have to be replaced. However, neither of these are necessary; a System.map-VERSION file in /boot will work just fine without a symlink to System.map (see http://www.dirac.org/linux/system.map/ for more information). #: Due to stupid users and old distributions replacing (symlinking) /usr/include, the merits of building a kernel in /usr/src are now under fire. It is (and always has been) safe to build a kernel as root in /usr/src, but you should NEVER replace /usr/include. [[Category:Tutorials]] 12f0a5f4c3c946892ee1a49a13532066d134403e LCD Monitor Configuration In X.Org 0 26 125 34 2009-06-03T02:29:28Z Erik 1 Added to Hardware Category wikitext text/x-wiki [[Category:Tutorials]] [[Category:Hardware]] ==DISCLAIMER== If there is nothing wrong with your display, please don't go mucking about with your ~/.fonts.conf file (at least, back it up first). If you do have problems with your LCD display, then this is a good bet to try. If you have any success or failure, please do report this back, and changes, if any, that you made to your .fonts.conf file and any other file (perhaps /etc/X11/xorg.conf?) Comments, corrections and thoughts are always welcome. This may well also work with XFree86 > 4.3, since they use the same font configuration files as this. Older versions have a non-XML font configuration setup (I don't know when the switch over was made though), and will not be covered. WARNING - Parts of this article are out of date, and there are a few changes required for modular X. These will be added soon. ==Introduction== LCD/TFTs display fonts very differently to a CRT. Unfortunately with Slackware's default settings on X.Org/FreeType, the results for fonts on an LCD are painful to say the least. This is further compounded by the fact that all the 'helpful' HOWTOs out there are badly out of date, referring to ancient versions of the now defunct XFree86. Whilst there are a few sites out there with bits of information, putting into a workable solution is quite a challenge. This exists, therefore, to show the naysayers that they're wrong, and that you _can_ enjoy nice looking fonts in Slackware. (Please note, this is _not_ an exhaustive HOWTO, and it is _not_ a HOWTO about .fonts.conf (please see the Bibliography for a site detailing the tags available in .fonts.conf). This HOWTO is only about configuring an LCD monitor and what works best for one) ==What You'll Need== *Your favourite text editor *X.Org (or a later edition of XFree86 >4.3. This has only been tested on Slackware 10.1 and above). *An LCD/TFT monitor (most of this may also apply to an LCD monitor on a laptop). ==Physical Setup== ===The Monitor=== (I humbly apologise in advance for this section, but better safe than sorry.) (Standalone Monitors only) Plug up your LCD. Where possible, use the DVI-D (i.e. The digital, not analogue VGA) connector, if both your monitor and your graphics card have one. If not, use an analogue VGA cable and connection (where possible, avoid using DVI-D to VGA adaptors.) Then, ensure the viewing angle of your LCD is correct. Play around with it until you are happy. ==Settings== ===X=== As far as I know, there is no special configuration of X needed for an LCD monitor. Just create the necessary entry for a monitor in /etc/X11/xorg.conf with the correct refresh rates as normal and enjoy (the monitor itself may even be able to give you these, mine does.) I won't cover this in any more detail, as it's pretty standard and covered better elsewhere. X will also detect the correct sub-pixel alignment, so you don't need to deal with that either. ===Fonts and FreeType=== The real problems begins with font rendering in X. If you are switching over on your machine from a CRT to an LCD, what is facing you at first sight will be unpleasant to say the least. Of course, this isn't down to X, as in all modern X servers from X.Org (and the later ones from XFree86) FreeType is responsible for all font rendering (any other modules loaded in your /etc/X11/xorg.conf for font rendering are anachronisms: they are no longer used, and X tells you they don't exist). Something I've seen a lot is that “fonts looked better on 9.0” or earlier versions of Slackware, and there is good reason for this. With the changeover to FreeType2, due to various Apple patents in the US and Japan, the 'bytecode interpreter' is now disabled by default. (Plus, IMHO, the Bitstream fonts that ship with Slackware aren't very good). With a CRT, this isn't much of a problem, but it does make a lot of difference on an LCD and is nearly illegible. There are two ways round this, either: #Make alterations to .fonts.conf to try and make the Bitstream fonts render better on an LCD. #Rebuild FreeType with the bytecode interpreter, and use the properly hinted MS fonts (Arial, et al) to get cleaner, crisper looking fonts on the LCD. Both of these solutions give different results (though I prefer the second). ====Common==== For both alternatives, there are some common settings that must be made. If you're using KDE or GNOME, you'll find they have tools for doing some of what I'm going to describe. However, I would recommend _against_ using them. I've found their attempts at generating and editing a .fonts.conf file to be dubious to say the least. It is much more preferable to edit the file yourself, and since it is now done through a well defined XML file, this isn't as bad as it once appeared to be (judging from some of those ancient HOWTOs). Crank up your editor and load ~/.fonts.conf (or /etc/fonts/local.conf) If it exists: Just add these sections to it, inside the <fontconfig></fontconfig> tags. If it doesn't exist: Use my ~/.fonts.conf skeleton from Appendix A as your .fonts.conf and edit as necessary. 1. Ensure that the sub pixel order is _not_ specified. X knows the sub pixel order already, and if this is enabled as well, FreeType produces some very strange results. However, if you do still have problems, consider replacing 'none' with 'rgb' (the standard for LCD monitors), 'bgr' (unusual), 'vrgb' (vertical rgb, if you have a monitor that has been rotated by 90 degrees[1]), 'vgbr' (as vrgb, but very rare). <match target="font" > <edit mode="assign" name="rgba" > <const>none</const> </edit> </match> 2. Enable sub-pixel hinting This is what really starts to make the difference. Visit http://grc.com/ctwhat.htm for the technical explanation of why we're doing all of this. <match target="font" > <edit mode="assign" name="hinting" > <bool>true</bool> </edit> </match> 3. Set the hinting amount Usually, this should be full. Valid options are 'none', 'hintslight', 'hintmedium' and 'hintfull' which should be fairly self explanatory if you've read the article at the link above. <match target="font" > <edit mode="assign" name="hintstyle" > <const>hintfull</const> </edit> </match> ====Option 1) The 'Easy' Way==== Essentially, we're going to enable FreeType's non-patented autohinter and antialiasing to improve the appeareance of the default Bitstream fonts. Add the following to ~/.fonts.conf. #Enable anti aliasing This makes the fonts start to look nice, but some of the shapes will be distorted, so we need the FreeType autohinter (see next part). <match target="font" > <edit mode="assign" name="antialias" > <bool>true</bool> </edit> </match> Fluxbox only: You may need to enable anti alias separately on Fluxbox before it takes notice of the changes: fluxbox menu --> Configure --> AntiAlias #Enable the FreeType autohinter The autohinter is not turned on automatically, so we have to do this manually. Please note that OpenOffice.org binaries from the OOo website are built against the bytecode interpreter, so even if you have compiled FreeType with the bytecode interpreter and override it with the autohinter, OOo will still use the bytecode interpreter. <match target="pattern" > <edit mode="assign" name="autohint" > <bool>true</bool> </edit> </match> ====Option 2) The 'Hard' Way==== This is my ([[User:Cathectic]]) preferred solution, as I believe it gives better results. This involves rebuilding FreeType with the bytecode interpreter enabled, and then using the properly hinted fonts 'Core Fonts For the Web' from Microsoft. For this, you will need to: #Get a copy of FreeType that has the bytecode interpreter enabled. ##Download the Freetype sources from your local Slackware mirror (slackware-$VERSION/source/l/freetype) ##In freetype.SlackBuild, uncomment the line to apply the bytecode enabling patch ##Run the SlackBuild ##Replace your old freetype package with the new one you've just built. '''32bit X Applications (Slamd64 only)''': To enable 32bit applications in Slamd64 to use the bytecode interpreter, you need to install a 32bit bytecode enabled FreeType. #Download and install the 'Microsoft Core Fonts for the Web' (if you have a Windows installation, you could import the fonts from that instead. This tutorial assumes you do not) from either: ##LinuxPackages (install CabExtract, then CoreFonts) ##Or, From the 'Core Fonts for the Web' at http://prdownloads.sourceforge.net/corefonts/ ###Get all the *.exe files ###Get the CabExtract source RPM, rpm2tgz it, untar, build and install ###Use CabExtract to extract the *.ttf's from the *.exe's you downloaded, and then move the fonts to /usr/X11/lib/X11/fonts/TTF (/usr/share/fonts/TTF for X.Org 7 or newer). Now add the following to ~/.fonts.conf 1. Disable the autohinter This isn't strictly necessary – the autohinter is not enabled by default, and if it's not enabled, the bytecode interpreter is used by default. However, it's better safe than sorry. <!-- Disable autohinter - using bytecode interpreter instead --> <match target="pattern" > <edit mode="assign" name="autohint" > <bool>false</bool> </edit> </match> 2. Set the MS fonts as defaults <!-- Set sans-serif as Arial --> <match target="pattern" name="family" > <test name="family" qual="any" > <string>sans-serif</string> </test> <edit mode="assign" name="family" > <string>Arial</string> </edit> </match> <!-- Set monospace as Courier New --> <match target="pattern" name="family" > <test name="family" qual="any" > <string>monospace</string> </test> <edit mode="assign" name="family" > <string>Courier New</string> </edit> </match> <!-- Set serif to Times New Roman --> <match target="pattern" name="family" > <test name="family" qual="any" > <string>serif</string> </test> <edit mode="assign" name="family" > <string>Times New Roman</string> </edit> </match> (I would also recommend using the template in Appendix B to replace all the Bitstream and Luxi fonts with the MS equivalents (or set them to use serif, sans-serif, monospace instead)). ====Testing==== Just load any application up (I'd recommend a Gtk one, KDE will probably need a restart for the changes to take affect everywhere), and the changes should be immediately obvious (I used Mozilla Firefox, by opening and closing it after every tweak of ~/.fonts.conf, I was able to see the changes immediately). ====Apply System Wide==== You can apply these changes system wide, using /etc/fonts/local.conf If it exists, just append the sections you added above to it. If it doesn't, use your .fonts.conf as /etc/fonts/local.conf, and edit it as necessary (The order of precedence for processing is /etc/fonts/fonts.conf (automatically generated, don't edit it), /etc/fonts/local.conf then ~/.fonts.conf - meaning your ~/.fonts.conf will always override the system settings). ===Application Specific Settings=== Qt and Gtk settings need to be changed. ====Gtk==== For gtk, edit .gtkrc-2.0 and set the fonts either to the generic 'serif', 'sans-serif', etc (now aliased to the MS fonts), or specify the MS fonts outright. ====Qt==== For qt, edit .kde/kderc and .qt/qtrc ==Suggestions== ===Non TrueType fonts=== Non TrueType fonts don't render well on LCDs as they don't support hinting. For these fonts (e.g. Helvetica), it is recommended that you specify an alternative TrueType font (that is hopefully similar, but it doesn't have to be!) to use instead (in this case, whatever the default sans-serif font on the system is): <match target="pattern" name="family" > <test name="family" qual="any" > <string>Helvetica</string> </test> <edit mode="assign" name="family" > <string>sans-serif</string> </edit> </match> You can easily reuse this for other fonts. Just copy and paste, then replace 'Helvetica' with the font to replace, and 'sans-serif' with the font you want to replace it with (or you can use the generic descriptions 'serif', 'sans-serif' or 'monospace'). ===Old Gtk/Qt=== Some programs (usually older ones) using these libraries may not always use anti aliased fonts, even if you've specified them in .fonts.conf. This can fixed by: Gtk: Add the following to /etc/profile: export GDK_USE_XFT='1' qt: In ~/.qt/qtrc, ensure the following entry is present under [General]: enableXft=true useXft=true Programs coded using Gtk 1.x don't appear to support anti aliasing properly – you may want to consider replacing them with ones that use Gtk 2.x (e.g. Replacing XMMS with its Gtk2 fork, Beep Media Player) ===OpenOffice.org=== OpenOffice.org binaries are built against the bytecode interpreter. If you install a bytecode enabled FreeType, OOo will always use it, regardless of any system settings enabling the autohinter. Also, OpenOffice.org fonts have to be changed manually. Tools > Options > OpenOffice.org > 'Use system font for user interface' (make sure this is checked). ==Appendix A== The following is a ~/.fonts.conf / /etc/fonts/local.conf skeleton. Use this to put together a working configuration for your system. <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!-- Settings go between fontconfig tags --> </fontconfig> ==Appendix B== This section is a recommendation only. Some fonts are not TrueType, which means they don't support anti aliasing and look dreadful on an LCD. The way round this is to tell FreeType to replace any such fonts with a properly hinted TrueType equivalent. All of the Bitstream and Luxi fonts should be aliased in this way (some sites, such as Gnome's home page, use these fonts, and they don't render correctly with the bytecode interpreter). You can copy, paste and edit the following example for Helvetica for any other fonts you want to replace. (Just replace 'Helvetica' with the font to replace, and 'sans-serif' with the font you want it to be replaced with. Generic font descriptions serif, sans-serif and monospace are valid entries, as well as specific font names.) <!-- Replace Helvetica with default sans-serif --> <match target="pattern" name="family" > <test name="family" qual="any" > <string>Helvetica</string> </test> <edit mode="assign" name="family" > <string>sans-serif</string> </edit> </match> <alias> ==Footnotes== [1] Apparently, there are some monitors where the screen can be rotated. If so, perhaps the vrgb/vbgr settings might be better for you (but only when the screen is rotated) If you can test this, please report back the results. ==Bibliography== Man Page of fonts.conf - http://www.fontconfig.org/fontconfig-user.html<br /> XFree86 Font Configuration - http://www.xfree86.org/current/fonts2.html<br /> Explanation of Sub Pixel Hinting - http://grc.com/ctwhat.htm<br /> Gentoo Xorg & Fonts (And how to fix Konsole Linux fonts problem) - http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts<br /> If you're running an old version of XFree http://www.tldp.org/HOWTO/FDU/index.html 4a9b2f174da27df04bdc2c152fd4dbe63c69df02 Libdvdcss 0 103 126 2009-06-03T02:30:12Z Erik 1 Copy from old wikitext text/x-wiki '''libdvdcss''' is a highly portable <b>library</b> for accessing and unscrambling DVDs encrypted with the Content-Scrambling System (CSS) system. It is part of the VideoLAN project and is used by VLC media player and all other open source DVD players such as Ogle, xine and MPlayer. libdvdcss is designed to be platform independent, with versions for GNU/Linux, Microsoft Windows, Mac OS X, BeOS, BSD and Solaris. It is released under the GNU General Public License. libdvdcss is not to be confused with [http://en.wikipedia.org/wiki/DeCSS DeCSS]. While DeCSS uses a cracked DVD player key to perform authentication, libdvdcss uses a generated list of possible player keys. If none of them work (for instance, when the DVD drive enforces region coding) a brute force algorithm is tried so the [[region code]] of a DVD is ignored. Unlike DeCSS, libdvdcss has never been fought over in a courtroom. In many countries it is forbidden to sell or document programs that provide ways around copy protection systems. CSS is not a copy protection system, but thwarts attempts to play the DVD without proper software. Despite this fact, many Linux distributions do not contain libdvdcss (for example Debian, SUSE Linux, and Ubuntu) for reasons concerning patents. In most of these cases, the library can be easily downloaded from the Internet. ==External links== *[http://developers.videolan.org/libdvdcss/ Official site] *[http://slackbuilds.org/repository/12.0/libraries/libdvdcss/ libdvdcss at Slackbuilds.org ] - SlackBuilds.org has a SlackBuild script for libdvdcss. *[http://www.linuxpackages.net/search_view.php?by=name&name=libdvdcss LinuxPackages.net]- libdvdcss Slackware packages are usually found here. [[Category:Information]] 68aa50f2215a95c2bc3cdce65e2c507c31048809 Life of a Software Package 0 104 127 2009-06-03T02:30:42Z Erik 1 Copy from old wikitext text/x-wiki From the programmer's keyboard to your (Slackware) Linux system. = Introduction = This article explains how a program someone writes in one side of the world ends up being managed in your system. It's meant to be easy to understand for a novice user coming from Windows, and only requires some basic knowledge of Unix systems. Specifically, the reader should know: * How basic Unix permissions work. * How to interpret the basic output of the ''ls'' command. * How a command line interface works. It only contains general ideas that could help a novice user understand the existing differences when installing software under Windows and under Unix, but no specific information about how to do it. The distribution manual will give you the specific details you need, and may be a good read after you have read this article. = From source code to machine language = '''Note''': You do not need to run any of the commands in this section. It's enough to understand the text and part of the output. When a programmer creates a program, it's very common to write the program in a so-called high level language. In other words, he doesn't create the program executable directly specifying the intructions for the computer to run. He writes the program in a language that allows him to represent the program structure and logic, and then that logic is translated to a language the bare machine can understand. Let's suppose someone wants to write a ''Hello, World'' program in the C programming language. This is a program that prints a message to the screen and finishes, in order to check your system can translate the language you have used to machine language and to test the basic stuff works, as well as to give the novice programmer an idea on how the high level language works. This would be a very simple ''Hello, World'' program written in C: #include <stdio.h> int main() { printf("Hello, World!\n"); return 0; } You do not need to understand that program. The above text is what is commonly known as the '''source code''' of the program. The source code of a program in C is usually spread over one or more source files, so this program could very well be stored in a plain text file called ''hello.c''. You could view this file using a plain text editor like the Windows notepad. This file cannot be executed directly because it's not a real program. First off, it doesn't have execution permissions, and if we tried to give it execution permissions and run it, we would get an error message: $ ls -l hello.c -rw------- 1 rg3 users 74 2007-10-15 19:27 hello.c $ chmod +x hello.c $ ./hello.c ./hello.c: line 3: syntax error near unexpected token `(' ./hello.c: line 3: `int main()' We need to use a program called ''compiler'' to get a binary and executable file. A file in a specific format that the operating system (Linux in our case) can understand. When you run it, the operating system reads the file, copies the different program components to the computer's memory and starts the program execution. If our machine has everything ready to compile C programs and we want to use the GNU C Compiler (''gcc''), we could do something as simple as: $ gcc -o hello hello.c And we would get a file named ''hello'' which is our program ready to be run. As you see, our program is simply called ''hello'' and not ''hello.exe'', which would be a common name if we were working under Windows. In Unix systems, the convention is that programs do not have any file extension in their name (like EXE). We could then run the program and see that it does what we wanted. $ ./hello Hello, World! $ = Complex programs use libraries = Most programs do a more sophisticated task than printing a message on the screen and finishing. The source code of the program above has 7 lines. It is not uncommon for a simple program to have thousands of lines, and there are a good amount of complex programs out there that have millions of lines of source code. It is also a very common practice to use items called '''libraries''' (usually '''shared''' libraries) to build your program. Libraries are files that contain the machine code to perform several different tasks. For example, let's suppose you were going to create a program that needs to download some data from the Internet, via HTTP (the web) or via FTP or another network service. And also let's suppose you don't have much knowledge on how to create a program that talks to others using the network, or that the focus of your program is on solving some other problem and you don't want to lose time or create a lot of code just because you want it to be able to download a file. Fortunately for you, there is a library called ''libcurl'' that makes retrieving files over the network very easy. The library contains all the code you need, so the source code you are going to create will not contain anything specific to be able to use the network. You simply indicate that you want to use ''libcurl'' and call the library functions everytime you want to download a file. Do you need to learn to sail or fly a plane or a different language if you want to send a letter to a friend in a different continent? No, you put the letter in the mailbox and the postal service does it for you. Libraries work like this. In the moment you decide to do this, your program starts '''depending''' on ''libcurl''. Some pieces of the library need to be present in your system if you want to compile that program to create an executable, and some other pieces need to be present in the moment you want to ''run'' the program. Else, the program will not compile or will not be able to run. Libraries are convenient because, if managed well, you can install them in your system once and they will be used by every program that needs them. This is why libraries are regarded as a ''good thing'' or a ''good idea'' in the programming world, in most cases. In Windows, shared libraries are called DLLs, as the library files usually have the DLL extension. In Unix, it's common for them to have the ''.so'' suffix, or some other containing it. For example, I have ''libcurl'' in my system, and the shared library is located in the file ''/usr/lib/libcurl.so.4.0.0''. = Libraries and programs all over the place need a package manager = So your system is going to be populated by a lot of programs, many of them using many different libraries for different tasks, some of them having some libraries in common, others having nothing in common. As you can guess, this situation can evolve into a pretty chaotic system. Let's describe how Windows did this in the past, and how Unix systems have been trying to handle the situation for a good amount of years now. In Windows, most people distribute programs already compiled. You get a group of files or a single file that holds your program already prepared to be run. You extract those contents and place them somewhere in your hard drive, usually all of them under a specific directory (folder). You could then create some shortcuts in the ''start'' menu and the program is ready to be run. A installer program usually does all of this for you, asking some questions. What happens when the program uses a library? If the library is not very common and cannot be assumed to exist in a standard Windows installation, the common practice is to include a copy of the library with the program. If it's a relatively uncommon library, the installer usually puts it in the same place as the program, and when it is run and requests the library, the system first looks in the folder holding the program and finds the library there, and starts to use it. If it's not an uncommon library but you need a specific version of it, the installer may try to install it in a common place so all the programs can use it. It was very typical, when you had a system in which you had installed a lot of software as time passed, that the installer would ask you "I am trying to install the following library, but it appears to be present in your system in a newer version. Do you want me to replace the copy of it with my copy or do I leave it as it is?". And, in the same line, when you removed the program it would say "I was going to remove this library from the common place, but other programs may want to use it. Can I remove it or should I keep it there?". This chaos was called "DLL Hell". Unix tries to avoid this problem in several ways, and its solutions bring the need of a package manager as we will explain. First off, in Unix the files on your hard drive are not grouped by program, but by their function. All binaries are stored in two or three folders, and the same for libraries or help documents. If all the documentation and help for the different programs is installed in a common location, it's easier to create a help system from which you can browse the documentation of every program installed on the computer, for example. This is generally considered a good idea and it's the tradition, but of course the idea has its detractors. Anyway, a second difference is that in Unix programs are distributed alone. If a program needs a library to be run, it needs to specify that somewhere, but only under special circumstances it's recommended to include the library as part of the program. In most cases, the library is distributed apart. Those two differences avoid the DLL hell. By installing libraries, programs, documentation and other data to common system locations, you avoid duplicating data. If there's a security problem using a library and every program using it could become compromised and make the system vulnerable, you update the library once and all the programs that use it are automatically protected, as each program doesn't include its own copy in its directory. By separating the programs from the libraries they use and distributing them apart, you make sure programs do not overwrite the libraries used by others or remove common libraries when they are removed. However, the solution itself brings some new problems. For example, if a program installs files all over common system directories and I later want to remove it, how do I know which files need to be removed? And if a program requires a library to run, can I or should I specify that fact somewhere? Package managers are the answer. Under Unix, software is many times distributed as '''packages'''. Packages are groups of files that contain programs, libraries, documentation or simply data. Under Windows, to install a program many times you download an installer file, run it and the program is installed. This installer file that holds inside all the files the program needs and extracts them to the proper location could be considered a form of package, so you get an idea. Packages in Unix are usually managed by a package manager. A package manager is a program that allows you to install packages, check the list of installed packages, remove packages and many more complex tasks depending on how powerful and featureful the package manager itself is. When you install a program using a package, the package holds the program binary, the program data and the program documentation, typically, along with information on where those files should be installed in the system, all over the place. Fortunately, prior, during or after the installation, after copying the files to your system, the package manager records somewhere the name and version of the package and the files it installed. This is the trick that allows you to later remove the package using the package manager without having to remember which files had been installed where. In addition, the package may hold information about other packages it needs installed for it to run, and this information may be used by the package manager to automatically download and install them too. Hopefully, you now start to understand the practical vision behind packages and package managers. = Too many package managers = The problem with package managers is that many Unix systems and even many different Linux distributions use many different package managers. Each one uses different package formats that cannot understand each other. Slackware uses ''pkgtools'', Debian and Ubuntu use ''apt-get'', Red Hat uses ''yum'', Mandriva uses ''urpmi'', Arch uses ''pacman'', etc. You are a programmer and created the ''Hello, World'' program we saw at the beginning. How do you distribute your program? You have several solutions. If you don't want people to get the source code of your program, you need to distribute the program already compiled and probably packaged. To do that, you could provide your own program to install and uninstall the package cleanly from any system, and distribute it somehow and break some rules to achieve maximum compatibility, so the program will run on many different systems and distributions. Many commercial games are shipped this way. Unreal Tournament 2004 for Linux is distributed this way, for example. You could also provide it as a package for each of a subset of supported systems. Many companies do this. They give you Debian, Red Hat, Suse and Mandriva packages for you to choose, for example, each in the proper format to be used with the package manager from that distribution. If you want to use the software under other system you are out of luck. You can try some tricks but it's not guaranteed to work. If, on the other hand, your program is open source and you don't mind people reading the source code of your program, the common case is to avoid creating a package for anything. You simply distribute a tarball (similar to a ZIP or RAR file) containing the source code and instructions to compile it. If someone wants a Debian package to install it, someone will have to compile your program under Debian, and make a package with the result. This is a very very very common case. In fact, distributions like Ubuntu or Debian heavily rely on '''package repositories''', network locations from where you can download thousands of packages for your system, created by a myriad of official and unofficial packagers (people that create packages for the system). For example, if you want to install a program under Ubuntu, it's very infrequent for the program not to exist already packaged in a repository, and you can download and install it, together with its dependencies, in a couple of mouse clicks. = Summing up = * Many times the programmer creates programs using source code that must be compiled. * They use libraries to make writing programs easy. * Distributing the resulting program is easier using a package manager. * Many programmers only give you the source code due to the diversity of package managers and systems. * Someone else is responsible for creating a package for a specific system. = Slackware specifics = Slackware is, as you may know, a very simple system. Being simple doesn't mean it's simple to use. On the contrary, a system with a simple design and simple tools usually requires the user to do more things to achieve a goal. The advantage of a simple design is that it's easier to understand if you want to know how your system works, and sometimes it's also more stable and has less bugs. As part of its simple design, the package manager in Slackware is also very simple, and its packages are also very simple. Slackware packages are tarballs (again, something like ZIP files) that, if extracted in the right place, will populate the system with the package files, and it also holds some special files with information about the package itself. As they are simple tarballs, Slackware doesn't try to hide this fact, and Slackware packages have the ''tgz'' extension (short for ''tar.gz''), contrary to other systems in which packages have a special extension to make it clear that they are packages, like ''rpm'' or ''deb''. This is not a problem, but sometimes this confuses novice users. They go to the program webpage and download the program source code in a tarball (usually a file with ''tar.gz'' extension) and think "Hey, if Slackware packages are tarballs and this is a tarball, I'm going to install this file with the package manager". Wrong! Even when the package manager complains that the package name does not end in ''tgz'' but on ''tar.gz'', they many times rename the file and try again. Those are two mistakes in a row. The package manager will try to extact the tarball contents to that special location we mentioned earlier and nothing will happen, as the files inside the tarball are not structured as they need to be, but this is the small problem. The big one is that what you are trying to install is the source code of the program, and not the program itself! Remember, you need to compile it first in the majority of cases. Under Slackware, you should first check if there is an official package for the program. If there is not, you could try to to download a ready to use package from a place or someone you trust. Else, you could compile the program yourself and create a package for it, and then install the package. The compilation and package creation can be automated sometimes for ease of use, for example using [[SlackBuild Scripts|SlackBuild scripts]]. [[Category:Information]] c3cd57a0aefddda8629eb96bd5cc25954d4a05d9 Lilo 0 105 128 2009-06-03T02:31:17Z Erik 1 Copy from old wikitext text/x-wiki Once upon a time you try to boot Slackware, something happens and lilo is messed up. You can fix lilo really easily, all you need is CD1 of Slackware. Boot the CD and when it says boot: then you type the following: : <code>huge.s root=/dev/hda1 noinitrd ro</code> Now you change huge.s to the kernel you want to boot, root= should reflect the root partition of your Slackware install. Now when you type this you have Slackware booting up with the bare.i default kernel. Now at the login prompt you login as root and either type: : <code>liloconfig</code> That will setup Lilo from a ncurses based menu. Now you can also edit lilo's config from a file: : <code>vi /etc/lilo.conf</code> Either way it will fix it hopefully, Now remember man lilo has all the hex errors if you need them. When you have all that setup you now can run: : <code>/sbin/lilo -v</code> Now you must run lilo every time you change /etc/lilo.conf to update the changes, Now restart without the CD and it should work. [[Category:Tutorials]] faaece4ac572f843d9d0e7c784166e88c5d88950 Log Correlation 0 106 129 2009-06-03T02:32:14Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] '''Log Correlation''' I thought I'd talk about the importance of log correlation. For instance, you've found that someone is continually pinging your server. You want to see if your box is responding to the pings. Usually, you'll know right off, since most people know if their firewall was configured to block pings...I'm just using pings as a quick example, though. Log correlation usually consists of checking, for instance, web server logs against firewall logs, or Snort logs against firewall and web server logs. This helps you understand what suspicious activity is actually doing and if your server/workstation responded (and how it responded, if it did). I run Snort on a server, along with a web server, which is firewalled with IPTables. I have Snort report what it sees to a MySQL database, although it does record captures to a PCAP file locally. I also run Modsecurity, an application firewall that is designed to sniff and possibly block traffic going to/from web servers, mainly Apache. So, I've a ton of logs that I can correlate: Snort, Apache, IPTables, and Modsecurity logs. We'll pick something easy. In fact, I'll fabricate some logs by generating some false alerts. I'll use 'wget', to visit my website. Keep in mind that what you see below gives you the advantage...you know what you're doing and looking for when we soon check the logs. This won't be the case when some stranger or worm hits your firewall or web server (or any other application server). -bash-2.05b$ wget wigglit.ath.cx/root.exe --23:24:05-- http://wigglit.ath.cx/root.exe => `root.exe' Resolving wigglit.ath.cx... 66.160.141.30 Connecting to wigglit.ath.cx|66.160.141.30|:80... connected. HTTP request sent, awaiting response... 404 Not Found 23:24:06 ERROR 404: Not Found. -bash-2.05b$ I used root.exe because there is an old vulnerability was was used to exploit flaws in IIS...the CodeRed worm of old. Now, let's check the web server's logs. I've tail'd my logs: root@starchild:/var/log/apache# tail -f -n 100 access_log 12.123.12.123 - - [15/Sep/2007:23:34:35 -0400] "GET /root.exe HTTP/1.0" 404 202 12.123.12.123 - - [15/Sep/2007:23:34:35 -0400] "GET /root.exe HTTP/1.0" 404 202 "-" "Wget/1.10.2" You see that the communcation was accepted. A 404 code, which means 'page not found', was generated. This is usually a good indication, as the server didn't respond favorably to the attack. Now, let us check the firewall logs. We already know that the firewall allowed the traffic, since the web server responded with a 404...if the traffic was being blocked, there would be no record of the attack in the logs, because the firewall would have intercepted the traffic before it reached the web server. We're checking the firewall logs just to be sure this guy hasn't done anything else that the web server didn't see: Sep 12 17:28:34 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=34557 DF PROTO=TCP SPT=46656 DPT=10083 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:28:44 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=18168 DF PROTO=TCP SPT=40091 DPT=449 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:28:44 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=27053 DF PROTO=TCP SPT=36295 DPT=5060 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:28:54 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=29291 DF PROTO=TCP SPT=47590 DPT=342 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:28:54 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=11788 DF PROTO=TCP SPT=43604 DPT=1519 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:04 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=17600 DF PROTO=TCP SPT=32783 DPT=577 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:04 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=51338 DF PROTO=TCP SPT=47879 DPT=18187 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:14 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=58520 DF PROTO=TCP SPT=41983 DPT=517 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:14 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=20255 DF PROTO=TCP SPT=53355 DPT=1986 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:24 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=28213 DF PROTO=TCP SPT=38543 DPT=978 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:24 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=10244 DF PROTO=TCP SPT=45624 DPT=11371 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:37 starchild kernel: ICMP-request: IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=28 TOS=0x00 PREC=0x00 TTL=42 ID=53002 PROTO=ICMP TYPE=8 CODE=0 ID=10683 SEQ=16615 Sep 15 23:21:08 starchild kernel: ICMP-request: IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=84 TOS=0x00 PREC=0x00 TTL=55 ID=40988 PROTO=ICMP TYPE=8 CODE=0 ID=614 SEQ=0 Quite a bit of stuff, huh? This looks to be a port scan! This is something that we didn't see in the Apache logs! Good thing we checked! Looks like this IP needs to be blocked with IPTables (which we won't do in this exercise). Sadly, nothing shows in the Modsecurity logs, but we've enough information already. What about Snort? Because I've PCAP files, the search becomes a bit more involved. I'll spare the intimate details, but this is what we see: [**] [1:1256:9] WEB-IIS CodeRed v2 root.exe access [**] [Classification: Web Application Attack] [Priority: 1] 09/15-23:34:35.708546 0:C:DB:F5:90:0 -> FE:FD:40:3E:E7:DC type:0x800 len:0xB0 12.123.12.123:52753 -> 66.160.141.30:80 TCP TTL:56 TOS:0x0 ID:51589 IpLen:20 DgmLen:162 DF ***AP*** Seq: 0xAF32BB68 Ack: 0x3F319F7A Win: 0xFFFF TcpLen: 32 TCP Options (3) => NOP NOP TS: 288652007 1521931210 [Xref => http://www.cert.org/advisories/CA-2001-19.html] 23:34:35.708546 00:0c:db:f5:90:00 > fe:fd:40:3e:e7:dc, ethertype IPv4 (0x0800), length 176: IP (tos 0x0, ttl 56, id 51589, offset 0, flags [DF], length: 162) 12.123.12.123.52753 > 66.160.141.30.80: P [tcp sum ok] 2939337576:2939337686(110) ack 1060216698 win 65535 0x0000: fefd 403e e7dc 000c dbf5 9000 0800 4500 ..@>..........E. 0x0010: 00a2 c985 4000 3806 56c0 47b2 0aa0 42a0 ....@.8.V.G...B. 0x0020: 8d1e ce11 0050 af32 bb68 3f31 9f7a 8018 .....P.2.h?1.z.. 0x0030: ffff e9c5 0000 0101 080a 1134 7ae7 5ab6 ...........4z.Z. 0x0040: d3ca 4745 5420 2f72 6f6f 742e 6578 6520 ..GET./root.exe. 0x0050: 4854 5450 2f31 2e30 0d0a 5573 6572 2d41 HTTP/1.0..User-A 0x0060: 6765 6e74 3a20 5767 6574 2f31 2e31 302e gent:.Wget/1.10. 0x0070: 320d 0a41 6363 6570 743a 202a 2f2a 0d0a 2..Accept:.*/*.. 0x0080: 486f 7374 3a20 7769 6767 6c69 742e 6174 Host:.wigglit.at 0x0090: 682e 6378 0d0a 436f 6e6e 6563 7469 6f6e h.cx..Connection 0x00a0: 3a20 4b65 6570 2d41 6c69 7665 0d0a 0d0a :.Keep-Alive.... The first is the Snort alert file...this is a fast alert, with minimal detail (no packet capture). The second section is the full alert, including packet capture. It is also garbled (due to the hex code and the fact that this blog has issues with formatting) Note that my logs show no response. Apparently, my Snort install doesn't have a 404 signature. Again, the fact that we can correlate helps me when my Snort install lacks the data that I may have needed. I was able to look at the Apache logs to see the 404 when my Snort logs didn't show the return traffic. Well, this concludes our chat about correlating existing logs. Note that any log files can be correlated. Correlation can also assist in tracking down network issues or issues with, for instance, a faulty Snort install (ahem). Although this discussion focused more on security, hopefully this helps someone understand their network or software architecture also. This page is also linked at [http://slackfiles.blogspot.com/2007/09/log-correlation.html my blog] --[[User:Unixfool|Ron]] 00:35, 16 September 2007 (EDT) 375bd6c95bb9e07c9a07b79854abb8e7ca10554d Login Shell 0 107 130 2009-06-03T02:32:43Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] __TOC__ ==Introduction== Seeing people give bad advice regarding colored ls output, I figured I better address this problem at the source. If you open a terminal and ls does not give colored output, or the prompt is similar to <code>bash-2.04$</code> then you are in a non-login shell. This means none of the default profile scripts were sourced. From the BASH man page: When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior. When a login shell exits, bash reads and executes commands from the file ~/.bash_logout, if it exists. When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, if that file exists. This may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of ~/.bashrc. When bash is started non-interactively, to run a shell script, for example, it looks for the variable BASH_ENV in the environment, expands its value if it appears there, and uses the expanded value as the name of a file to read and execute. You need to configure your terminal to give you an interactive "login shell". A login shell is the same as a login at the console. The default profile and user profile scripts will be sourced. Below are some ways to change how your terminal emulator behaves. ==Eterm== Chances are if you are using Eterm you know what you're doing and not looking at this page. But just for reference, you can envoke a login shell by passing -l or --login-shell at the command prompt. The preferred method is to edit your .cfg file (the default is $PREFIX/share/Eterm/themes/Eterm/theme.cfg) and add <code>login_shell true</code> in the toggles section. Eterm -l ==Gnome-Terminal== Edit -> Profiles<br> Select the profile (Default) and click Edit<br> Select the Title and Command Tab<br> Check the box next to Run command as a login shell ==Konsole== There should be a way to do this from some configuration dialog, but I don't use KDE or Konsole, so all I can recommand at this time is the following: konsole --ls ==xterm / rxvt / aterm== xterm -ls rxvt -ls aterm -ls ==XFCE 4.4 Terminal== Open the XFCE terminal.<br> Open Edit -> Preferences<br> Select the "General" icon at the left.<br> Under "Command", check the box next to "Run command as a login shell" ==screen== If you launch ''screen'' directly in a X11 terminal emulator, you will notice that using the ''-ls'' or equivalent terminal emulator option is not enough to get colored ''ls'' output. This is because the terminal emulator is not calling the shell directly, and it's ''screen'' who does. ''screen'' has a configuration file option to use a login shell and another one to modify the system logs as if you had logged in (read the ''screen'' manpage for more details). However, this doesn't seem to be enough to get colored ''ls'' output. Some people avoid these login shell confusions and problems by trying to get the same ''bash'' environment no matter how ''bash'' ends up being called as an interactive shell. This implies setting the bash prompt (controlled by the environment variable PS1) from the ''.bashrc'' user file and either sourcing ''.bashrc'' from ''.bash_profile'' or making ''.bash_profile'' a link to ''.bashrc''. Additionally, you can include the following lines in your ''.bashrc'' script to '''always''' get colored ''ls'' output: if [ -z "$LS_COLORS" ]; then source /etc/profile.d/coreutils-dircolors.sh fi These recommendations are the "bad advice" the original author mentioned in the first paragraph. 884cb7f41656b7fd7e8d58e4119ab34d6c2df586 Logitech Marble FX mouse 0 108 131 2009-06-03T02:33:11Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Hardware]] '''Logitech TrackMan (R) Marble FX Mouse Basic Setup & Tweak Guide''' This is a simple guide for using this marble mouse on my Slackware 12.0 setup. Since this is a plug and play mouse you will find that the 'auto' protocol of xorg.conf for the mouse works quite well on Slackware for this mouse. There is very little that we need to do to actually use our mouse. However one of the advantages to a marble mouse, and the reason I decided to write this how-to is a feature commonly referred to as 'drag lock' which is not activated by default using the auto protocol. To me this is a must have feature for me when using a marble mouse and only requires a slight addition to our xorg.conf file. This guide will demonstrate the following: 1. Setup xorg.conf to allow item (2) and (3) below. 2. Enable the drag lock in our xorg.conf file. 3. Optional: Get drag lock to work in web pages in Mozilla Firefox so we can use our track ball to vertically & horizontally scroll. I will assume that you are already quite familiar with Slackware's xorg.conf. '''Item 1 & 2 Setup for xorg.conf & Enable drag lock.''' Below is my xorg.conf for this mouse: <code><pre> Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Device" "/dev/mouse" Option "Protocol" "auto" Option "EmulateWheel" "true" # This is for future use as button 8 is not supported on Slackware 12 see below. # Option "EmulateWheelButton" "8" Option "DragLockButtons" "2 1" EndSection </pre></code> For me the important item above is the "DragLockButtons" option above. What this does is: - makes the white button up top on the mouse above your thumb (which is seen by Xorg as button 2) activate drag lock on the the lower thumb button (which is seen by Xorg as button 1). Usage: Now we can simply press button 2 with our thumb then use our thumb to roll the marble and scroll scroll scroll away while in the background we are in essence, pressing and holding the one key. In simpler terms, you can press button 2 of your mouse (the white button above your thumb) with your thumb on the title bar of a program and now use your thumb to roll the marble, allowing you to move the application window. This also works for horizontal scroll bars, vertical scroll bars, or even for selecting text in a web page, word processor, or even moving an icon on your desktop. As a side note: There are other options available for this mouse. Personally I am happy with the defaults that Xorg yields on entering my xsession. The following is some of the information presented to us at the bottom of /var/log/Xorg.0.log which re-iterates our settings above *and* also let's us know what defaults it is using for some items that we did not address, that would could tweak further if we like. <code><pre> (==) Mouse1: Emulate3Buttons, Emulate3Timeout: 50 (**) Option "DragLockButtons" "2 1" (**) DragLock: button 2 is drag lock for button 1 (**) Mouse1: ZAxisMapping: buttons 4 and 5 (**) Option "EmulateWheel" "true" (**) Option "EmulateWheelButton" "8" (==) Mouse1: YAxisMapping: buttons 4 and 5 (**) Mouse1: EmulateWheel, EmulateWheelButton: 8, EmulateWheelInertia: 10, EmulateWheelTimeout: 200 </pre></code> You also see that Option "EmulateWheelButton" "8" in the xorg.conf & our Xorg.0.log? Xorg will allow us to uncomment that line in our xorg.conf file. That *is* what the printout above is for, an xorg.conf file with that line un-commented. However, for some reason it simply won't do anything on Slackware 12.0. It will in Slackware 11.0 and I haven't tested it on Slackware 12.1 rc's yet. It also does work on Debian Lenny, which has the same version of X that Slackware 12.0 does. Which is totally blowing my mind. I have played with all the numerous protocol's, xmodmaps to no avail. Therefore I have left the option in xorg.conf for you above so that you have it for future use, or reference purposes. The number 8 button is the little red button on the mouse on the thumb side of the mouse. '''Item 3: How to get the mouse to work in Mozilla Firefox''' This is totally optional and not required. There are other ways to achieve this functionality, I simply find this the easiest way. As stated you can simply use the scroll bar with the draglock feature above. However, since my mouse is not always near the side or bottom of the page, it's nice to activate scrolling of a page from where ever our mouse may be positioned at the present moment while surfing. To achieve this I use an extension called "Grab And Drag" by Ian Weiner. It is available at the firefox add-ons site. After installing the extension, and restarting Firefox. Edit Grab and Drag's preferences, click on the "General Tab", under section "Behavior" there is a drop down for "Use the XXX mouse button to grab and drag" . Where "XXX" is a drop-down selection box. I use left for that option. Usage: Now when I'm surfing the web, regardless of where I have my mouse cursor on the page, I can simply click on my button 2 of my mouse, then roll the marble and I have full vertical and horizontal scrolling with my marble. I have tested this extension with Firefox 2.0.0.14 and Firefox 3.0 beta 5. Hope This Helps. 796382a923fbaf547f8797f46745f02ada15b09c Madwifi 0 109 132 2009-06-04T05:17:41Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Networking]] [[Category:Wireless]] [[Category:Driver]] Latest CVS is 09-Jul-2005 02:35 __TOC__ == Instalsi == == Konfigurasi == <pre> cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi \ co madwifi </pre> == iwconfig Options == <pre> iwconfig --help Usage: iwconfig interface [essid {NN|on|off}] [nwid {NN|on|off}] [mode {managed|ad-hoc|...} [freq N.NNNN[k|M|G]] [channel N] [sens N] [nick N] [rate {N|auto|fixed}] [rts {N|auto|fixed|off}] [frag {N|auto|fixed|off}] [enc {NNNN-NNNN|off}] [power {period N|timeout N}] [txpower N {mW|dBm}] [commit] </pre> <pre> iwconfig ath0 essid ''avalon'' iwconfig ath0 key ''1234567890'' iwconfig ath0 channel ''13'' iwconfig ath0 rate ''10MB'' iwconfig ath0 ap ''11:22:33:44:55:66'' </pre> == iwlist Options == <pre> iwlist --help Usage: iwlist [interface] frequency [interface] channel [interface] ap [interface] accesspoints [interface] peers [interface] bitrate [interface] rate [interface] encryption [interface] key [interface] power [interface] txpower [interface] retry [interface] scanning </pre> == iwpriv Options == <pre> iwpriv ath0 ath0 Available private ioctl : setoptie (8BE8) : set 256 byte & get 0 getoptie (8BE9) : set 0 & get 256 byte setkey (8BE2) : set 60 byte & get 0 delkey (8BE4) : set 7 byte & get 0 setmlme (8BE6) : set 10 byte & get 0 addmac (8BEA) : set 1 addr & get 0 delmac (8BEC) : set 1 addr & get 0 chanlist (8BEE) : set 32 byte & get 0 setparam (8BE0) : set 2 int & get 0 getparam (8BE1) : set 1 int & get 1 int turbo (0001) : set 1 int & get 0 get_turbo (0001) : set 0 & get 1 int mode (0002) : set 1 int & get 0 get_mode (0002) : set 0 & get 1 int authmode (0003) : set 1 int & get 0 get_authmode (0003) : set 0 & get 1 int protmode (0004) : set 1 int & get 0 get_protmode (0004) : set 0 & get 1 int mcastcipher (0005) : set 1 int & get 0 get_mcastcipher (0005) : set 0 & get 1 int mcastkeylen (0006) : set 1 int & get 0 get_mcastkeylen (0006) : set 0 & get 1 int ucastciphers (0007) : set 1 int & get 0 get_uciphers (0007) : set 0 & get 1 int ucastcipher (0008) : set 1 int & get 0 get_ucastcipher (0008) : set 0 & get 1 int ucastkeylen (0009) : set 1 int & get 0 get_ucastkeylen (0009) : set 0 & get 1 int keymgtalgs (0015) : set 1 int & get 0 get_keymgtalgs (0015) : set 0 & get 1 int rsncaps (0016) : set 1 int & get 0 get_rsncaps (0016) : set 0 & get 1 int roaming (000C) : set 1 int & get 0 get_roaming (000C) : set 0 & get 1 int privacy (000D) : set 1 int & get 0 get_privacy (000D) : set 0 & get 1 int countermeasures (000E) : set 1 int & get 0 get_countermeas (000E) : set 0 & get 1 int dropunencrypted (000F) : set 1 int & get 0 get_dropunencry (000F) : set 0 & get 1 int wpa (000A) : set 1 int & get 0 get_wpa (000A) : set 0 & get 1 int driver_caps (0010) : set 1 int & get 0 get_driver_caps (0010) : set 0 & get 1 int maccmd (0011) : set 1 int & get 0 wme (0012) : set 1 int & get 0 get_wme (0012) : set 0 & get 1 int hide_ssid (0013) : set 1 int & get 0 get_hide_ssid (0013) : set 0 & get 1 int ap_bridge (0014) : set 1 int & get 0 get_ap_bridge (0014) : set 0 & get 1 int inact (0017) : set 1 int & get 0 get_inact (0017) : set 0 & get 1 int inact_auth (0018) : set 1 int & get 0 get_inact_auth (0018) : set 0 & get 1 int inact_init (0019) : set 1 int & get 0 get_inact_init (0019) : set 0 & get 1 int </pre> == Locking to a Specific Mode == <pre> * iwpriv ath0 mode 1 To lock to 11a only. * iwpriv ath0 mode 2 To lock to 11b only. * iwpriv ath0 mode 3 To lock to 11g only. * iwpriv ath0 mode 0 (default) autoselect mode. </pre> == Changing Authentication Mode. == <pre> * iwpriv ath0 authmode 1 To use open authentication. * iwpriv ath0 authmode 2 To use shared key authentication. * iwpriv ath0 authmode 3 To use 802.1x authentication. </pre> == Manipulating the MAC white/black list == <pre> * iwpriv ath0 maccmd 3 To clear the MAC list. * iwpriv ath0 maccmd 1 To make the list a whitelist. * iwpriv ath0 maccmd 2 To make the list a blacklist. * iwpriv ath0 addmac 00:11:22:33:44:55 To add a mac address to the list. * iwpriv ath0 delmac 00:11:22:33:44:55 To delete a mac from the list. </pre> == Changing ESSID Visible Mode == <pre> * iwpriv ath0 hide_ssid 0 << ====== To make ESSID visible * iwpriv ath0 hide_ssid 1 << ====== To hide ESSID </pre> == iwspy Options == <pre> iwspy --help Usage: iwspy interface [+] [MAC address] [IP address] </pre> == Contoh == == Installing Madwifi on Slackware == Pre Install Steps: cd /usr/src/sourcepkg wget http:// cd .. tar jxvf sourcepkg/madwifi-current.tar.bz2 cd madwifi make make install modprobe ath_pci lspci | grep ath Post Install Steps: 1. After the module is loaded and your ath0 interface is up, run ifconfig and get the MAC address of ath0. 2. Edit /etc/rc.d/rc.wireless.conf and comment out the section beginnning with “*)” 3. Below the lines you commented in /etc/rc.d/rc.wireless.conf add something like this: <pre> 00:0F:3D:A9:97:90) INFO="D-LINK DWL-G650" ESSID="avalon" KEY="6281321313252" ;; </pre> Your MAC address, ESSID, KEY and info comment are obviously going to be different. 1. Run “/etc/rc.d/rc.wireless” and then “dhcpcd ath0” which should be enough to get you up and running. 2. Check your settings if you want “ifconfig” and “iwconfig.” There are relatively easy ways to get slackware to bring up your interface: 1. Put an “ifconfig ath0” statement at the bottom of /etc/rc.d/rc.local 2. update your slackware to slackware-current, our pat has understand what whee need :-) upgrade your packages to lates n/tcpip and n/wireless-tools 3. If you’re using hotplug, you can have it automatically bring up the interface by editing /etc/hotplug/net.agent and inserting the following lines in the “case add|register)” branch: <pre> ath*) dhcpcd -n $INTERFACE % If you use dhcp for the interface % or if you prefer to just hardcode your interface, put your ifconfig statement here. % ifconfig ath0 192.168.1.1 netmask 255.255.255.0 ... ;; </pre> In the remove|unregister branch it will automatically bring down dhcpcd if running. == External Links == * http://www.madwifi.net/ * http://madwifi.otaku42.de/ * http://madwifi.sourceforge.net/ * http://madwifi.sourceforge.net/dokuwiki/doku.php 9a2c92220f69300a373b319ce1bfa0231642bdfb Masquerade 0 110 133 2009-06-04T05:18:06Z Erik 1 Copy from old wikitext text/x-wiki Masquerading is what Windows calls "Internet Connection Sharing", although you can use it for sharing any network connection. This is just a basic script to give you the general idea, and to refine upon for yourself. #!/bin/sh # Define as appropriate for your setup # external interface (connected to the internet) EXT_IF=eth0 # internal interface (connected to your local network) INT_IF=eth3 # path to your iptables binary - leave this alone on slack IPTABLES=/usr/sbin/iptables # We don't want to just forward anything to anyone, or let everything # into our local network $IPTABLES -F FORWARD $IPTABLES -P FORWARD DROP $IPTABLES -A FORWARD -i $INT_IF -o $EXT_IF -j ACCEPT $IPTABLES -A FORWARD -i $EXT_IF -o $INT_IF -m state --state ESTABLISHED,RELATED -j ACCEPT # Do the actual masquerading $IPTABLES -t nat -F POSTROUTING $IPTABLES -t nat -A POSTROUTING -o $EXT_IF -j MASQUERADE # Enable IP packet forwarding echo 1 > /proc/sys/net/ipv4/ip_forward [[Category:Security]] 9d4896be6daa25e168d1b4b2637140d44d9da276 Mediawiki E-Mail 0 111 134 2009-06-04T05:19:19Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] ==Can't Send Out Confirmation E-mails (using SMTP)== (confirmed on Slackware 10.2 & Mediawiki 1.7.x)<br> To use SMTP on Mediawiki 1.5+ you must add:<br> $wgSMTP = array( 'host' => "<i>your.smtp.server</i>", 'IDHost' => "<i>your domain or blank</i>", 'port' => 25, 'auth' => true <i>(or false)</i>, 'username' => "<i>username (if auth=true)</i>", 'password' => "<i>password (if auth=true)</i>" );<br> :::...somewhere into LocalSettings.php (found in the Mediawiki's root directory). After adding the above to your LocalSettings.php file, the SMTP service still <i>probably</i> will <b>not</b> work. If you examine your <code>/var/log/apache/error_log</code> file, it probably will have this error:<br> <code>[error] PHP Warning: usermailer(Mail.php): failed to open stream: No such file or directory in /home/joebleau/public_html/wiki/includes/UserMailer.php on line 82</code> For some reason, the Wiki's config script screws up the path to the PHP's PEAR extensions. To fix this, edit the LocalSettings.php line that says:<br> ::<code>$path = array( $IP, "$IP/includes", "$IP/languages");</code> to say: ::<code>$path = array( $IP, "$IP/includes", "$IP/languages"<b>, "/usr/lib/php"</b> );</code> After that, your smtp outgoing mail <i>should</i> work for your Mediawiki installation. 92e956e54a657a4f62d25e07e97528b31297d794 Mod perl 0 112 135 2009-06-04T05:20:46Z Erik 1 Copy from old, had no category, placed in Tutorials wikitext text/x-wiki [[Category:Tutorials]] This is an example of installing mod_perl on SlackWare 12.0 using the SlackBuild system. I put everything in /root/SlackBuild_mod_perl and I did all the following commands as root. I figured it out from this page: http://slackbuilds.org/howto/ First, I downloaded everything. I went to http://slackbuilds.org/repository/12.0/development/mod_perl/ and I downloaded the "slackbuild" file, mod_perl.tgz, and the source, mod_perl-2.0.3.tar.gz, into /root/SlackBuild_mod_perl I unpacked the SlackBuild package: <pre> root@pecan:~# cd ~/SlackBuild_mod_perl/ root@pecan:~/SlackBuild_mod_perl# tar xzvf mod_perl.tgz mod_perl/ mod_perl/README mod_perl/doinst.sh mod_perl/mod_perl.SlackBuild mod_perl/mod_perl.conf mod_perl/mod_perl.info mod_perl/slack-desc root@pecan:~/SlackBuild_mod_perl# </pre> I moved the mod_perl source into the mod_perl SlackBuild directory, and editted the SlackBuild script: <pre> mv mod_perl-2.0.3.tar.gz mod_perl cd mod_perl emacs mod_perl.SlackBuild </pre> When editting, I just checked that the VERSION= line matched the actual version of the source (2.0.3). Then I executed the SlackBuild script: <pre> ./mod_perl.SlackBuild </pre> That command ran for quite a while and produced a lot of compiling output. When it was done, there was a package left in /tmp. I moved it to /root so it would not be deleted later. I installed it with installpkg: <pre> root@pecan:~# installpkg mod_perl-2.0.3-i486-1_SBo.tgz Installing package mod_perl-2.0.3-i486-1_SBo... PACKAGE DESCRIPTION: mod_perl: mod_perl (Perl Interpreter for Apache) mod_perl: mod_perl: Mod_perl incorporates a Perl interpreter into the Apache web server mod_perl: so that the Apache web server can directly execute Perl code. mod_perl: Mod_perl links the Perl runtime library into the Apache web server mod_perl: and provides an object-oriented Perl interface for Apache's C mod_perl: language API. The end result is a quicker CGI script turnaround mod_perl: process, since no external Perl interpreter has to be started. mod_perl: mod_perl: Homepage: http://perl.apache.org/ mod_perl: Executing install script for mod_perl-2.0.3-i486-1_SBo... root@pecan:~# </pre> At this point I checked that the file /usr/lib/httpd/modules/mod_perl.so existed, and it did. I editted /etc/httpd/httpd.conf and uncommented the line that included /etc/httpd/mod_perl.conf, and then ran httpd -t to make sure there were no syntax errors. I ran "/etc/rc.d/rc.httpd restart" to restart the apache server, and it appeared to work. The web page still worked, and perl scripts still ran. How can I tell if mod_perl or perl cgi is being used ? I'm not sure, please add that info you know. a5b0b48d68877b7f8ebbbf69d522af61e35becb2 Modules 0 113 136 2009-06-04T05:21:23Z Erik 1 Copy from old wikitext text/x-wiki When you are compiling a kernel for the first time asking the question to yourself should I module this or compile this in the kernel? Well the answer to this question is not an exact science. Meaning that it depends on what you believe in yourself. The following are a few things that I like to follow when I compile a kernel: 1. Always compile the root file system in the kernel because without the root file system mounted, How can the kernel load the module:) 2. I like to compile my networking card into the kernel. The reason being is what happens if the modules screw up, I would like to be able to SSH into the box and fix it. 3. Iptables and networking OPTIONS I like to compile as modules, because sometimes I may not need them loaded. 4. IDE chipsets (or SCSI chipsets (if you boot from a SCSI disk)) should NOT be compiled as a module because the devices are needed to boot the system and is required to be loaded BEFORE modules are loaded. ::MEANING: If you boot from an IDE hard-drive but make the IDE drivers a module, your system will never boot! Your boot device driver(s) MUST be compiled into the kernel so the system can start up so that it can later load modules.</b> Now remember that Linux is a monolithic kernel so when you load modules the modules go into the kernel space. This would make it so modules run at the SAME speed as if you were to compile the modules into the kernel. My philosophy is that if you REALLY need to load something on startup ( like root file system, or IDE/ATAPI support) then you should compile it into the kernel. The other stuff like ALSA/ Networking Options/USB/I2C/Etc and stuff like that can be unloaded and reloaded which would make sense if you put them as modules. This is just some advice and it is not 100% correct because some people follow their own strategy when compiling kernels. This is more like a recommendation:) ==Listing Loaded Modules== <code>lsmod</code> will produce a list of modules that the kernel has loaded. ==Manually Loading a Module== <code>modprobe <i>module</i></code> will manually load a module (if the module exists). EXAMPLE: <code>modprobe 8139too</code> will load the 8139too ethernet driver. ==Checking To See If A Module Exists== EASY WAY: <code>modprobe <i>module</i></code> - if the modules doesn't exist (or has a problem), you will get an error message. HARDER WAY: <code>cd</code> into the <code>/lib/modules/2.X.X/</code> directories and start poking around for it. [[Category:Tips]] 53af1a02fe14f273e0e905f5f9002f84077f5614 More MySQL 0 114 137 2009-06-04T05:22:07Z Erik 1 Copy from old, had no category, placed in Tips wikitext text/x-wiki [[Category:Tips]] ::...in no particular order. <B>NOTE: All actions on this page assume you are already logged into the MySQL console and have the proper permissions.</B> ==How do I select which database to work on?== You <code>use</code> it. ::<code>USE <i>database_name</i>; ==How do I create a table in a database?== ::1) make sure you are <code>USE</code>-ing the correct database! ::2) <code>CREATE TABLE <i>table_name</i>(<i>column1 type</i>(<i>size</i>), <i>column2 type</i>(<i>size</i>), <i>...etc.</i> );</code> :::<B>EXAMPLE:</B> ::::<code>CREATE TABLE products(part_num char(6), description char(25), price decimal(5));</code> ==How do I see what the 'columns' are in a table?== ::1) make sure you are <code>USE</code>-ing the correct database! ::2) <code>DESCRIBE <i>table_name</i></code> This will show you the column information including the data type and length. ==How do I show the records in a table?== '''Make sure''' you are <code>USE</code>-ing the correct database! 1) Create a temporary table from a SELECT statement- :: <code>SELECT CREATE TABLE <i>table_name</i>;</code> 2) Show ENTIRE contents of a database including record names: ::<code>SELECT * FROM <i>table_name</i>;</code> ::<b>WARNING: Don't use on a large table!!</b> 3) Show selected contents from a table: ::<code>SELECT * FROM <i>table_name</i> WHERE <i>condition</i>;</code> ==How do I clear the primary key on a table?== ::1) make sure you are <code>USE</code>-ing the correct database! ::2) <code>ALTER TABLE <i>table_name</i> DROP PRIMARY KEY;</code> ==How do I add a primary key to a table?== ::1) make sure you are <code>USE</code>-ing the correct database! ::2) <code>ALTER TABLE <i>table_name</i> ADD PRIMARY KEY (<i>column_name</i>);</code> ==There's a blank space in a column name and now I can't fix it== ::To get MySQL to recognize a column name with a blank space in it, you must put the column name in back-ticks (`) NOT apostrophes ('). ::::EXAMPLE: <code>ALTER TABLE inventory ADD PRIMARY KEY (`Part Number`);</code> ==How do I list all the users?== ::A) To list all the users (regardless of database or table): ::::<code>SELECT User,Host FROM mysql.user;</code> ::B) To list all the users on a database.table: ::::Don't know this one... working on it. ::C) To list all the databases & tables granted to a user: ::::<code>SHOW GRANTS FOR <i>user@host</i>;</code> 4ca5e8a5d7d2e3324576e1caf7a36f38e1d6f876 Mount Count 0 115 138 2009-06-04T05:22:58Z Erik 1 Copy from old, had no category, placed in Information wikitext text/x-wiki [[Category:Information]] A count of how many times a filesystem has been mounted. Used to determine whether a [[Forced Fsck]] should be executed. After a successful fsck (filesystem check), the mount count is reset to zero. When the mount count reaches (or exceeds) the [[Maximum Mount Count]], a Forced Fsck is executed during boot. c1016fca1d75994c5e6b497417bdb52c0f774c4a Mount with hal from command line 0 116 139 2009-06-04T05:23:35Z Erik 1 Copy from old wikitext text/x-wiki = Manually mounting a device using HAL from the command line = If you're like me, you probably live in the command line and prefer it way over those nasty and uncomfortable file managers. But you also live in a world were people lends you their USB sticks / Portable HDs to copy something. Then, you've probably also felt that there must be a better way to mount than the typical "dmesg|tail ; mount -t vfat,ntfs-3g what where" (and "what" tipically is /dev/sda1 and "where" might be /mnt/hd or something). The obvious solution to make that more streamlined is to use HAL. But part of HAL's ugliness is that there are only graphical tools to work with. Well, fortunatelly for us, XFCE comes with a little handy tool called "exo-mount" (and "exo-unmount") which does the dirty job of figuring out the HAL weird device name (another piece of HAL's ugliness), use the appropiate /usr/libexec/hal-* command (maybe via a DBUS message, I don't know) to create the mount point and mount the device as well as unmount the device and delete the mount point. The only problem is that you must still have lots of X/Gtk/Pango/... libraries installed (so it may not be a viable choice for an X-less system, but then you're probably not running a desktop but a server and shouldn't have HAL running). The usage is relatively simple: exo-mount -d /dev/sda1 # The usual "what" is /dev/sda1 and ''voila'' (if you have HAL running, that is). It should be mounted under /media/<Volume name>. To umount: exo-'''un'''mount -d /dev/sda1 And that's it... You still don't have console automounting (but there are many tutorials covering that, and personally I don't like it), but you're now using HAL to do your mount/unmount. [[Category:Tips]] 1ad5b0b8fcfd0d62bc68cb90712230dd876327de Mutt 0 117 140 2009-06-04T05:24:05Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] = Mutt = Mutt is a text-based mail client renowned for its powerful features and the fact that it is almost totally customizable. This article will cover the installation and configuration of mutt in order to use it as your daily email client. Please note that I use GMail as my primary email address, so the examples are designed for GMail users. Not much differs though other than the fact that GMail uses SSL. == Installation == Slackware comes with a package for mutt v1.4. If you did a full install, you already have it installed. If not, it can be located on the 'n' series on your Slackware install CD or favourite mirror. This tutorial also uses getmail, procmail and msmtp. procmail and getmail are available as Slackware packages, and can be installed in the same manner... If you have the CD, follow these steps as root to install it: mount /mnt/cdrom installpkg /mnt/cdrom/slackware/n/mutt-1.4.2.1i-i486-2.tgz installpkg /mnt/cdrom/slackware/n/getmail-4.4.4-noarch-1.tgz installpkg /mnt/cdrom/slackware/n/procmail-3.22-i486-1.tgz If you would rather install it from a mirror: wget http://www.slackware.at/data/slackware-current/slackware/n/mutt-1.4.2.1i-i486-2.tgz wget http://www.slackware.at/data/slackware-current/slackware/n/getmail-4.4.4-noarch-1.tgz wget http://www.slackware.at/data/slackware-current/slackware/n/procmail-3.22-i486-1.tgz installpkg mutt-1.4.2.1i-i486-2.tgz getmail-4.4.4-noarch-1.tgz procmail-3.22-i486-1.tgz Be sure to replace 'slackware-current' with the actual version of Slackware you are using. msmtp is not part of Slackware, and will need to be installed separately. It can be downloaded from [http://msmtp.sourceforge.net/ here]. If you need information on building Slackware packages, click [[Building_A_Package]] for an excellent tutorial. == Configuration == === Mutt === First, let start with mutt, and a very simple ''~/.muttrc'': # Name set realname='Slackware User' # Where we store our emails set folder=~/mail set mbox=+mbox set spoolfile=+inbox set record=+sent set postponed=+drafts set mbox_type=Maildir mailboxes +inbox # my favourite editor is 'joe' set editor=joe ignore * # this means "ignore all headers by default" # I still want to see some basic details unignore date from subject to cc # Mutt options set edit_headers=yes set hdrs # Allows us to create our own headers my_hdr From: Slackware User <user@slackware.com> my_hdr X-Mailer: `mutt -v| head -n 1` So far, it's simple, and cannot do much. We can almost read emails stored in ~/mail, compose and save drafts. In order for us to read emails, first, we need to create our mail folders. We are using the Maildir format, so we need to create them using: mkdir -p ~/mail/inbox/{,cur,tmp,new} mkdir -p ~/mail/sent/{,cur,tmp,new} mkdir -p ~/mail/drafts/{,cur,tmp,new} Now, when we have an email in ~/mail/inbox, we will be able to read it. Postponed messages will also be saved in ~/mail/drafts. But want to be able to send emails too, right? That's where msmtp comes into play. For this part, we will assume that msmtp is installed. msmtp is basically a SMTP client that will be called by mutt when sending an email. So we need to have added to the mutt config like this: set sendmail="/usr/bin/msmtp" Now, that's useless by itself. We need to setup msmtp to send emails... Open up ~/.msmtprc with your favourite editor. This is a copy of mine, setup to use GMail's smtp server: account default host smtp.gmail.com port 587 protocol smtp auth on from username@gmail.com user username@gmail.com password mypassword tls on tls_starttls on So, after going through this and identifying what we need for our SMTP server, we are ready to send emails... Let's test it: Launch mutt by running: mutt -y Running mutt without '-y' will ignore our mailboxes statement, so we won't see any emails... You can see in mutt the key shortcuts at the top of the screen: 'm' for composing a new message. After we save the message, we see a new shortcut at the top: 'y' to send the message. We now have mutt that can read emails from ~/mail/inbox, and send emails!!! The next step is to get the emails in ~/mail, and that's getmail's job. === Getmail === Getmail is a Python application that's included with Slackware. Similar to fetchmail, many people prefer it, saying it's easier to configure. Just like mutt, getmail is in the 'n' series, and should already be installed if you chose to do a full install. If not, just check out the mutt section above to install what's needed for this tutorial. Once we have it all installed, let's create a basic getmail configuration. This configuration sits in ''~/.getmail/getmailrc'': [retriever] type = SimplePOP3SSLRetriever server = pop.gmail.com username = username@gmail.com port = 995 password = password [destination] type = Maildir path = ~/mail/inbox If you use a standard POP3 account that doesn't use SSL, use something like: [retriever] type = SimplePOP3Retriever server = pop.isp.net username = username port = 110 password = password [destination] type = Maildir path = ~/mail/inbox As simple as that. Now, it will connect to your email account, and download all your emails to ~/mail/inbox. Please note that if you want to fetch mail for multiple accounts, unlike fetchmail, getmail works with a single account per config file. So if you have two email accounts, you can have each account configured in their own config file like ''~/.getmail/getmailrc'' and ''~/.getmail/getmailrc-isp'' If you want automatic check, just add the following lines to your crontab by running ''crontab -e'' for each one of your email accounts: /5 * * * * /usr/bin/getmail /30 * * * * /usr/bin/getmail -r ~/.getmail/getmailrc-isp === Procmail === Procmail is an advanced mail filtering solution. More to come == Todo == The rest... c57ce5f562f0609faad6a0a117180cc108fbc049 MySQL 0 118 141 2009-06-04T05:24:41Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] ==I installed the MySQL package, now what?== See [[Configuring MySQL]] for how to get [[mysqld]] running. ==How do I start mysqld?== As <b>root</b> type: <code>mysqld_safe &</code> ==How do I check that mysqld is running?== <code>ps aux</code> If it's running, you should see several lines of something like this:<br> :<code>mysql 14429 0.0 6.4 58056 15544 ? S 18:44 0:00 /usr/libexec/mysqld --basedi... blah blah</code><br> :<code>mysql 14430 0.0 6.4 58056 15544 ? S 18:44 0:00 /usr/libexec/mysqld --bas... blah blah</code><br> ==How do I login to the MySQL console client?== :<code>mysql -u root -p</code><br> :you will be prompted for root's password after which you will get the <code>mysql></code> prompt. ==How do I exit the MySQL console client?== :<code>exit;</code> ==How do I see what databases already exist?== :FROM SHELL: <code>echo "show databases;" | mysql -u root -p</code><br> :FROM A MYSQL CLIENT: <code>show databases;</code> ==How do I make a database?== :FROM SHELL: <code>mysqladmin -u root -p create database <i>databasename</i></code><br> :FROM A MYSQL CLIENT: <code>CREATE DATABASE <i>databasename</i>;</code> It will ask you for the root password and then it will create the database. ==How do I delete a database?== :FROM SHELL: <code>mysqladmin -u root -p drop database <i>databasename</i></code><br> :FROM A MYSQL CLIENT: <code>DROP DATABASE <i>databasename</i>;</code> ==How do I create a table in a database?== Now you are starting to get complex, see [[More MySQL]]. ==How do I connect to it?== You must add users to the database. :1) Log into mysqld as root: <code>mysql -u root -p</code><br> :: It will ask you for root's password, enter it. You will then get the <code>mysql></code> prompt<br> :2) Add the user at localhost: <code>GRANT <i>privileges (usually </i>ALL<i>)</i> PRIVILEGES ON <i>database</i>.* TO '<i>username</i>'@'localhost' IDENTIFIED BY '<i>password</i>';</code><br> ::<b>NOTES:</b><br> :::: a) Even if you only want pople to connect from remote machines, <b>you must first</b> give them privileges as localhost. This seems to be a MySQL quirk.<br> :::: b) To grant permissions on ALL databases, use <code>*.*</code> as the database name.<br> ::At this point, users should be able to connect and manipulate databases from localhost.<br> <b>FROM REMOTE MACHINES:</B> :3) Add permissions from remote machines: <code>GRANT <i>privileges (usually </i>ALL<i>)</i> PRIVILEGES ON <i>database</i>.* TO '<i>username</i>'@'<i>IP address or machine name</i>' IDENTIFIED BY '<i>password</i>';</code><br> :<b>EXAMPLE:</b> :::<code>mysql -u root -p</code><br> :::<i>enter password</i><br> :::<code>GRANT ALL PRIVILEGES ON mydatabase.* TO 'joebleau'@'localhost' IDENTIFIED BY 'mypassword';</code><br> :::<code>GRANT ALL PRIVILEGES ON mydatabase.* TO 'joebleau'@'192.168.1.2' IDENTIFIED BY 'mypassword';</code> :<b>-->GOTCHA<--</b> Sometimes domain name resolution can screw up your connections, if your machine has a name in the <code>/etc/hosts</code> file or the DNS system, you may encounter a problem. Watch for connection errors and note if they say something like <code>Connection for 'root'@'www.hawtsecks.com' is not allowed</code>. Even though the machine is really localhost, you may need to grant permissions to "root@www.hawtsecks.com" or even "root@192.168.2.42" depending on your situation. <b>CAN'T CONNECT FROM A REMOTE MACHINE</b> :If you are using programs to connect to your databases (e.g. Navicat, MySQLadmin, or web scripts) <b>from</b> a remote machine and you cannot get them to connect correctly, you should check: ::- Make sure that mysqld is running. ::- Make sure that your firewall isn't blocking the port (3306). ::- Make sure you have been GRANT'd on to the database <i>and from the correct machine address</i>(see above). ::- Make sure mysqld has networking on <b>-->SLACKWARE 10+ GOTCHA<--</b> ::::As of about Slackware 10.0, Patrick has set the <code>/etc/rc.d/rc.mysqld</code> script to start MySQL daemon with external connections ignored. To fix this, find the <code>/etc/rc.d/rc.mysqld</code> line that says <code>SKIP="--skip-networking"</code> and comment it out (put a "#" in front of it). ==How do I ________?== For more helpful MySQL tips, see [[More MySQL]]. 432eec569607c3da5450c5f5f258c8aae02ba71a NAT Script 0 119 142 2009-06-04T05:25:20Z Erik 1 Copy from old wikitext text/x-wiki <pre> #!/bin/sh # This is a very basic LAN NAT script, allowing only SSH to the firewall from # the external interface, allowing all outbound LAN traffic, and allowing only # established/related traffic back into the LAN. ipt=/usr/sbin/iptables extip=192.168.1.41 # replace with your EXTERNAL IP - eth0 lan=10.5.3.0/25 # your LAN CIDR range - eth1 # start firewall start_firewall() { echo "Enabling IP forwarding." echo 1 > /proc/sys/net/ipv4/ip_forward echo "Enabling iptables firewall." # default policies $ipt -P INPUT DROP $ipt -P FORWARD DROP # NAT $ipt -t nat -A POSTROUTING -o eth0 -j SNAT --to-source $extip # INPUT chain $ipt -A INPUT -i lo -j ACCEPT $ipt -A INPUT -i eth1 -s $lan -j ACCEPT $ipt -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT $ipt -A INPUT -p tcp --destination-port 22 -j ACCEPT # FORWARD chain $ipt -A FORWARD -i eth1 -s $lan -j ACCEPT $ipt -A FORWARD -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT } # stop firewall stop_firewall() { $ipt -P INPUT DROP $ipt -P OUTPUT DROP $ipt -P FORWARD DROP # allow internal traffic $ipt -A INPUT -i eth1 -j ACCEPT $ipt -A OUTPUT -o eth1 -j ACCEPT } # flushing, removing and zeroing tables reset_firewall() { chains=`cat /proc/net/ip_tables_names` for i in $chains; do $debug $ipt -t $i -F $debug $ipt -t $i -X $debug $ipt -t $i -Z done } case "$1" in start|restart|reload) reset_firewall start_firewall ;; stop) reset_firewall stop_firewall ;; *) echo "Usage: $0 {start|stop|restart|reload}" exit 1 ;; esac </pre> [[Category:Security]] fcceeb6d2d9a7dea4b35450decd71bf3a3ca5bdc NESSUS 0 120 143 2009-06-04T05:25:51Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] A simple guide on how to install Nessus on slackware 11.0 As you may know "Tenable" doesn't provide native packages for slackware, so we must do some tricks in order to run it. First go and grab the package for fedora core 4 (that's what I'll be using for this example).When you are done you have to convert this package to tgz , this is done by simply using the "rpm2tgz" utility, so you do something like: "'''rpm2tgz packagename.rpm'''". Then you should wait for a while ... after everything is done you must install the package: "'''installpkg packagename.tgz'''" After the package is installed, it places its files in /opt/nessus dir.Now you should do the following things: 1.Then you must copy all files from /opt/nessus/lib to /usr/local/lib and run the '''ldconfig''' utility in order to update the library list.(Only the files, not the "nessus" subfolder) 2.Now it's time for some symbol linking: 2.1 Go into /usr/lib dir and execute the following commands: '''ln -s libcrypto.so.0 libcrypto.so.5 ln -s libssl.so.0 libssl.so.5 ln -s libdb4-4.so libdb-4.3.so''' After you've done this you may try and run '''nessus-add-first-user''', then '''nessus-mkcrt''', and finally '''nessus -D''' I wish you luck.And I do not take any responsibility if you crash your system or something (Most probably it won't happen) Author: LordDoskias with a little help from iddqd You can contact me on irc.freenode.net @ ##slackware 3f450baa66cfcbe6a8a46f5c8b4298f4c47f827c NFS and Firewall 0 121 144 2009-06-04T05:26:18Z Erik 1 Copy from old wikitext text/x-wiki The most recent version of this document can always be found at: http://rlworkman.net/howtos/NFS_Firewall_HOWTO --rworkman This document is intended to give you detailed steps for making NFS bind to user-specified ports instead of random ports assigned by the portmapper. This makes it *much* easier to run a firewall on the NFS server, as you don't have to kludge something to find the NFS ports at each boot to open them with iptables. First, you'll want (it's not necessary, but handy to have for later) to make sure all of this is in /etc/services. I made sure "NFS" is in all of what I added or modified so that I can easily remove them (or just find them) if I need them later. bash-3.00# grep NFS /etc/services sunrpc 111/tcp rpcbind # SUN Remote Procedure Call sunrpc 111/udp rpcbind # SUN Remote Procedure Call mountd 861/udp # NFS mountd mountd 861/udp # NFS mountd rquotad 863/udp # NFS rquotad rquotad 863/tcp # NFS rquotad status 865/udp # NFS status (listen) status 865/tcp # NFS status (listen) status 866/udp # NFS status (send) status 866/tcp # NFS status (send) nfsd 2049/tcp # NFS server daemon nfsd 2049/udp # NFS server daemon lockd 4045/udp # NFS lock daemon/manager lockd 4045/tcp # NFS lock daemon/manager Next, you'll need to modify your /etc/rc.d/rc.nfsd script accordingly: For other linux distributions, find the script that starts these daemons and add the needed flags. * Make the quota daemon listen on port 863 if [ -x /usr/sbin/rpc.rquotad ]; then echo " /usr/sbin/rpc.rquotad -p 863" /usr/sbin/rpc.rquotad -p 863 fi * Make the mount daemon listen on port 861 if [ -x /usr/sbin/rpc.mountd ]; then echo " /usr/sbin/rpc.mountd -p 861" /usr/sbin/rpc.mountd -p 861 fi Now modify the /etc/rc.d/rc.rpc script (again, for other linux distros, find the script that starts this daemon and add the needed flags). On older versions (less than 11.0) of Slackware, rpc.statd is started in rc.nfsd, so look there instead. *Make the status daemon listen on port 865 and talk on port 866 - note that you'll have to open port 866 on the NFS clients if ! ps axc | grep -q rpc.statd ; then echo "Starting RPC NSM (Network Status Monitor): /sbin/rpc.statd -p 865 -o 866" /sbin/rpc.statd -p 865 -o 866 fi Finally, make the lock daemon listen on port 4045 only - note that this requires setting module loading parameters in /etc/modules.conf (for 2.4 kernels) or /etc/modprobe.conf (for 2.6 kernels) or /etc/modprobe.d/options (for newer 2.6 kernels with module-init-tools >=3.2.2; create this file if it doesn't already exist) - it won't hurt to set it in all of them. You'll need to add this line to the files referenced above. options lockd nlm_udpport=4045 nlm_tcpport=4045 Good luck - talk to me on IRC if you have trouble. [[Category:Tutorials]] 60259f70c4ee2162fa3830297f5914ddbd43be8e NTFS-3G 0 122 145 2009-06-04T05:26:59Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] [http://www.ntfs-3g.org/ NTFS-3G] is a fully functional NTFS writer/reader built as a userspace filesystem, thanks to the magic of [http://fuse.sourceforge.net/ FUSE]. For another way to get read/write support of NTFS filesystem, see [[Captive NTFS]]. Please note that the following instructions are made in such a way that it should be easy to [[SlackBuild Scripts|create a SlackBuild script]] or [[Building A Package|make a package]]. == Installing FUSE == Since [http://www.ntfs-3g.org/ NTFS-3G] is not implemented as a kernel module, it has to find ways to communicate with the kernel and make its services as a filesytem available to any other process. To do this, it uses a library called [http://fuse.sourceforge.net/ FUSE] (which stands for Filesystem in Userspace). Slackware 11.0's 2.6.17.13 kernel already has FUSE support compiled, but the version which comes with this kernel lacks a few features (such as proper block devices handling) and that seems to annoy NTFS-3G, so we'll begin by installing a newer FUSE. If you have FUSE already installed, please check that it is at least 2.6.0 with this command: $ sudo /sbin/modprobe fuse $ dmesg | grep fuse kernel: fuse init (API version 7.8) kernel: fuse distribution version: '''2.6.0''' If it doesn't print the ''distribution version'' line then you have a version older than 2.6. === Getting FUSE to work === You have to make sure that the version of FUSE you're downloading is &ge; 2.6.0 and &ne; 2.6.2, unless you like annoying warnings and malfunctioning filesystems. I prefer to do my building in a /tmp folder, so I'll start with this: mkdir /tmp/fusebuild cd /tmp/fusebuild First, you have to get the most recent version (at the time of writing, 2.6.3): wget http://superb-west.dl.sourceforge.net/sourceforge/fuse/fuse-2.6.3.tar.gz (There are several other mirrors. You can go to [http://sourceforge.net/project/showfiles.php?group_id=121684&package_id=132802 SF.net's download page] to find another mirror.) Then you can extract the source. tar zxf fuse-2.6.3.tar.gz cd fuse-2.6.3 Before compiling, you have to make sure that your kernel sources and .config matches your running kernel. If you've build your own kernel (and haven't touched the source since then) then you should be fine. Otherwise, if you're running Slack's binary kernels, you'll have to install [http://packages.slackware.it/search.php?v=11.0&t=1&q=%22kernel-source%22 the kernel source]. Usually, that's enough. Should you have some other kernel-related trouble, check out the [http://fuse.sourceforge.net/ FUSE homepage]. Now, you can compile your fuse library/tools/module # You might want to change the CFLAGS or the --with-kernel path # Also, take note of the --exec-prefix=/ this allows you to have # /usr mounted later (or even as an NTFS partition, but why would # you want that?) and still mount NTFS drives. You may as well # remove it, and everything will get in /usr/* CFLAGS="-O2 -march=i486 -mtune=i686" ./configure \ --enable-kernel-module \ --with-kernel=/lib/modules/$(uname -r)/build \ --enable-lib \ --enable-util \ --enable-example \ --localstatedir=/var \ --sysconfdir=/etc \ --prefix=/usr \ --exec-prefix=/ \ --program-prefix= \ --profram-suffix= \ i486-slackware-linux make # Do the following steps as root: make install # This is only necesary if you didn't change/remove # the --exec-prefix option at configure time. mv /lib/pkgconfig/* /usr/lib/pkgconfig/ rmdir /lib/pkgconfig cat > /etc/udev/rules.d/99-fuse.rules <<_EOF_ KERNEL=="fuse", MODE="0666" _EOF_ # Note that fuse will also put some stuff in /etc/init.d, let's # put it where it belongs. mv /etc/init.d/fuse /etc/rc.d/rc.fuse rmdir /etc/init.d # You might also want to add this at the bottom of # /etc/rc.d/rc.modules: # [ -x /etc/rc.d/rc.fuse ] && /etc/rc.d/rc.fuse start If you're making a slackbuild or building a package, instead issue: mkdir -p /tmp/tmproot make install DESTDIR=/tmp/tmproot # Also prepend /tmp/tmproot to the paths references which come after # that. You may have to actually create some of those paths. To make sure that everything is working so far, let's run a simple test (as root): cd example mkdir /tmp/mntpoint # Run this as root. ./hello /tmp/mntpoint & #you can add a "-d" flag if you want to see what's goinng on. ls -l /tmp/mntpoint # You should see something like this: # total 0 # -r--r--r-- 1 root root 13 Jan 1 1970 hello cat /tmp/mntpoint/hello # It should print the famous "Hello, World!". # If it did, then FUSE is working as it should. # Run this also as root. fusermount -u /tmp/mntpoint rmdir /tmp/mntpoint cd .. If everything is fine so-far, you can delete the cruft left behind: cd rm -rf /tmp/fusebuild == Installing NTFS-3G == Now you should be ready to install NTFS-3G. Again, let's begin by making a build directory: mkdir /tmp/ntfs-3gbuild cd /tmp/ntfs-3gbuild === Getting the greatest & latest === Then we can get the latest NTFS-3G. Note that there are usually two or three releases per month, so make sure to check [http://www.ntfs-3g.org/ the homepage] to get the latest version. wget http://www.ntfs-3g.org/ntfs-3g-0.20070207-RC1.tgz === Configuring and compiling === Compiling NTFS-3G is actually quite easy, it is one of those programs were compiling "just works". First, you have to untar the source: tar zxf ntfs-3g-0.20070207-RC1.tgz cd ntfs-3g-0.20070207-RC1 Next, let's configure the sources: CFLAGS="-O2 -march=i486 -mtune=i686" ./configure \ --prefix=/usr \ --exec-prefix= \ --program-prefix= \ --program-suffix= \ i486-slackware-linux That usually works without problems, unless you are missing libfuse. If so, you must see the above steps on configuring FUSE. Now compile and install. make make install # If you're making a package or a slackbuild, you will have to issue the next trick to avoid some st*pid error: # # make install LDCONFIG=/bin/true DESTDIR=$YOUR_ROOT_DIR # # also, you'll have to make sure that the mount.ntfs-3g.8 symlink points to the right (maybe gzipped) ntfs-3g.8 file. And that's pretty much it. == Mounting with NTFS-3G == So, how to mount something? NTFS makes mounting NTFS filesystems as easy as with other filesystems: root@damned-02# mount -t ntfs-3g /dev/sda1 /mnt/pendrive If you fail to see some files which you know are there, you should try using the locale option, specially if that partition is used by a non-english Windos. For example: :For some reason I don't know, My WinXP in Spanish uses en_US for character encoding (not even en_US.utf8), to see my files with "special" chars (mostly &aacute;, &eacute;, &iacute;, &oacute;, &uacute; and &ntilde;) I have to use: root@damned-02# mount -t ntfs-3g -o '''locale=en_US''' /dev/sda1 /mnt/pendrive The only way I know to find the right locale is to do some trial and error. If when you mount without locale, it shows all your files, then your correct locale is the one printed by echo $LANG To see which locales you have support for (there are 342 in Slack 11.0), type locale -a | less === Using /etc/fstab === You can use /etc/fstab to mount ntfs partitions at boot time. For example, my laptop's fstab looks like this: /dev/hda1 swap swap defaults 0 0 /dev/hda3 / jfs defaults 1 1 /dev/hda4 /home jfs noatime 1 2 /dev/hda2 /mnt/win ntfs-3g dmask=0007,fmask=0117,gid=6,locale=en_US 1 0 /dev/cdrom /mnt/cdrom auto noauto,group,ro 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 proc /proc proc defaults 0 0 This gives read/write access to anyone in the disk group (gid=6) to the NTFS partition at hda2 mounted in /mnt/win. Note, though, that "mount" reports the filesystem as "fuseblk" (unless you have a version of fuse &lt; 2.6 which won't allow you to mount block devices anyway). === Allowing users === NTFS-3G can let users other than root mount NTFS filesystems, but you'll have to set the suid flag in /bin/ntfs-3g. This applies <b>even when using fstab</b> with the ''users'' option. So for this to work: /dev/sda1 /mnt/pendrive ntfs-3g noauto,users 0 0 You have to do (as root): # chmod 4755 /bin/ntfs-3g == RTFMs == If you have any problems or doubts: *http://www.ntfs-3g.org/ *:spec. http://www.ntfs-3g.org/support.html *http://www.linux-ntfs.org *http://fuse.sourceforge.net If you find any error in this tutorial, don't forget this is a wiki and don't hesitate fixing or updating or improving or ... bb7236739d73d332f6dbd515eb46cf5ba20484a2 NVIDIA Graphics 0 123 146 2009-06-04T05:27:35Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Hardware]] = Introduction = There are three main drivers for nvidia graphics card on linux, one of which is shipped with slackware: * nv (shipped with slackware) - this provides basic 2d acceleration, not 3d * nvidia (NVidia's proprietary driver) - this is the generally recommended driver, providing good 2d and 3d performance * nouveau - an attempt to reverse-engineer the nvidia driver; not particular usable or stable This article assumes you want the 'nvidia' driver; if you do not, generic (IE not slackware-specific) documentation available. = Obtaining the driver = The driver can be found at [http://www.nvidia.com/object/unix.html]. = Installing the driver = The driver must not be installed while X is running; if X is running, stop X, install the driver, then start X again how you normally would (eg "telinit 4", or "startx"). Download the driver, then "sh FILENAME.run" in the directory you downloaded it do, replacing "FILENAME" with the name of the file you downloaded. == XOrg config == There are two options: === nvidia-xconfig === This is an automated tool, that the above installer offers to run for you. It attempts to modify your XOrg.conf automatically to use the nvidia driver. === Manual Editing === Find the section relating to your graphics card in /etc/X11/xorg.conf, and change the driver to "nvidia". If you want to change the default settings, for example, add dual-head support, see the readme installed into /usr/doc/NVIDIA_GLX-1.0/. = Checking It's Working = * Check "nvidia-settings" runs in X * Check "glxinfo | grep direct" returns "direct rendering: Yes" * Check "glxgears" gives a reasonable result (google for comparisons) Pay close attention to specific model of graphics card when checking for suitable glxgears results; keep in mind that glxgears isn't really a good 'benchmark', but should indicate if DRI is working properly or not. For example: * On an Intel X3100, a good result is somewhere around 1000 FPS * On an NVidia 7800GTX, a good result is somewhere above 12000 (though 15k is fairly normal) c285d7d7e02d6b2a7668b15fac70e0131ddabf81 NVIDIA-Prompted-Kernel-Compile 0 124 147 2009-06-04T05:28:04Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] === nVidia Graphics Driver Installation & Kernel Recompile in Slackware 12.0 === ====Warning!==== ---- :Please do all this at your own risk. If you change your kernel and cause any damage to your system, you and only you are responsible for it. By providing this tutorial I do not take any responsibility for any damages or losses to your system. This is a disclaimer! ==== Background Info & Rationale for Kernel Recompile ==== ---- :I recently bought a used ''Geforce N6200'' video card (nvidia chipset) to replace the ''ATI Radeon 9200SE'' that suddenly died on me. I ran Xorg configuration utility ''xorgconfig'' to set the new card up. Slackware 12.0 ships with a generic ''nv'' driver for nvidia cards, but it does not support graphics acceleration and/or direct rendering. That means no games and no graphic heavy websites. Fortunately, nvidia provides a Linux binary driver for your video card that will do direct rendering and 3D acceleration just fine, although the driver is closed-source. But hey, at least it works. :Assuming that you're running Slackware 12.0 and using huge generic kernel 2.6.21.5 or newer or the smp version of it, you are going to face some problems compiling the nvidia driver against that kernel. The nvidia installer utility compiles the binary driver to suit your kernel. In Slackware 12.0 the support for Riva framebuffer is enabled by default in the huge-2.6.21.5 and huge-2.6.21.5-smp kernels and it is a problem for the nvidia installer utility. As soon as it notes the riva support enabled in the kernel header files, it quits and the driver module compilation fails. Most people will experience this problem in Slackware 12.0. The solution is to disable riva framebuffer support from the kernel and recompile it. :At the end of this tutorial you will have a fresh kernel compiled for your system, the nvidia driver compiled against this kernel and installed as kernel module and 3D graphics acceleration as well as direct rendering enabled. So let's begin taking one thing at a time. ==== Back Up Current Kernel & Kernel Modules ==== ---- :It is important that you have a backup of your currently working kernel modules so if the new kernel fails, you would still be able to use the old kernel to boot the system. Let's play safe. Important: All steps in this tutorials are done as superuser. cd /lib/modules ls 2.6.21.5 2.6.21.5-smp :Above currently installed kernels on your system are listed. Rename the kernel you're using to something like ''kernel-name''.backup. If you do not know which kernel you're using, do the following. The output of it should list the kernel you're using. Once you find it out, rename it as follows. uname -a Linux 2.6.21.5 #1 Sun Mar 16 14:46:57 CDT 2008 i686 AMD Athlon(tm) AuthenticAMD GNU/Linux mv 2.6.21.5 2.6.21.5-backup ls 2.6.21.5-smp 2.6.21.5-backup ==== Kernel Configuration and Recompile ==== ---- :Now that we have a backup of our current kernel and its modules, its time to proceed with configuration and recompiling the kernel. Change to the kernel source directory and copy the current kernel config file to the kernel source directory cd /usr/src/linux cp /boot/config .config #Note that config in /boot has no dot before it, but when we copy it, we include a dot prefix. This step will copy your current configuration so we can use it as a reference for further steps. Now let's begin kernel configuration make menuconfig This should give you a nice ''ncurses'' style detailed graphical menu of kernel configuration. Select Device Drivers > Graphics Support > :Scroll down to ''Riva Framebuffer Support'' (not ''nvidia Riva Support'') and press space bar twice. First space bar press will change the <M> to <*> and second will change <*> to < > (blank). Now press ''exit'' three times. The menuconfig will ask you if you want to save the changes. Select ''Yes'' and quit. We have now removed Riva Framebuffer Support from kernel configuration, the culprit for failing nvidia driver module compilation. :It's time to compile the kernel. Do the following: make bzImage :This is a good time to take a break for any of these: Coffee / Tea / Cigarette / Quick run to the grocery store. In short, depending upon how fast your procesor is, this step will take anywhere between 15 minutes to an hour. If everything goes fine, it will compile a new kernel and install newly compiled modules in /lib/modules/. If you get errors, something went wrong and you'll need to get some help from kernel documentation or ask in ##slackware on IRC host ''freenode.net'' :Now that we have a kernel compiled, its time to compile and install kernel modules make modules && make modules_install :Again, this step will take some time. But it will be worth the wait. In the basic kernel, there is close to 1000 modules that need to be compiled. Once this step is finished and you did not get any errors, its time to make sure the kernel bzImage was created and the modules were installed to the appropriate location. pwd /usr/src/linux cd arch/i386/boot pwd /usr/src/linux/arch/i386/boot ls Makefile bootsect.S '''bzImage''' edd.S mtools.conf.in setup.S tools vmlinux.bin bootsect bootsect.o compressed install.sh setup setup.o video.S :bzImage is your newly compiled kernel without Riva framebuffer support. cd /lib/modules ls 2.6.21.5 2.6.21.5-smp 2.6.21.5-backup The first entry above is the location of your newly installed kernel modules. ==== Install New Kernel And Update lilo.conf ==== ---- :Time to install the new kernel and notify your boot loader of its existence. cd /usr/src/linux/arch/i386/boot cp bzImage /boot :Open your favorite text editor and add following lines to your boot loader (typically /etc/lilo.conf) cd /etc emacs -nw lilo.conf #Linux bootable partition config begins image = /boot/bzImage root = /dev/hda2 #or whatever partition your / is located on label = New-Kernel #You can name it whatever you want. Just don't name it the same as the old kernel #Linux bootable partition config ends :Save file, close it and run lilo so the new changes take effect. lilo Added *Linux Added *New-Kernel :Excellent! It's time to test the new kernel. When you reboot, lilo will now present you with two choices for kernel, use the New-Kernel and boot. If somehow it fails, you can always go back to the old kernel. Just rename the /lib/modules/2.6.21.5-backup as 2.6.21.5 and rename the new kernel modules as something else. You see how important it was for us to backup the kernel as well as kernel modules in the beginning? :Assuming that your new kernel booted just fine and you had a fully functional system back up, its time to get the nVidia graphics driver from nvidia.com and install it. The current incarnation of nVidia driver is version # 169.12. Either use your favorite browser to download the driver from http://www.nvidia.com/Download/index.aspx?lang=en-us or do the following: cd /tmp wget http://us.download.nvidia.com/XFree86/Linux-x86/169.12/NVIDIA-Linux-x86-169.12-pkg1.run Make the installer utility executable and execute it chmod 755 NVIDIA-Linux-x86-169.12-pkg1.run ls -la -rwxr-xr-x 1 user groupname 17636559 2008-03-17 13:06 NVIDIA-Linux-x86-169.12-pkg1.run Before we execute it, we need to exit the X server. telinit 3 #This changes runlevel to 3, shuts down the X server and drops you off at the terminal sh ./NVIDIA-Linux-x86-169.12-pkg1.run :This installer utility first tries to find a pre-compiled driver for your kernel which it would not find, then it tries to download it via ftp from nvidia servers which fails too, and finally it proceeds to compile the driver kernel module against your newly installed bzImage kernel. This time, there is no riva framebuffer in the kernel header files and so this step should not fail. Should it fail, ask for help in your local LUG or the highly knowledgeable folks at ##slackware in irc channel freenode.net ==== Updating X.Org Configuration File ==== ---- :After the installer utility finishes compiling and installing kernel module for the nvidia driver, it will ask you if you want it to make appropriate changes to your /etc/X11/xorg.conf. I personally chose not to, because I did not want my already customized xorg.conf to be messed with by a third party software. I simply changed the driver name from '''nv''' to '''nvidia''' in the <device> section of /etc/X11/xorg.conf :That's it folks. You now have a new kernel, new kernel modules and nvidia driver with 3D acceleration and direct rendering. Check direct rendering as follows: glxinfo | grep dri :Third line of the output should tell you that Direct Rendering has been enabled. Now its time to fire up X server and check your new driver. telinit 4 :This should launch X server, you should be seeing a flash of nvidia screen and then back to your favorite window manager. If everything went fine, you should go ahead and check video performance with some game, or a graphics intensive website or such. ==== Acknowledgements ==== ---- :This article benefited substantially by input from ##slackware (irc.freenode.net) user '''InspectorCluseau''' :If you have any questions or if you find a mistake in this tutorial, please contact me at [mailto:crypticlineage@gmail.com] b215dfaa343899f8728191f252eb1737761e044b Networking 101 0 125 148 2009-06-04T05:28:45Z Erik 1 Copy from old wikitext text/x-wiki This link is Alan Hicks' "Networking 101" class. http://www.lizella.net/networking_101.txt [[Category:Tutorials]] ca3d24cd3965a14cdc64a5939a9ad5867eea4228 NTPD 0 126 149 2009-06-04T05:29:28Z Erik 1 Copy from old wikitext text/x-wiki '''ntpd (Network Time Protocol Daemon)'''<br> The ntpd program is an operating system daemon which sets and maintains the system time of day in synchronism with Internet standard time servers. It is a complete implementation of the Network Time Protocol (NTP) version 4, but also retains compatibility with version 3, as defined by RFC-1305, and version 1 and 2, as defined by RFC-1059 and RFC-1119, respectively. '''Automating the time synchronization'''<br> You have two choices for automatic time updating, you can run ntpd all the time as a background process or you can have it run once in awhile (if you are tight on system resources). Running ntpd all the time-<br> ::Just enable rc.ntpd script: ::::<code>chmod +x /etc/rc.d/rc.ntpd</code> ::After the script is enabled you probably will want ntpd to start immediately so, can either restart the system or manually start ntpd with: ::::<code>/etc/rc.d/rc.ntpd start</code> Running ntpd once in awhile-<br> ::You have many choices but the two best ones are: :::1) Set up a cron job :::2) Set up a /etc/rc.d/rc.local entry and update the time on start-up only. ::Either way, you need to add the following commands into your cron job or rc.local script: ::::<code>ntpdate -o 4 pool.ntp.org</code> <---(updates the time) ::::<code>hwclock --systohc</code> <-----------------(saves the time to the hardware clock) '''Manually updating the time'''<br> Issue the following commands: ::::<code>ntpdate -o 4 pool.ntp.org</code> ::::<code>hwclock --systohc</code> '''Choosing the right time server'''<br> On ntp.org you will find a complete list with the right time server for you. Let's say you live in germany, then you will choose <code>de.pool.ntp.org</code>. A complete List is available at http://support.ntp.org/bin/view/Servers/NTPPoolServers '''DST changes'''<br> If your time is off due to DST changes, you must update the <code>/etc/localtime</code> file. You should be able to find a correct file on the internet and just replace the old <code>/etc/localtime</code> file. NOTE: Slackware 11 is immune to the 2007 DST changes. '''Possible Errors & Fixes'''<br> ERROR: "Unable to contact time server:" error with KDE time Control Module.<br> FIX: Make sure ntpd is NOT running. If ntpd is running, manual ntp and KDE ntp updates will return errors due to ntpd having control of the ntp port. [[Category:Tutorials]] 9e7d314e29cb984ea5d205b6d027e7a0b4274e3f OpenVPN 0 127 150 2009-06-04T05:29:57Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] As a user-space VPN daemon, OpenVPN is compatible with with SSL/TLS, RSA Certificates and X509 PKI, NAT, DHCP, and TUN/TAP virtual devices. OpenVPN is not compatible with IPSec, IKE, PPTP, or L2TP. __TOC__ == Instalasi == Download source dari [http://openvpn.net openvpn.net] download versi 2.0 instalasi Lzo <pre> tar zxvf lzo-1.08.tar.gz cd lzo-1-08.tar.gz ./configure --prefix=/usr make ; make install-strip </pre> insalasi OpenVPN <pre> tar zxvf openvpn-2.0.tar.gz cd openvpn-2.0 ./configure --prefix=/usr \ --sysconfdir=/etc/openvpn \ --enable-pthread \ --enable-iproute2 \ --with-ssl \ --with-lzo-header=/usr/include \ --with-lzo-lib=/usr/lib \ --with-ifconfig \ --with-route \ --with-mem-check=dmalloc make ; make install-strip </pre> == Konfigurasi == ==Konfigurasi Sertifikat== Simpan seluruh sertifikat di '''''/etc/openvpn/certs''''' <pre> This is a small RSA key management package, based on the openssl command line tool, that can be found in the easy-rsa subdirectory of the OpenVPN distribution. These are reference notes. For step by step instructions, see the HOWTO: http://openvpn.net/howto.html INSTALL 1. Edit vars. 2. Set KEY_CONFIG to point to the openssl.cnf file included in this distribution. 3. Set KEY_DIR to point to a directory which will contain all keys, certificates, etc. This directory need not exist, and if it does, it will be deleted with rm -rf, so BE CAREFUL how you set KEY_DIR. 4. (Optional) Edit other fields in vars per your site data. You may want to increase KEY_SIZE to 2048 if you are paranoid and don't mind slower key processing, but certainly 1024 is fine for testing purposes. KEY_SIZE must be compatible across both peers participating in a secure SSL/TLS connection. 5 . vars 6. ./clean-all 7. As you create certificates, keys, and certificate signing requests, understand that only .key files should be kept confidential. .crt and .csr files can be sent over insecure channels such as plaintext email. 8. You should never need to copy a .key file between computers. Normally each computer will have its own certificate/key pair. BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY 1. ./build-ca 2. ca.crt and ca.key will be built in your KEY_DIR directory BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) 1. ./build-inter inter 2. inter.crt and inter.key will be built in your KEY_DIR directory and signed with your root certificate. BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). 1. ./build-dh BUILD A CERTIFICATE SIGNING REQUEST (If you want to sign your certificate with a root certificate controlled by another individual or organization, or residing on a different machine). 1. Get ca.crt (the root certificate) from your certificate authority. Though this transfer can be over an insecure channel, to prevent man-in-the-middle attacks you must confirm that ca.crt was not tampered with. Large CAs solve this problem by hardwiring their root certificates into popular web browsers. A simple way to verify a root CA is to call the issuer on the telephone and confirm that the md5sum or sha1sum signatures on the ca.crt files match (such as with the command: "md5sum ca.crt"). 2. Choose a name for your certificate such as your computer name. In our example we will use "mycert". 3. ./build-req mycert 4. You can ignore most of the fields, but set "Common Name" to something unique such as your computer's host name. Leave all password fields blank, unless you want your private key to be protected by password. Using a password is not required -- it will make your key more secure but also more inconvenient to use, because you will need to supply your password anytime the key is used. NOTE: if you are using a password, use ./build-req-pass instead of ./build-req 5. Your key will be written to $KEY_DIR/mycert.key 6. Your certificate signing request will be written to to $KEY_DIR/mycert.csr 7. Email mycert.csr to the individual or organization which controls the root certificate. This can be done over an insecure channel. 8. After the .csr file is signed by the root certificate authority, you will receive a file mycert.crt (your certificate). Place mycert.crt in your KEY_DIR directory. 9. The combined files of mycert.crt, mycert.key, and ca.crt can now be used to secure one end of an SSL/TLS connection. SIGN A CERTIFICATE SIGNING REQUEST 1. ./sign-req mycert 2. mycert.crt will be built in your KEY_DIR directory using mycert.csr and your root CA file as input. BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY -- this script generates and signs a certificate in one step, but it requires that the generated certificate and private key files be copied to the destination host over a secure channel. 1. ./build-key mycert (no password protection) 2. OR ./build-key-pass mycert (with password protection) 3. OR ./build-key-pkcs12 mycert (PKCS #12 format) 4. OR ./build-key-server mycert (with nsCertType=server) 5. mycert.crt and mycert.key will be built in your KEY_DIR directory, and mycert.crt will be signed by your root CA. If ./build-key-pkcs12 was used a mycert.p12 file will also be created including the private key, certificate and the ca certificate. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. (4) Sign server certificates with one CA and client certificates with a different CA. The client config "ca" directive should reference the server-signing CA while the server config "ca" directive should reference the client-signing CA. NOTES Show certificate fields: openssl x509 -in cert.crt -text </pre> <pre> # cd easy-rsa # vi vars . vars ./clean-all ## BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY ./build.ca ## BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) ./build-inter inter ## BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). ./build.dh ## BUILD A CERTIFICATE SIGNING REQUEST ## (If you want to sign your certificate with a root certificate controlled by another individual ## or organization, or residing on a different machine) ./build-req mycert ## SIGN A CERTIFICATE SIGNING REQUEST ./sign-req mycert ## BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY ./build-key mycert (no password protection) OR ./build-key-pass mycert (with password protection) OR ./build-key-pkcs12 mycert (PKCS #12 format) OR ./build-key-server mycert (with nsCertType=server) </pre> ==Konfigurasi Server== edit server.conf '''''vi /etc/openvpn/server.conf''''' <pre> ## Mode Server mode server ## Local Host Name/IP Server ;local 127.0.0.1 ## Protocol ;proto tcp proto udp ## Port ; port 1194 ## Device Interface ;dev tap dev tun ## TAP-Win32 adapter name ;dev-node MyTap ## SSL/TLS ## root certificate (ca) ## certificate (cert) ## private key (key) ca /etc/openvpn/certs/ca.crt cert /etc/openvpn/certs/server.crt key /etc/openvpn/certs/server.key ## Diffie hellman parameters dh dh1024.pem ## VPN subnet server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt ##ethernet bridging ;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100 ## dhcpcaveats ;push "route 192.168.10.0 255.255.255.0" ;push "route 192.168.20.0 255.255.255.0" ;client-config-dir ccd ;route 192.168.40.128 255.255.255.248 ;client-config-dir ccd ;route 10.9.0.0 255.255.255.252 ;learn-address ./script ## dhcpcaveats ;push "redirect-gateway" ;push "dhcp-option DNS 10.8.0.1" ;push "dhcp-option WINS 10.8.0.1" ## ;client-to-client ## same "COMMON NAME" certificate/key ;duplicate-cn ## Status Connection keepalive 10 120 ## tls-auth key ;tls-auth ta.key 0 ## Cryptographic cipher ;cipher BF-CBC # Blowfish (default) ;cipher AES-128-CBC # AES ;cipher DES-EDE3-CBC # Triple-DES ## Link Compresion comp-lzo ## Max Client Connections ;max-clients 100 ## daemon privileges (non windows saja) user nobody group nobody persist-key persist-tun ## Openvpn Log ;log /var/log/openvpn/openvpn.log ;log-append /var/log/openvpn/openvpn.log ## Output Log status /var/log/openvpn/openvpn-status.log ## Log Verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## Repeating Messages ;mute 20 ## Pid File writepid /var/run/openvpn.pid </pre> '''Routing''' <pre> echo 1 > /proc/sys/net/ipv4/ip_forward route add -net 10.0.1.0 netmask 255.255.255.0 gw 10.4.0.2 </pre> '''Firewall''' <pre> iptables -A INPUT -p udp -s 1.2.3.4 --dport 1194 -j ACCEPT OR iptables -A INPUT -p udp --dport 1194 -j ACCEPT ## Tun Device iptables -A INPUT -i tun+ -j ACCEPT iptables -A FORWARD -i tun+ -j ACCEPT ## Tap Device iptables -A INPUT -i tap+ -j ACCEPT iptables -A FORWARD -i tap+ -j ACCEPT </pre> ==Konfigurasi client== edit file client.conf '''''vi /etc/openvpn/client.conf''''' <pre> ## Config client ## Device Interface ;dev tap dev tun ## Tap adapter name (Win only) ;dev-node MyTap ## Conectivity ;proto tcp proto udp ## Server [hostname/ip] [port] remote my-server-1 1194 ;remote my-server-2 1194 ## load-balancing ;remote-random ## resolve host name OpenVPN server resolv-retry infinite # local port nobind ## privileges (non windows saja) user nobody group nobody ## preserve persist-key persist-tun ## HTTP proxy ;http-proxy-retry ;http-proxy [proxy server] [proxy port] ## duplicate packet warnings ;mute-replay-warnings ## SSL/TLS parms /etc/openvpn/certs/ca ca.crt /etc/openvpn/certs/cert client.crt /etc/openvpn/certs/key client.key ## nsCertType key ;ns-cert-type server ## tls-auth key ;tls-auth /etc/openvpn/certs/ta.key 1 ## Cryptographic cipher ;cipher x ## Link compression comp-lzo ## verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## repeating messages ;mute 20 </pre> '''Routing''' <pre> route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.4.0.1 </pre> ==Example== '''Example 1:''' A simple tunnel without security<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9 </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 2:''' A tunnel with static-key security (i.e. using a pre-shared secret)<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --verb 5 --secret key </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --verb 5 --secret key </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 3:''' A tunnel with full TLS-based security <br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --tls-client --ca tmp-ca.crt --cert client.crt --key client.key \ --reneg-sec 60 --verb 5 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --tls-server --ca tmp-ca.crt --cert server.crt --key server.key \ --reneg-sec 60 --verb 5 --dh dh1024.pem </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 == External Links == * http://dmalloc.com/ * http://valgrind.org/ * http://www.oberhumer.com/opensource/lzo/ * http://openvpn.net/ * http://openvpn.net/howto.html * http://openvpn.net/1xhowto.html (Old-v1.06) * http://openvpn.net/man.html a1601b7ee4db3b7301b533a706c6829931779591 Main Page 0 1 151 40 2009-06-06T21:14:42Z Erik 1 Updating the Notice with a new link and completion progress wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==NOTICE== After a long time and numerous upgrades, the DB finally caved in on itself. This is a fresh start. [http://slackwiki.org/old/index.php?title=Special:AllPages The old Wiki can be found here.] The data is still there, any help copying the old pages over here to the new Wiki would be greatly appreciated. UPDATE: Pages beginning with letters A through O have been copied. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 26a20c5fecca7229dab9f0df98029cbb2f9219b6 Perl 0 128 152 2009-06-06T21:16:12Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] ==mod_perl and Apache== Here is a guide to installing mod_perl on Apache (out of the box, Slackware 12.0 runs perl as a cgi script): [[mod_perl|Mod_perl on Slackware 12.0]] ==Embedded Perl== Embedded Perl is a way you can put a chunk of perl code in the middle of an html file, and apache will run the perl code and put it's results at that point in the html before it sends the page to the remote browser. It's older and a bit arcane, most people would use mod_perl or cgi perl these days. [[embedded_perl|Embedded Perl on Slackware 12.0]] ==Modules== [[Perl_Modules|How to deal with Perl Modules]] 02f2783b3798ed2a7b6491f9319cffd3dd728ae8 Perl Modules 0 129 153 2009-06-06T21:17:50Z Erik 1 Copy from old, had no category, placed in Tutorials wikitext text/x-wiki [[Category::Tutorials]] ==Getting To The CPAN Prompt== To administer your Perl modules you must use the CPAN prompt. To get to the CPAN prompt, <b>as root</b> type: ::<code>perl -MCPAN -e shell</code> If this is the first time that you have entered the CPAN shell, you will be asked some set-up questions that will allow the shell to access CPAN's servers to get modules. Just read the questions and answer them. If you ever need to re-run the set-up again, enter the CPAN shell and then type: ::<code>o conf init</code> ==Listing The Installed Modules== As of Slackware 10.2 and Perl 5.8.7- you can look the <code>perllocal.pod</code> file and see the modules. ::<code>cat /usr/lib/perl5/5.8.7/i486-linux/perllocal.pod</code> A much cleaner way is by using this Perl program: ::<code>#!/usr/bin/perl</code> ::<code>use ExtUtils::Installed;</code> ::<code>my $instmod = ExtUtils::Installed->new();</code> ::<code>foreach my $module ($instmod->modules())</code> :::<code>{</code> :::<code>my $version = $instmod->version($module) || "???";</code> :::<code>print "$module -- $version\n";</code> :::<code>}</code> ==Installing New Modules== From the CPAN shell prompt, type: ::<code>install &lt;Some::Module&gt;</code> ==Removing Modules== A clean way is by using this Perl program: ::<code>#!/usr/bin/perl -w</code> ::<code>use ExtUtils::Packlist;</code> ::<code>use ExtUtils::Installed;</code> ::<code>$ARGV[0] or die "Usage: $0 Module::Name\n";</code> ::<code>my $mod = $ARGV[0];</code> ::<code>my $inst = ExtUtils::Installed->new();</code> ::<code>foreach my $item (sort($inst->files($mod)))</code> :::<code>{</code> :::<code>print "removing $item\n";</code> :::<code>unlink $item;</code> :::<code>}</code> ::<code>my $packfile = $inst->packlist($mod)->packlist_file();</code> ::<code>print "removing $packfile\n";</code> ::<code>unlink $packfile;</code> b779469519919769a118b9e2c2cd1da10a9a4255 PaRisc CrossCompile 0 130 154 2009-06-06T21:19:30Z Erik 1 Copy from old, had no category, placed in Tutorials wikitext text/x-wiki [[Category:Tutorials]] Cross compiler setup instructions ================================= Work in progress, a script to build the hppa-linux compiler toolchain on Slackware #!/bin/bash export TARGET=hppa-linux export MACH=i686-linux export DEST=/usr/local export SRC=~/pabuild mkdir -p $DEST $SRC mkdir -p $DEST/include cd $SRC mkdir binutils-build mkdir gcc-build mkdir glibc-build mkdir linux # Extract binutils tar -zxvf binutils-<version>.tar.gz cd binutils-build ../binutils/configure --target=$TARGET --prefix=$DEST/hppa-linux --host=$MACH --disable-nls make make install cd .. # Extract gcc tar -zxvf gcc-3.4.6.tar.gz cd gcc-build ../gcc/configure --target=$TARGET --prefix=$DEST --host=$MACH --disable-shared --disable-nls make LANGUAGES=c cd .. # Extract the kernel source from CVS cd linux make oldconfig make dep # Extract glibc cd glibc-build ../glibc/configure --HOST=$TARGET --BUILD=$MACH --PREFIX=$DEST/hppa-linux --WITH-HEADERS=$DEST/include --disable-profile --without-cvs --enable-add-ons make make install cd $DEST/hppa-linux/include ln -s ~/source/linux/include/asm . ln -s ~/source/linux/include/linux . e477a63e9ed937ac527c4394b7af3fecd2a670ba Perl Modules 0 129 155 153 2009-06-06T21:20:12Z Erik 1 wikitext text/x-wiki [[Category:Tutorials]] ==Getting To The CPAN Prompt== To administer your Perl modules you must use the CPAN prompt. To get to the CPAN prompt, <b>as root</b> type: ::<code>perl -MCPAN -e shell</code> If this is the first time that you have entered the CPAN shell, you will be asked some set-up questions that will allow the shell to access CPAN's servers to get modules. Just read the questions and answer them. If you ever need to re-run the set-up again, enter the CPAN shell and then type: ::<code>o conf init</code> ==Listing The Installed Modules== As of Slackware 10.2 and Perl 5.8.7- you can look the <code>perllocal.pod</code> file and see the modules. ::<code>cat /usr/lib/perl5/5.8.7/i486-linux/perllocal.pod</code> A much cleaner way is by using this Perl program: ::<code>#!/usr/bin/perl</code> ::<code>use ExtUtils::Installed;</code> ::<code>my $instmod = ExtUtils::Installed->new();</code> ::<code>foreach my $module ($instmod->modules())</code> :::<code>{</code> :::<code>my $version = $instmod->version($module) || "???";</code> :::<code>print "$module -- $version\n";</code> :::<code>}</code> ==Installing New Modules== From the CPAN shell prompt, type: ::<code>install &lt;Some::Module&gt;</code> ==Removing Modules== A clean way is by using this Perl program: ::<code>#!/usr/bin/perl -w</code> ::<code>use ExtUtils::Packlist;</code> ::<code>use ExtUtils::Installed;</code> ::<code>$ARGV[0] or die "Usage: $0 Module::Name\n";</code> ::<code>my $mod = $ARGV[0];</code> ::<code>my $inst = ExtUtils::Installed->new();</code> ::<code>foreach my $item (sort($inst->files($mod)))</code> :::<code>{</code> :::<code>print "removing $item\n";</code> :::<code>unlink $item;</code> :::<code>}</code> ::<code>my $packfile = $inst->packlist($mod)->packlist_file();</code> ::<code>print "removing $packfile\n";</code> ::<code>unlink $packfile;</code> 64e6c8bff1ade1ebe338a06b5761145dd962c29f PhpMyAdmin 0 131 156 2009-06-06T21:21:37Z Erik 1 Copy from old wikitext text/x-wiki = phpMyAdmin = == Install == Download ''phpMyAdmin'' from [http://www.phpmyadmin.net phpMyAdmin.net] and put it in ''/usr/src/sourcepkg''. Extract and add a symbolic link for later use in our config. <pre> cd /var/www tar jxvf /usr/src/source/phpMyAdmin-XXX.tar.bz2 ln -sf phpMyAdmin-XXX phpMyAdmin </pre> === apache1 running under Slackware <12 === Make a directory for the config files and create the phpMyAdmin config file for apache. <pre> mkdir /etc/apache/conf.d touch /etc/apache/conf.d/phpMyAdmin.conf vi /etc/apache/conf.d/phpMyAdmin.conf </pre> Add alias to apache (like at apache-2) and add these lines to phpMyAdmin.conf <pre> Alias /phpMyAdmin /var/www/phpMyAdmin <Location /phpMyAdmin> # Order deny,allow # Deny from all # Allow from 127.0.0.1 # Allow from ::1 # Allow from .example.com </Location> </pre> and append to the httpd.conf <pre> echo 'Include /etc/apache/conf.d/phpMyAdmin.conf' >> /etc/apache/httpd.conf </pre> === httpd (apache2) under Slackware 12 === Create the phpMyAdmin config file and edit it. <pre> touch /etc/httpd/phpMyAdmin.conf jed /etc/httpd/phpMyAdmin.conf </pre> Add an alias to httpd (since the phpMyAdmin directory isn't in ''var/www/htdocs'') and change the ''Directory'' rules. <pre> # # phpMyAdmin - MySQL Database Administration Tool # Alias /phpMyAdmin /var/www/phpMyAdmin <Directory /var/www/phpMyAdmin> # AllowOverride None # Options None Order allow,deny Allow from all </Directory> </pre> Edit ''httpd.conf'' to use our new config and append at the end. <pre> # Uncomment the following line to enable phpMyAdmin support: # Include /etc/httpd/phpMyAdmin.conf </pre> == Configuration == Restart apache <pre> /etc/apache/rc.httpd restart </pre> Go to your browser and open http://localhost/phpMyAdmin If you have set a password for your MySQL root user, you will have an error Edit /var/www/phpMyAdmin/config.inc.php: Change to something unique: $cfg['blowfish_secret'] = ''; Change: $cfg['Servers'][$i]['auth_type'] = 'config'; To: $cfg['Servers'][$i]['auth_type'] = 'cookie'; refresh the browser Finished. [[Category:Tutorials]] b9767267f6ad74e610f203ccb4b4b8cd556f2baa Piping 0 132 157 2009-06-06T21:24:00Z Erik 1 Copy from old wikitext text/x-wiki You can mix [[Common Commands|commands]] to do certain things. dmesg | grep hd That will search dmesg and try to find the string "hd". Now piping is extremely useful. Another example of a pipe: dmesg | less Now this command you can see the dmesg fully and is easier to read. You can also make longer 'pipelines' by using a pipe of several commands. For instance, to browse the last fifty lines of <code>dmesg</code>: dmseg | tail -50 | less <b>Redirection:</b> This will save the dmesg information in your home directory in the file log.txt dmesg > ~/log.txt You can also redirect only the [[standard output|stdout]] by using '1>' or only the [[error messages|stderr]] by using '2>'. For instance, if you want to run a command that gives a lot of junk as output, and you just want to see any errors, you can redirect the output to the null device (<code>/dev/null</code>): mplayer /path/to/movie.avi 1> /dev/null You can also use the > and >> to cat stdin into a new or existing file: bash-3.1$ cat > newFile This is a new file you can type text here and it get's redirected to the file newFile ctrl-c exits * Warning * cat > fileThatAlreadExists WILL OVERWRITE THE FILE! be careful :-) You can use cat to check the text you just added: bash-3.1$ cat newFile This is a new file you can type text here and it get's redirected to the file newFile ctrl-c exits Now that a file is created you can add to it with the >> operator bash-3.1$cat >> newFile This is a new line to add to newFile And if you use cat again to read the file bash-3.1$cat newFile This is a new file you can type text here and it get's redirected to the file newFile ctrl-c exits This is a new line to add to newFile [[Category:Tutorials]] 0c88be229e86591eb46af05c311019a8614eee42 Compiling Postfix 0 133 158 2009-06-06T21:25:00Z Erik 1 Copy from old, had no category, placed in Tips wikitext text/x-wiki [[Category:Tips]] ==Errors When Compiling From Source== ''(from a Slackware 11 perspective)'' '''Problem:''' Make dies complaining about a missing db.h file and/or <code>dbx-devel</code>. '''Solution:''' ::1) Make sure you have the db4 library (found on the Slackware install CD). ::2) If you have the db library installed, Postfix's makefile is dumb so, :::: <code>ln -s /usr/include/db42/db.h /usr/include</code> :::This makes a link to the <code>db.h</code> file from where the postfix makefile is looking for it. '''Problem:''' Make dies complaining about <code>ld: cannot find -ldb</code>. '''Solution:''' ::The <code>libdb.so</code> file cannot be found. Make a link pointing to <code>/lib/libdb-4.2.20</code> from <code>/lib/libdb.so</code> file: :::<code>ln -s /lib/libdb-4.2.20 /lib/libdb.so</code> 55aa8afb8baf4a8b9ad67e8cb2a9dbbcbd30eb21 Power Management in Xorg 0 134 159 2009-06-06T21:25:43Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] == Introduction == If you let your pc turned on for long periods of time, you should take in consideration the use of the Power Management Features of Xorg, (DPMS) to prevent your LCD or CRT monitor to burn the screen. == How to do it == To enable DPMS, you need to open your favorite editor and go to: /etc/X11/xorg.conf find the Monitor Section and add Option "DPMS" so, it may look something like this: Section "Monitor" Identifier "My Monitor" HorizSync 31.5 - 57.0 VertRefresh 50-90 Option "DPMS" EndSection After that you can restart your X server, to do that, just end you current X server session and if kdm is active just restart it pressing Ctrl+Alt+Backspace, after that log in again. Now you can test the changes with this command: xset dpms force off Your screen should go totally off, that means the backlight should go off as well (for LCD monitors). Next thing is to tell xorg when to turn the screen off, for that you need to edit the same file again, and go to the ServerLayout section and add: Option "OffTime" "20" For me, that section looks like this: Section "ServerLayout" Identifier "Simple Layout" Screen "Screen 1" InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard1" "CoreKeyboard" Option "OffTime" "20" EndSection Now you are done, after that you can set up your screen saver on kde control center, remember to check the "Make aware of power management" box == Related reading == [[LCD_Monitor_Configuration_In_X.Org]] ee30e923f02129a8119241f914c96ffbe2b1e4e7 Qmail 0 135 160 2009-06-06T21:26:23Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] P2 - Pre-Installation Checklist Installation steps Part 01 - Download All the Needed Items for the Qmail installation Part 02 - Installing Qmail itself Part 03 - Installing EZmlm and EZmlm-idx Part 04 - Installing Autoresponder Part 05 - Installing Vpopmail Part 06 - Installing VQadmin Part 07 - Installing maildrop Part 08 - Installing QmailAdmin Part 09 - Finalizing the qmail installation Part 10 - Uninstalling Sendmail Part 11 - Starting up qmail Part 12 - Installing Courier-imap/imaps with Courierpassd Part 13 - Installation of the Squirrelmail web mail program Part 14 - Clam Anti Virus & SpamAssassin Part 15 - Installing qmail-scanner w/qms-analog Part 16 - Installing Qmailanalog & Qlogtools Part 17 - Installing Qtrap Part 18 - Maintaining your qmail server Part 19 - Mail client configuration Part 20 - Feedback == External Links == * http://qmailrocks.org/ * http://qmail.org etc ef9d44ea5e68e7ba7136025d9cf99748533ca924 Main Page 0 1 161 151 2009-06-06T21:26:47Z Erik 1 wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==NOTICE== After a long time and numerous upgrades, the DB finally caved in on itself. This is a fresh start. [http://slackwiki.org/old/index.php?title=Special:AllPages The old Wiki can be found here.] The data is still there, any help copying the old pages over here to the new Wiki would be greatly appreciated. UPDATE: Pages beginning with letters A through Q have been copied. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) afce2dc81dc1aaaebb216325ddfb13cf1c469c2c 170 161 2009-06-06T21:38:09Z Erik 1 wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==NOTICE== After a long time and numerous upgrades, the DB finally caved in on itself. This is a fresh start. [http://slackwiki.org/old/index.php?title=Special:AllPages The old Wiki can be found here.] The data is still there, any help copying the old pages over here to the new Wiki would be greatly appreciated. UPDATE: Pages beginning with letters A through S have been copied. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) b9c8f971693aae4b9243a5ff89af29366ad84801 171 170 2009-06-06T21:38:54Z Erik 1 wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==NOTICE== After a long time and numerous upgrades, the DB finally caved in on itself. This is a fresh start. [http://slackwiki.org/old/index.php?title=Special:AllPages The old Wiki can be found here.] The data is still there, any help copying the old pages over here to the new Wiki would be greatly appreciated. UPDATE: Pages beginning with letters A through R have been copied. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) d2a49993ac6abe74a529cde40b4e337462c58890 RAID Array (Software) 0 136 162 2009-06-06T21:31:22Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] == Raid1 Root == I was looking for a way to install a Slackware 12 as described in README_LVM.TXT but on top of a Software Raid1 array. The installation is really straight forward : Assuming we have two disk RAID_DSK[0]=/dev/sda and RAID_DSK[1]=/dev/sdb First partion both disk using the type fd Linux raid auto You need at least two partions as descibed in README_LVM.TXT, a small one that will be mounted on /boot and a big one that will support LVM. create the raid array : # boot mdadm -q --create /dev/md0 --level=1 --raid-devices=2 ${RAID_DSK[0]}1 ${RAID_DSK[1]}1 # lvm mdadm -q --create /dev/md1 --level=1 --raid-devices=2 ${RAID_DSK[0]}2 ${RAID_DSK[1]}2 Follow the instruction find in README_LVM.TXT to install LVM, just use /dev/md0 for the boot partition and /dev/md1 for the Physical Volume (PV) pvcreate /dev/md1 ... Complete the initrd installation as described in README_LVM.TXT to support LVM, but don't exit the chroot when it's done! You need to apply more modification. == Initrd Raid1 == You are still in the chroot ? fine. copy the mdadm utility in /boot/initrd-tree/ cp /sbin/mdadm /boot/initrd-tree/sbin/ save the configuration of your raid array in the initrd-tree /sbin/mdadm -D --scan > /boot/initrd-tree/etc/mdadm.conf modify /boot/initrd-tree/init to add the following # rebuild RAID ARRAY /sbin/mdadm --assemble --scan 2> /dev/null Just before # Initialize LVM: That it! just rebuild the initrd image without resiting the tree (do not use the -c option!). Just for info your lilo Global section should look like that : # Start LILO global section raid-extra-boot=mbr-only lba32 # Allow booting past 1024th cylinder with a recent BIOS boot = /dev/md0 #message = /boot/boot_message.txt prompt timeout = 3 restart lilo, exit the chroot, reboot and Enjoy! 55b2b7f51a10667e2d6398bc9ca88ef51ac7b04c RAID Array (Hardware) 0 137 163 2009-06-06T21:31:50Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] [[Category:Tutorials]] [[Category:Hardware]] ==My Card Is In, Now What?== 1) SET UP THE ARRAY- If you are using a hardware RAID card (like ones made by 3ware), on boot you must enter the card's BIOS and set up your array. This is done by hitting a hotkey (ALT-3 for 3ware cards). Read your card's instructions for details on how to configure your array. 2) BOOT WITH THE CORRECT KERNEL- After you have set up your array, boot the computer with the Slackware Install CD (CD1) like normal. <b>At the <code>boot:</code> prompt, choose a RAID supporting image (e.g. <code>raid.s</code>).</b> YOU CAN NOT USE THE DEFAULT KERNEL (bare.i) to boot into set-up, you have to use a boot kernel that supports RAID arrays. :EXAMPLE: <code>boot: raid.s</code> 3) PROCEED NORMALLY- Once you boot the RAID kernel, everything else proceeds normally except the hard-drive is (usually) <code>/dev/sda</code>. Go ahead set up your partitions (<code>fdisk /dev/sda</code>) and continue the normal Slackware install. ==FAQs== Q: What device is my RAID array?<br> A: You are most likely running RAID.S kernel so therefore it is probably <code>/dev/sda</code> Q: It's not <code>/dev/sda</code> where is it really?<br> A: I don't know. Reboot your machine and watch the messages scroll by. If you don't see the info, you don't have RAID support compiled into your kernel or as a module and you need to fix that. Q: My system has a [[forced fsck]] and it starts but after awhile, it resets and re-boots. How do I fix this?<br> A: Re-boot the system using a Slackware install CD (make sure you boot with a RAID kernel) then get to a command line prompt and manually run <code>fsck</code>. : EXAMPLE: <code>fsck -p /dev/sda1</code> Q: I'm trying to run <code>fsck</code> manually but I get an "<code>The superblock cannot be read...</code>" error. How do I fix this?<br> A: MOST LIKELY, you're not running a RAID supporting kernel. Re-boot and choose a RAID kernel like <code>raid.s</code>. Q: I'm running <code>fsck</code> manually and I am getting a "<code>error allocating inode bitmap (2)</code>". How do I fix this?<br> A: No clue. I haven't been able to find out what that means. If you do, let us know please. ==Hardware RAID Specific Help== [[3ware 3DM2]] - Help with 3ware's 3DM2 program. ==Hardware RAID Specific Help== [[3ware 3ware 8006-2LP Installation]] - Installed slackware 12.2 with the 3ware 8006-2LP card today. I chose this hardware due to the fanfare I found on the net. It is supported with RedHat and Suse (presumably because they have a preinstall driver installation dialog) Installing with slack was not as easy as was hoped. Lilo choked twice, first by installing to the MBR which the 3ware bios simply didn't see, and second after installing to the root partition, lilo complained with error 99 which is apparently a BIOS disk address mismatch of some sort. What worked was this: 1. Install the card, or receive the machine with the card already installed. 2. Double check that all your cable connections are tight. mine were loose when the chassis arrived from the vendor. I am sincerely glad I found this now rather than later. 3. Slackware 12.2 has the 3ware driver in it, so it should boot from CD and see the disk as: /dev/sda 4. fdisk /dev/sda and create some partitions, mine are as follows: /dev/sda1 50G (/ this is the root partition) set bootable /dev/sda2 2G (for /boot) /dev/sda3 2G ( for swap) toggle to type 82 /dev/sda4 (extended) /dev/sda5 25G (for /var) /dev/sda6 25G (for /home) /dev/sda7 50G (for the webserver) /dev/sda8 50G (for the database) /dev/sda9 10G (for source code) You will note seperate /boot and /home partitions. Configuring the disk this way adds some security, which we will discuss in a moment. 5. Run setup and select your packages. 6. Do the configuration dialog: Generally I believe all network enabled devices should be on UTC so I set both system and hardware clocks accordingly. ignore gpm, ignore fancy fonts, and number the network interface... Then make sure the network interface _isn't_ connected. 7. Let the lilo configurator screw up lilo by select "Guess my lilo config" or whatever. 8. exit setup, DO NOT REBOOT! 9. chroot /mnt 10. vi /etc/lilo and make it point at your root partition. My lilo.conf is as follows: lba32 # any modern drive should be able to do this. boot = /dev/sda1 append = " vt.default_utf8=0" vga = normal image = /boot/vmlinuz root = /dev/sda1 Label = Linux read-only # for fscking during bootup. 11. Note above that /dev/sda1 is the root partition, or "/" if you stick it somewhere else, change as appropriate. 12. obliterate the master boot record: (prevents lilo from getting confused for some reason): lilo -z -M /dev/sda 13. run lilo and listen to it complain: lilo 14. If you don't get any fatals errors (warnings are ok), remove the cd then: exit reboot 15. Do your little chair dance, and irritate your coworkers. 16. vi /etc/fstab and adjust the following partitions: /dev/sda2 /boot ext2 defaults,ro 1 2 /dev/sda6 /home ext2 defaults,nosuid 1 2 Leave your partitions ext3 if they are configured that way, but note the addition of "ro" to /boot and "nosuid" to /home. This makes the kernel secure from modification until the next reboot, and prevents root privileged code from being executed from /home. Generally good and fairly unintrusive security policy. Now proceed onward oh great progenitors of slack. Your next steps should probably be using "find" to locate and disable most of what has a suid bit set, and then installing and configuring tripwire or some equivilant, then making a brutal set of access controls with iptables, and _then_.... _maybe_ you can connect the box to a public network. But don't take my word for it. Good Luck! 5214be1411b980d4630f8b471f2b6088a57e2d96 Region Set (program) 0 138 164 2009-06-06T21:32:49Z Erik 1 Copy from old, had no category, placed in Hardware wikitext text/x-wiki [[Category:Hardware]] [[Category:Tips]] == Description == A small stand-alone console progran to set/change a DVD drive's region code. <b>WARNING:</b> As of this writing (9/2006) almost all DVD drives can only have their region codes set/changed four times. Some hacked firmware patches can bypass this. Region set can be obtained from: [http://prdownloads.sourceforge.net/dvd/regionset.tar.gz http://prdownloads.sourceforge.net/dvd/regionset.tar.gz] == Useage == To use this file: ::1) un-compress/archive the files- ::::<code> gunzip regionset.tar.gz</code> ::::<code>tar -xvf regionset.tar</code> ::2) CD into the directory- ::::<code>cd regionset</code> ::3) Make the program- ::::<code>make</code> ::4) Execute the program (as root)- ::::<code>./regionset</code> 8792a45eb418c802760abe3212eed2b17df9ce3f Recompile php with mcrypt 0 139 165 2009-06-06T21:33:35Z Erik 1 Copy from old, had no category, placed in Tutorials wikitext text/x-wiki [[Category:Tutorials]] PhpMyAdmin (available at [http://www.SlackBuilds.org/ SlackBuilds.org]) works well when you compile PHP with the mcrypt extension. After installing PhpMyAdmin, you may see a warning that it cannot find the mcrypt extension. Unfortunately the official Slackware package does not include this extension. Recompiling PHP is necessary, as is enabling the mcrypt.so extension in /etc/httpd/php.ini. The first step is a little tricky, since compiling PHP requires a little trick: you must compile alpine during the PHP build. It is fairly simple once you have things in place, but this tripped me up when I first tried to recompile PHP. == Install mcrypt and libmcrypt == mcrypt is available from [http://www.SlackBuilds.org SlackBuilds.org]. First build and install mcrypt and libmcrypt before compiling PHP. == Recompile PHP == Go to a Slackware mirror and download Pat's Slackbuild directory for php from the source/n directory. I used <code>wget --mirror <mirror>/n/php</code> to download the whole directory. You will also need to download the alpine/ directory into the parent of the newly-created php/. In other words, you should have a parent directory with both php and alpine. For example, mine is ~/SlackBuilds/n, where I have two subdirectories: one for alpine/ and one for php/. ''' Be sure to chmod +x both the alpine and php SlackBuilds before attempting to build.''' If you don't, things may go for quite a while depending on the speed of the machine you're building on before you get an error (and you ''will'' get an error). === Edit php.SlackBuild === You will need to add a "--with-mcrypt=" flag to the configure command in php.SlackBuild. Since you already have mcrypt installed, you can use <code>--with-mcrypt=`which mcrypt`</code> Remember to add the slash at the end of the line. I positioned this flag second to the bottom. The position of the flag only matters for your ability to find it next time, order will not affect the build process. SlackBuilds customarily have the "--build=" flag at the bottom, so I left it where it was. === Upgrade PHP === Install the new package with upgradepkg. Keep in mind that you will need to repeat this process whenever there is a security alert for php. In that case, download the new source, update the VERSION variable, recompile and upgrade. For this reason, I've kept ~/SlackBuilds/n the way it is with alpine and php subdirectories. == Configure PHP == Configuring PHP to use mcrypt is easy: add the line <code>extension=mcrypt.so</code> to /etc/httpd/php.ini and then restart apache. Now when you log in to PhpMyAdmin, you should no longer see the warning about mcrypt. 895d4100b9586f0651a1fef79befea937b61bca2 Reinstalling Lilo 0 140 166 2009-06-06T21:34:49Z Erik 1 Copy from old wikitext text/x-wiki Once upon a time you try to boot Slackware, something happens and lilo is messed up. You can fix lilo really easily, all you need is CD1 of Slackware. Boot the CD and when it says boot: then you type the following: : <code>huge.s root=/dev/hda1 noinitrd ro</code> Now you change huge.s to the kernel you want to boot, root= should reflect the root partition of your Slackware install. Now when you type this you have Slackware booting up with the bare.i default kernel. Now at the login prompt you login as root and either type: : <code>liloconfig</code> That will setup Lilo from a ncurses based menu. Now you can also edit lilo's config from a file: : <code>vi /etc/lilo.conf</code> Either way it will fix it hopefully, Now remember man lilo has all the hex errors if you need them. When you have all that setup you now can run: : <code>/sbin/lilo -v</code> Now you must run lilo every time you change /etc/lilo.conf to update the changes, Now restart without the CD and it should work. [[Category:Tutorials]] faaece4ac572f843d9d0e7c784166e88c5d88950 Release Changes 0 141 167 2009-06-06T21:35:23Z Erik 1 Copy from old wikitext text/x-wiki The purpose of this page is to provide links to documentation of the changes occurring from one release of Slackware to the next. We do not make any guarantees that the information provided is complete, but every effort is made to ensure accuracy and completeness. [[Changes_9.1_10.0 | Changes From 9.1 to 10.0]] [[Changes_10.0_10.1 | Changes From 10.0 to 10.1]] [[Changes_10.1_10.2 | Changes From 10.1 to 10.2]] [[Changes_10.2_11.0 | Changes From 10.2 to 11.0]] [[Changes_11.0_current | Changes From 11.0 to -current]] If anyone is so inclined, we certainly welcome page additions for changes between older versions - please do them in the same format as the existing ones. [[Category:Information]] 36220e4a69837662c9b6c5b2dcee5bad0271b6fc Relocatable packages 0 142 168 2009-06-06T21:36:40Z Erik 1 Copy from old, had no category, placed in Information wikitext text/x-wiki [[Category:Information]] Relocatable packages are created such that the user can choose to install the package in a different installation location than the default (usually '''/'''). All Slackware packages are technically relocatable, since [[pkgtools]] can install packages in a different installation root directory if the ROOT environment variable is set to another directory, regardless of whether the package was specifically designed to be relocatable. In practice, however, few packages are built with relocatability in mind, and installing them in any other installation root directory other than '''/''' will probably cause path related problems. ==Why Relocate?== Installing into a different installation location other than '''/''' is useful in such cases as: * Installing multiple versions of a program * Installation by a normal (non-root) user in a user, non-system directory * Trying out new software ** Installing a new version of a package without removing (or overwriting) the older version of the package at any time ** Testing the new package *** Possible approach: install as a normal user, test, and then install as root into system-wide areas. Relocatable packages allow for more flexibility, and depending on the program to be packaged, may only require minimal additional effort to create. a4738fc69f23987b07f22c560936a5274ecf2c94 Rsync 0 143 169 2009-06-06T21:37:33Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] Rysnc is a great tool for backing up things, downloading things and keeping up with Slackware -current. Why? Because say you have a lot of files in /home/$USER/slackware/ that you want to update, say with the newest -current. ( These files would be the files off of your Slackware 10.1 disk, on the folder /slackware on the root of the Slackware disk) rsync would only download what is new and can also erase what is no longer there, this could save a lot of bandwidth. So where do we begin? Lets use a Slackware mirror and actually update your Slackware 10.1 cd , to -current. So we will use a Slackware mirror: rsync inferno.bioinformatics.vt.edu:: The above command would list the modules on the rsync server. Well what is a module? A module is something that people export their files and directories to in a module format. So someone running a rsync server could make a module called "slackware" and export "/home/slackware/". Then the user could download all or some of the files in that module. Now lets list the files and directories of the module we need: rsync inferno.bioinformatics.vt.edu::slackware See from the above you can see the slackware versions we could all download. Since we have our slackware 10.1 in /home/$USER/slackware and we want to upgrade to -current, we could use this command: rsync -rvz --delete inferno.bioinformatics.vt.edu::slackware/slackware-current/slackware/ /home/$USER/slackware/ Now this command looks weird at first, but lets examine. First the -r means recursive ( Meaning it goes through all the sub directories and downloads ). Next we see -v which means verbose, so we can see what is going on, next the -z. This means compress, it will compress the things so it will shorten the bandwidth requirement. The --delete means that it will delete anything that the server doesn't have, this would make an exact mirror copy:)! That pretty much sums that command up. So since this was a simple rsync tutorial and pretty much told you how to download Slackware -current an efficient way, read UPGRADE.txt to find out how to fully upgrade your box:) Thanks for reading, Sandy dc881a3571e22dd9c24db1c4548a730f2d0df592 SSL 0 144 172 2009-06-06T23:17:15Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] = openSSL 0.9.8e = '''IMPORTANT: Since this version has a [http://www.mail-archive.com/openssl-users@openssl.org/msg48671.html bug in the blowfish encryption] it is recommended not to use blowfish since it is incompatible with all other openSSL versions!''' <br>Everything you read here was tested on Slackware 12<br> ; wikipedia says about openSSL: : ''OpenSSL is an open source implementation of the SSL and TLS protocols. The core library (written in the C programming language) implements the basic cryptographic functions and provides various utility functions. Wrappers allowing the use of the OpenSSL library in a variety of computer languages are available.'' There are many ways to use openSSL. This just covers certificates for use with httpd. You can also use easy-rsa that comes with the openVPN package and can be found in ''/usr/doc/openvpn-2.0.9/easy-rsa/''. For more information read the included ''README'' or look here: [http://openvpn.net/easyrsa.html A Guide to basic RSA Key Management]. Normally you will make a ''Certificate Signing Request (CSR)'' and send this one to a ''Certifying Authority (CA)'' to be signed. But since we don't wanna pay for this and only want to use it for our own special purpose, we don't need to do that and sign everything ourself. = openSSL + httpd = Switch to ''/etc/ssl'' <pre> cd /etc/ssl </pre> In this directory you should see the following listing. One some non-Slackware linuxes, or if OpenSSL was installed from source, the appropriate directory might be ''/etc/openssl''. <pre> root@pecan:/etc/ssl# ls -l total 24 drwxr-xr-x 2 root root 4096 2007-06-13 12:40 certs/ drwxr-xr-x 2 root root 4096 2007-06-13 12:40 misc/ -rw-r--r-- 1 root root 9374 2007-06-13 12:40 openssl.cnf drwxr-xr-x 2 root root 4096 2007-06-13 12:40 private/ root@pecan:/etc/ssl# </pre> We need to generate a private and public RSA key file. The public key is used to encrypt messages to you and is distributed with your certificate. == Creating a Self-Signed ''Certificate'' (CRT) == === openssl.cnf + openSSL DB === (You should still do this step even if you are buying a commercial certificate.) First things first, so we gotta edit this file, mainly the ''[ CA_default ]'' section. The <pre> [ CA_default ] dir = ./demoCA # Where everything is kept ... certificate = $dir/cacert.pem # The CA certificate ... crl = $dir/crl.pem # The current CRL private_key = $dir/private/cakey.pem# The private key ... </pre> to <pre> [ CA_default ] dir = /etc/ssl # Where everything is kept ... certificate = $dir/certs/ca.crt # The CA certificate ... crl = $dir/crl/ca.crl # The current CRL private_key = $dir/private/ca.key # The private key ... </pre> You can even change more options in this file but be aware what you are doing.<br> openSSL has a database for storing information such as ''Certificate Revocation Lists'' (CRL). Since these files don't exist on startup and we don't use the ''CA.sh'' or ''CA.pl'' scripts we got to create them ourself: <pre> mkdir newcerts certs crl private touch serial index.txt crlnumber crl/ca.crl echo 01 | tee serial | tee crlnumber </pre> Thanks to ''alienBOB''. Hail to tee king! :p === Becoming a ''Certification Authority'' (CA) === (Skip this step if you are buying a certificate from a commercial certificate authority such as GoDaddy.) Before you can create and sign your own certificates, you first have to establish yourself as a "Certificate Authority". To do so, we first create our key file (with a public and a private key) and use it to create our "master certificate" to use when signing other certificates. ; Generate the CA RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/ca.key 4096</pre> ; Create the CA CRT with the CA RSA Key : <pre>openssl req -new -x509 -days 3650 -key private/ca.key -out certs/ca.crt</pre> === Create Server CRT === A CRT contains your RSA public key, your name, the name of the CA, and is digitally signed by the CA. Browsers that know the CA can verify the signature on that CRT, thereby obtaining your RSA public key. That enables them to send messages which only you can decrypt. The next step is to create a Server RSA key, generate a ''Certificate Signing Request'' (CSR) out of it and sign it with our CA CRT to get a working SSL CRT for our server. A CSR is a digital file which contains your public key and your name. Normally you would send the CSR to a CA, who will convert it into a real certificate, by signing it. ; Generate the Server RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/server.key 1024</pre> ; Create the Server CSR using the Server RSA Key : '''When asked for the CommonName (CN) enter your domain!''' : <pre>openssl req -new -key private/server.key -out private/server.csr</pre> ; Sign the CSR with our CA CRT : <pre>openssl ca -in private/server.csr -out certs/server.crt</pre> You can now delete ''server.csr'' if you want, because it is no longer needed. (If you are using a commercially signed certificate from a place such as GoDaddy, do the first two commands above but not the last. Then do ''cat private/server.csr'' to get the text of the certificate request, which you will paste into GoDaddy's web interface to get the certificate. GoDaddy will then email the email address listed in the ''whois'' information for that domain (Make sure you haven't put in a fake address there to avoid spam!), and after the link in that email is clicked, GoDaddy will email another link to you from which you download a zip file. The zip file will contain two .crt files, and you should put both of them in /etc/ssl/certs. Other commerical certificate authorities follow a very similar procedure.) == Setup httpd == === Edit httpd.conf === The whole httpd config is located in ''/etc/httpd''. Fire up your preferred text editor and simply change this at Line 459: <pre> # Secure (SSL/TLS) connections #Include /etc/httpd/extra/httpd-ssl.conf </pre> to this <pre> # Secure (SSL/TLS) connections Include /etc/httpd/extra/httpd-ssl.conf </pre> to enable SSL support. You may also have to uncomment the line that starts ''LoadModule ssl_module''. === Edit extra/httpd-ssl.conf === Now we're going into the guts of the httpd SSL config. Search for ''SSLCertificateFile'' and ''SSLCertificateKeyFile'' change the path to our newly created CRT: <pre> ... SSLCertificateFile /etc/ssl/certs/server.crt ... SSLCertificateKeyFile /etc/ssl/private/server.key ... SSLCertificateChainFile /etc/ssl/certs/server.crt ... SSLCACertificatePath /etc/ssl/certs SSLCACertificateFile /etc/ssl/certs/ca.crt ... SSLCARevocationPath /etc/ssl/crl SSLCARevocationFile /etc/ssl/crl/ca.crl ... </pre> (If you have purchased a certificate from a commercial authority, the SSLCertificateFile will be one of the two files you receive from the CA (GoDaddy or VeriSign or whomever), and the SSLCACertificateFile will be the other. The files will be named such that you can tell which is which -- the SSLCertificateFile will probably be something like ''www.yourdomainname.com.crt'' and the SSLCACertificateFile will be something like ''nameofca-bundle.crt''.) == Pass-phrase on httpd startup == The reason this dialog pops up at startup and every re-start is that the RSA private key inside your ''server.key'' file is stored in encrypted format for security reasons. The pass-phrase is needed decrypt this file, so it can be read and parsed. Removing the pass-phrase removes a layer of security from your server - proceed with caution! <ol> <li> Remove the encryption from the RSA private key (while keeping a backup copy of the original file): <pre> cd /etc/ssl mv private/server.key private/server.key.org cd private openssl rsa -in server.key.org -out server.key </pre> </li> <li> Make sure the server.key file is only readable by root since it is decrypted: <pre> cd /etc/ssl chmod 0400 private/server.key </pre> </li></ol> Now server.key contains an unencrypted copy of the key. If you point your server at this file, it will not prompt you for a pass-phrase. HOWEVER, if anyone gets this key they will be able to impersonate you on the net. PLEASE make sure that the permissions on this file are such that only root or the web server user can read it (preferably get your web server to start as root but run as another user, and have the key readable only by root). As an alternative approach you can use the ''SSLPassPhraseDialog exec:/path/to/program'' facility. Bear in mind that this is neither more nor less secure, of course. == Verifying and debugging == If you simply want to see every information on a CRT: <pre>openssl x509 -noout -text -in XXX.crt</pre> === Verifying === ; Verify that a private key matches its Certificate : Generate a MD5 out of the public key/CRT and compare : <pre>openssl x509 -noout -modulus -in private/XXX.crt | openssl md5 && openssl rsa -noout -modulus -in private/XXX.key | openssl md5</pre> === Debugging === ; s_server - Debugging clients : <pre>openssl s_server -accept 443 -www</pre> ; s_client - Debugging servers : <pre>openssl s_client -connect localhost:443</pre> or <pre>openssl s_client -connect localhost:443 -state -debug</pre> == Security == All the files expect the CRTs are only for your eyes, so we change the permissons: <pre>chmod 0400 private/*.key</pre> === Client Revokation === This is only needed if your server certificate is compromised (eg. someone hacked your server and stole your server.key). <pre> openssl ca -gencrl -keyfile private/ca.key -cert certs/ca.crt -out crl/ca.crl </pre> That generated us the needed files which we use when we want to revoke a CRT. <br><br> Now that we got a compromised CRT, we got to get rid of it: <pre>openssl ca -revoke server.crt -keyfile private/ca.key -cert certs/ca.crt</pre> == Other == === Change the pass-phrase === <pre> openssl rsa -des3 -in server.key -out server.key.new mv server.key.new server.key </pre> The first time you're asked for a PEM pass-phrase, you should enter the old pass-phrase. After that, you'll be asked again to enter a pass-phrase - this time, use the new pass-phrase. If you are asked to verify the pass-phrase, you'll need to enter the new pass-phrase a second time. === CRT for Clients === Ok.. i won't write anything on this, and simply just C/P: <pre> openssl genrsa -des3 -out private/client1_priv.key 2048 openssl genrsa -des3 -out private/client2_priv.key 2048 # and so on... depends on how much clients you wanna serv... openssl req -new -key private/client1_priv.key -out private/client1.csr openssl req -new -key private/client2_priv.key -out private/client2.csr # and so on... openssl ca -in private/client1.csr -out private/client1.crt openssl ca -in private/client2.csr -out private/client2.crt cp private/client1.crt private/client1_preconv.crt cat private/client1.key >> private/client1_preconv.crt openssl pkcs12 -export -in private/client1_preconv.crt -out private/client1_postconv.p12 </pre> Install in the clients browser... and change httpd.conf: <pre> SSLCACertificateFile PATH/TO/server.crt SSLVerifyClient require SSLVerifyDepth 1 </pre> === Convert CRT from PEM to DER format === Normally all CRTs are stored in the PEM format. <pre>openssl x509 -in ca.crt -out ca.crt.der -outform DER</pre> == Testing the CRT == If you have live web sites, you might wish to test your configuration before restarting apache, to avoid having that panicy few minutes of downtime while you scramble to see what you can do faster, fix the problem or copy back your backup configs. Test like this: <pre>httpd -t</pre> Look at the error messages it prints out, or the error_log as explained below, if it doesn't work. Restart your httpd: <pre>/etc/rc.d/rc.httpd restart</pre> Take a look at the httpd ''error_log'' and scroll to the end of the file: <pre>jed /var/log/httpd/error_log</pre> If your getting an error like this: <pre>[error] Init: Unable to read pass phrase [Hint: key introduced or changed before restart?]</pre> ... then you should take a look at ''Pass-phrase on httpd startup'' ... = openSSL + openVPN = $foo ... maybe next month... = External Links = * [http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html SSL/TLS Strong Encryption: FAQ @ httpd.apache.org] * [http://www.tc.umn.edu/~brams006/selfsign.html Creating a self-signed SSL certificate] * [http://www.madboa.com/geek/openssl/ OpenSSL Command-Line HOWTO] * [http://www.5dollarwhitebox.org/wiki/index.php/Howtos_Self_Signed_SSL_Certificates OpenSSL Quick Reference] * [http://www.opensourcehowto.org/how-to/apache/setup-apache2-with-openssl.html Setup Apache2 with OpenSSL] * [http://www.marschke.info/admin/ap_opssl_https.html Apache2, OpenSSL und HTTPS: Server- und Client-Authentifizierung mit Zertifikaten über verschlüsselte Internet-Verbindungen] * [http://www.online-tutorials.net/security/openssl-tutorial/tutorials-t-69-207.html openSSL / openVPN.. comming soon] ebc5be38291a6dd81f0ef352440df618a80d298d Samba 0 145 173 2009-06-06T23:17:56Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] ... this is a W.I.P ... will write more the next days, hope this is ok :) comments, suggestions, etc. are welcome! == Introduction == This Tutorial shows you how to configure Samba 3.0.x on Slackware 12.x. It should later act as simple and secure as it can be in a heterogen network with Windows systems (a workstation with admin access, guest accounts for the rest [eg. your friends]), a media streaming client (eg. Xbox) and Linux / *nix (Solaris / Mac OS X). I wanted to have all necessary parameters for home usage in my smb.conf so i can easily change them and have a mostly secure and stable system. Printing is disabled by default in my config, since i have no need to attach my printer to the server (the printer has its own print server: HP P2015). Also i really have no clue how to use a printer with linux. If someone wants to write something on printing then feel free to do so... == Upgrade / Build Samba == If you are here you probably will know what Samba is good for and how it works. Normally Samba is installed on your system and ready for action and doesn't need to be upgraded. === Upgrade Samba === All upgrades to Samba should be done via the patches directory on your favorite mirror. You should NOT NOT NOT mix -current packages with a non "-current" Slackware. === Building Samba === Hey! Wanna build Samba? Get the source, get the slackbuild, make a package and install it! I used the latest build from the 3.0.x fork since this comes with Slackware 12.x. You can also try building Samba 3.2.x. If you want a optimized build with a better performance that suits your system, you should consider installing GCC >4.2.4 since it supports better optimizing functions (''-march=native'' - specifying ''-march=native'' implies ''-mtune=native''. This will enable all instruction subsets supported by the local machine (hence the result might not run on different machines).) and use Samba 3.2.x cause it has a better overall performance. Only do this if you know what you are doing! * Get the source + SlackBuild, edit it and build the package... <pre>$ mkdir /tmp/samba $ cd /tmp/samba $ wget http://us3.samba.org/samba/ftp/stable/samba-3.0.31.tar.gz ... $ wget -r -nH ftp://slackware.osuosl.org/pub/slackware/slackware-current/source/n/samba $ jed samba.SlackBuild > VERSION=3.0.30 >> VERSION=3.0.31 > tar xjvf $CWD/samba-$VERSION.tar.bz2 >> tar xfvz $CWD/samba-$VERSION.tar.gz $ chmod +x samba.SlackBuild $ ./samba.SlackBuild $ upgradepkg /tmp/samba-3.0.31-i486-1.tgz</pre> == Configure Samba == There are a few requirments i had for this config. * Guest access from Windows without the need for a password * Guests are only allowed to read and have no ''home directory'' (eg. /home/guest) * Guests are only allowed to put new files in a given directory * Make everything secure as it can get with this config * Users on the system have access to their ''home directory'' * No Printing at all * Disable NetBios, we only have Windows XP or higher / *nix * Maybe more? === /etc/samba/smb.conf === This is my own ''smb.conf'' as i use it on my system. The config file itself should be selfexplaining. ==== '''smb.conf /w comments''' ==== <pre>#smb.conf - v1.1 # # Samba-3.0.30 - Slackware 12.x # e.v.o ( e.v.o [A-T] gmx.net ) # # ; COMMENT # #PARAMETER ( name = default value ) # Normally every parameter should have its default value. # If the parameter is commented out then it is the default value, # otherwise you should have a look at "man smb.conf" # # This config is based on the smb.conf manual page # and "Using Samba, 3rd Edition" from O'Reilly # # VARIABLE SUBSTITUTIONS ; %U session username ; %G primary group name of %U ; %h the Internet hostname that Samba is running on ; %m the NetBIOS name of the client machine (very useful) ; %L the NetBIOS name of the server ; %M the Internet name of the client machine ; %R the selected protocol level after protocol negotiation ; %d the process id of the current server process ; %a the architecture of the remote machine ; %I the IP address of the client machine ; %i the local IP address to which a client connected ; %T the current date and time ; %D name of the domain or workgroup of the current user ; %w the winbind separator ; %v Samba version number ; ; The following substitutes apply only to some configuration options ; Only those that are used when a connection has been established ; ; %S the name of the current service, if any ; %P the root directory of the current service, if any ; %u username of the current service, if any ; %g primary group name of %u ; %H the home directory of the user given by %u ; %N the name of your NIS home directory server ; %p the path of the service's home directory [global] ; Parameters in this section apply to the server as a whole ; ### USERSHARES ### # Capability for non-root users to ; ==================== # add/modify/delete own share definitions ; ; Controls if usershares can permit guest access #usershare allow guests = ; Maximum number of user defined shares allowed #usershare max shares = ; If set only directories owned by the sharing user can be shared #usershare owner only = ; Directory containing the user defined share definitions #usershare path = ; Comma-separated list restricting what directories can be shared #usershare prefix allow list = ; Comma-separated list restricting what directories can be shared #usershare prefix deny list = ; Pre-existing share used as a template for creating new usershares #usershare template share = ; ### NAME MANGLING ### # By default, Samba has the same ; ======================= # semantics as a Windows NT server ; ; Filenames are case sensitive #case sensitive = auto ; Default case for new filenames #default case = lower ; New files are created with the case that the client passes #preserve case = yes ; New files which conform to 8.3 syntax are created upper case #short preserve case = yes ; ### PRINTING ### ; ================== ; ; All printers in the printcap will be loaded for browsing by default load printers = no ; Only applicable if printing is set to cups. #cups server = "" ; Show the "Add Printer Wizard" Dialog show add printer wizard = no ; Yes = open, write to and submit spool files on the specified directory printable = no ; =============================== ; # - S E T T I N G S - # ; =============================== ; \-= USER SCRIPTS =-/ # These scripts are used on a PDC or stand-alone ; ==================== # machine to add or delete corresponding unix accounts ; Script that will be run when a new group is requested #add group script = /usr/sbin/groupadd %g ; Script that will be run when a machine is added to Samba's domain #add machine script = /usr/sbin/adduser -s /bin/false -d /dev/null %u -n -g machines -c Machine ; Script which will add a new service definition to smb.conf #add share command = ; Script which will add a new user #add user script = /usr/sbin/useradd -m %u ; Script that will be called when a user is added to a group #add user to group script = /usr/sbin/usermod -G %g %u ; Script which will modify an existing service definition in smb.conf #change share command = ; Script when a group is requested to be deleted #delete group script = /usr/sbin/groupdel %g ; Script when a user is removed from a group using the Windows NT domain administration tools #delete user from group script = /usr/sbin/deluser %u %g ; Script that will be run when managing users with remote RPC (NT) tools #delete user script = /usr/sbin/userdel -r %u ; Script that will be run under special circumstances #rename user script = no ; This script sets the primary group in the unix userdatase when an administrator sets the ; primary group from the windows user manager or when fetching a SAM with net rpc vampire #set primary group script = /usr/sbin/usermod -g '%g' '%u' ; Program that can be used to set UNIX user passwords #passwd program = /usr/bin/passwd %u ; Controls the "chat" conversation between smbd and the local password changing program #passwd chat = "*New password:*" %n\r "*New password (again):*" %n\r \ "*Password changed*" ; \-= PERMISSION MASKS =-/ ; ======================== #inherit owner = no #inherit permissions = no #directory mask = 0755 #directory security mask = 0777 #force create mode = 000 #force directory mode = 000 #force directory security mode = 0 #force security mode = 0 #security mask = 0777 ; \-= USER PARAMETER =-/ ; ====================== ; List of users who will be granted administrative privileges on the share admin users = evo ; This is a list of users that should be allowed to login to this service valid users = evo guest ; This is a list of users that should not be allowed to login to this service invalid users = root nobody ftp adm apache bin daemon games gdm haldaemon halt lp mail messagebus mysql news operator pop rpc shutdown smmsp sshd sync uucp ; This is a list of users that are given read-only access to a service read list = evo guest ; This is a list of users that are given read-write access to a service write list = evo ; -= Guest Settings =- ; Username which will be used for access to services which are specified as guest ok guest account = guest ; Yes for a service, then no password is required to connect to the service guest ok = no ; Yes for a service, then only guest connections to the service are permitted guest only = no ; -= Forced User/Group Settings =- ; UNIX user name that will be assigned as the default user for all users ;force user = guest ; UNIX group name that will be assigned as the default primary group for all users force group = users ; -= Map Settings =- ; Specify a file containing a mapping of usernames from the clients to the server #username map = ; #map acl inherit = no #map archive = yes #map hidden = #map read only = yes #map system = no map to guest = Bad User ; \-= SHARE PARAMETER =-/ ; ======================= ; Lets you "turn off" a service. If available = no, then ALL attempts to connect to the service will fail available = yes ; Controls whether this share is seen in the list of available shares in a net view and in the browse list browseable = yes ; Allow or disallow client access to accounts that have null passwords #null password = no ; If this parameter is yes, then users of a service may not create or modify files in the service's directory read only = yes ; Setting this parameter to no prevents any file or directory that is a symbolic link from being followed follow symlinks = no ; This parameter controls whether or not links in the UNIX file system may be followed by the server wide links = no ; This parameter specifies the name of a service which will be connected to if the service actually requested cannot be found #default service = ; This parameter allows you to specify a comma-delimited list of directories that the server should always show as empty dont descend = /bin,/boot,/dev,/etc,/lib,/opt,/proc,/sbin,/srv,/sys,/tmp,/usr,/var ; -= Hide Files =- ; This is a boolean parameter that controls whether files starting with a dot appear as hidden files #hide dot files = yes ; This is a list of files or directories that are not visible but are accessible #hide files = ; This parameter prevents clients from seeing special files such as sockets, devices and fifo's in directory listings #hide special files = no ; This parameter prevents clients from seeing the existance of files that cannot be read #hide unreadable = no ; This parameter prevents clients from seeing the existance of files that cannot be written to #hide unwriteable files = no ; \-= WINDOWS PARAMETER =-/ ; ========================= ; Specifies the charset that samba will use to print messages to stdout and stderr #display charset = "LOCALE" or "ASCII" (depending on the system) ; This option specifies which charset Samba should talk to DOS clients #dos charset = # No default ; Enabling this parameter allows a user who has write access to the file (by whatever means) to modify the permissions #dos filemode = no ; \-= NETWORK/CONNECTION PARAMETER =-/ ; ==================================== ; This controls what workgroup your server will appear to be in when queried by clients workgroup = KlingKlang ; This controls what string will show up in the printer comment box in print manager and next to the IPC connection in net view server string = FileDealer ; This sets the NetBIOS name by which a Samba server is known netbios name = FileDealer #netbios aliases = ; -= Interface Settings =- ; This parameter is a comma, space, or tab delimited set of hosts which are permitted to access a service hosts allow = 127.0.0.1 192.168. hosts deny = ALL ; -= Connection Options =- ; Represents the number of minutes of inactivity before a connection is considered dead and disconnected #deadtime = 0 ; The value of the parameter (an integer) represents the number of seconds between keepalive packets #keepalive = 300 ; This option allows the number of simultaneous connections to a service #max connections = 0 ; This option allows you to set socket options to be used when talking with the client socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 ; \-= OTHER PARAMETER =-/ ; ======================= security = user ; Enabling this parameter will disable netbios support in Samba disable netbios = yes ; Do a lookup with the DNS server dns proxy = no ; -= SMBpasswd Settings =- ; This option allows the administrator to chose which backend will be used for storing user and possibly group information #passdb backend = smbpasswd:/etc/samba/private/smbpasswd ; This option sets the path to the encrypted smbpasswd file #smb passwd file = /etc/samba/private/smbpasswd ; -= Directory Settings =- ; This option specifies the directory where lock files will be placed #lock directory = /var/lock ; This parameters defines the directory smbd will use for storing such files as smbpasswd and secrets.tdb #private dir = /etc/samba/private ; -= Logging Settings =- ; This option allows you to override the name of the Samba log file log file = /var/log/samba/samba.%m ; This option (an integer in kilobytes) specifies the max size the log file should grow to max log size = 5000 ; Parameter maps how Samba debug messages are logged onto the system #syslog = 1 ; Parameter is set then Samba debug messages are logged into the system syslog only #syslog only = no ; Using the following line enables you to customise your configuration on a per machine ; basis. The %m gets replaced with the netbios name of the machine that is connecting. ; Note: Consider carefully the location in the configuration file of ; this line. The included file is read at that point. #include = /etc/samba/smb.conf.%m ; =========================== ; # - S H A R E S - # ; =========================== [homes] comment = Eigene Dateien guest ok = yes read only = no browseable = no [printers] comment = Drucker path = /var/spool/samba browseable = no available = no guest ok = no printable = yes [BitHalde] comment = 3TB path = /mnt/raid guest ok = yes read only = yes </pre> ==== smb.conf w/o comments ==== <pre>[global] workgroup = KLINGKLANG server string = FileDealer map to guest = Bad User guest account = guest log file = /var/log/samba/samba.%m disable netbios = Yes socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 load printers = No show add printer wizard = No dns proxy = No invalid users = root, nobody, ftp, adm, apache, bin, daemon, games, gdm, haldaemon, halt, lp, mail, messagebus, mysql, news, operator, pop, rpc, shutdown, smmsp, sshd, sync, uucp valid users = evo, guest admin users = evo read list = evo, guest write list = evo force group = users hosts allow = 127.0.0.1, 192.168. hosts deny = ALL wide links = No follow symlinks = No dont descend = /bin,/boot,/dev,/etc,/lib,/opt,/proc,/sbin,/srv,/sys,/tmp,/usr,/var [homes] comment = Eigene Dateien read only = No guest ok = Yes browseable = No [printers] comment = Drucker path = /var/spool/samba printable = Yes browseable = No available = No [BitHalde] comment = 3TB path = /mnt/raid guest ok = Yes </pre> == Using Samba == In this section we will have a look on how to use, start and restart samba === Optimizing Samba === == Testing and Troubleshooting == In this section we will have a look on how we test our configuration and what to do if we ran into problems. === Using ''testparm'' === <blockquote>testparm — check an smb.conf configuration file for internal correctness</blockquote> *: If your done with the setup of your ''smb.conf'' you should run ''testparm''. Do this by simply typing it ;) <pre>$ testparm Load smb config files from /etc/samba/smb.conf Processing section "[homes]" Processing section "[printers]" NOTE: Service printers is flagged unavailable. Processing section "[BitHalde]" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions</pre> :: Normally this is what the output should look like. By pressing enter you will get a list of all used parameters in smb.conf. *: If you wish to have a complete list of all options and how they are set: <pre>$ testparm -v</pre> ==== Using ''smbclient'' ==== <blockquote>smbclient — ftp-like client to access SMB/CIFS resources on servers</blockquote> * Connecting as a guest and list all shares <pre>$ smbclient -L localhost -N Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Sharename Type Comment --------- ---- ------- BitHalde Disk 3TB IPC$ IPC IPC Service (FileDealer) Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Server Comment --------- ------- Workgroup Master --------- ------- KLINGKLANG FILEDEALER</pre> <blockquote>-L ''host'' This option allows you to look at what services are available on a server.<br/> -N Suppresses the normal password prompt. Useful when accessing a service that does not require a password.</blockquote> * Connecting with a specified username and list all shares <pre>$ smbclient -L localhost -U evo Password: Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Sharename Type Comment --------- ---- ------- BitHalde Disk 3TB IPC$ IPC IPC Service (FileDealer) evo Disk Eigene Dateien Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Server Comment --------- ------- Workgroup Master --------- ------- KLINGKLANG FILEDEALER</pre> <blockquote>-U Sets the SMB username or username and password.</blockquote> == To Do == * alle user eintragen (cat /etc/passwd | cut -d':' -f1 | sort) * user scripte vervollständigen * masken richten + upload beim gast/evo gehört root? warum das? * was ist mit umlauten? * --> wie starten? rc.samba * Testmethoden aus dem samba buch einfügen b2507605307c2895beae4c84fa5372d47ca90e8d Samba As PDC 0 146 174 2009-06-06T23:18:26Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] How to use Samba as a Primary Domain Controller by dadexter ---- This tutorial will explain how to use Samba as a Primary Domain Controller using OpenLDAP for authentication. Why: A client of mine is migrating to a Linux server farm, and a mix of Linux and Windows workstations. In order to do that, I set it up at home using SlackWare. STEP 1 ---- The first step in this exercise is to setup Samba to act as PDC. I did that with the samba provided by a standard Slackware 10.1 install. First, we need a config file. Here's a copy of mine: ; /etc/samba/smb.conf ; Machine: Cirion [global] workgroup = SIGTERM netbios name = Cirion server string = Domain Controller [Cirion] hosts allow = 192.168.100. 127. security = user encrypt passwords = yes socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 interfaces = lo eth0 bind interfaces only = yes password level = 20 local master = yes os level = 65 domain master = yes preferred master = yes null passwords = no hide unreadable = yes hide dot files = yes domain logons = yes logon script = login.bat logon path = \\%L\profiles\%U logon drive = H: logon home = \\%L\%U\.9xprofile wins support = yes name resolve order = wins lmhosts hosts bcast dns proxy = no time server = yes log file = /var/log/samba/log.%m max log size = 50 smb passwd file = /etc/samba/private/smbpasswd add user script = /usr/sbin/useradd -m %u delete user script = /usr/sbin/userdel -r %u add group script = /usr/sbin/groupadd %g delete group script = /usr/sbin/groupdel %g add user to group script = /usr/sbin/usermod -G %g %u add machine script = /usr/sbin/useradd -s /bin/false -d /dev/null %u passwd program = /usr/bin/passwd %u passwd chat = "*New password:*" %n\r "*New password (again):*" %n\r \ "*Password changed*" [netlogon] path = /var/lib/samba/netlogon public = no writeable = no browseable = no [profiles] path = /var/lib/samba/profiles browseable = no writeable = yes default case = lower preserve case = no short preserve case = no case sensitive = no hide files = /desktop.ini/ntuser.ini/NTUSER.*/ write list = @users @root create mode = 0600 directory mode = 0770 nt acl support = Yes [homes] comment = Home Directories browseable = no read only = no create mode = 0750 path = /home/%U valid users = %S guest ok = no [winstuff] comment = Windows Stuff path = /usr/local/site/windows public = yes writeable = no browseable = yes write list = @users After the config file is created, restart Samba by issuing the following command as root: '''/etc/rc.d/rc.samba stop''' '''/etc/rc.d/rc.samba start''' Next, we need to add our users to Samba. Please note that is temporary for step 1. We will replace that with LDAP authentication in step 3. '''smbpasswd -a root''' '''smbpasswd -a <USER>''' The 1st command is required to be able to add your Windows machines to the Domain. Run the 2nd one for every user you want to login to this PDC. ---- More to come... I'm not done with the setup. --[[User:Dadexter|dadexter]] 23:51, 27 Aug 2005 (GMT) d258027cfc27a73831ee90f20cd21ec2da25a37a Screen 0 147 175 2009-06-06T23:19:13Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] The screen tool is most commonly used with irc clients. What it actually does is makes the program run in the background and then resume later. For this example im going to use the irssi irc client. First you need to start a term and type the following: screen -S irc Now the -S means what to call the actual session name. Now we have a session started, now lets launch irssi: irssi Now we see the normal screen and this is nothing new. Now press ctrl-a-d. Now your session has now gone away. Now say you want to come back later on another ssh session? well this is possible!: screen -r irc This now shows the session of irssi. Now isn't that COOL :). This is useful for all programs as well not just irc. 4f788c3561a1855ab71863abbcf86186ab5e54cd Security Assessment using Nmap 0 148 176 2009-06-06T23:19:47Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] This tutorial will be a general guide on how to determine what ports have listening services and how to assess if those ports are available to the world wide web. We will be using Nmap, netstat, and telnet. We are concerned with three different things: 1. Assessing localhost (127.0.0.1) on a given machine. 2. Assessing the machine's IP from another machine within the LAN. 3. Assessing the machine from the internet. Running Nmap against localhost can be deceiving, as the ports that are listening on the machine may not actually be available to another machine, on or off the LAN. Note that 127.0.0.1 only pertains to the local machine. This is the loopback address that every machine uses to communicate to itself. I'll compare a localhost scan against a scan that was conducted from another machine on the LAN. I'll scan localhost first: -su-2.05b# nmap localhost Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2007-09-12 17:20 EDT Interesting ports on localhost.home (127.0.0.1): Not shown: 1674 closed ports PORT STATE SERVICE 22/tcp open ssh 25/tcp open smtp 3306/tcp open mysql 5801/tcp open vnc-http-1 5901/tcp open vnc-1 6001/tcp open X11:1 Nmap finished: 1 IP address (1 host up) scanned in 10.662 seconds Now, I'll scan the machine's IP from another machine: root@slackbox:~# nmap 10.150.1.103 Starting Nmap 4.20 ( http://insecure.org ) at 2007-09-12 17:36 EDT Interesting ports on delly (10.150.1.103): Not shown: 1693 filtered ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 3306/tcp open mysql 5900/tcp closed vnc MAC Address: 00:C0:4F:61:28:1F (Dell Computer) Nmap finished: 1 IP address (1 host up) scanned in 22.277 seconds Comparing the two scans, some things are readily apparent: port 25/tcp and 5801/tcp, 5901/tcp, and 6001/tcp aren't as exposed as the other services are. Also, note that certain ports are possibly bound to the IP but not the loopback. The more important aspect of these two scans is the services listening on a non-loopback address, because services use IPs to communicate to other machines, not loopback devices. So, TCP ports 25, 5801, 5901, and 6001 appear to be open. We can test this. Remember, we're concerned about whether these ports can be seen as open to the internet. We'll test this by using telnet. Below, I'm logged into another machine and attempting to telnet on port 25 to the machine we Nmap'd on localhost: root@slackbox:~# telnet 10.150.1.103 25 Trying 10.150.1.103... telnet: connect to address 10.150.1.103: Connection timed out The connection timed out. This is proof that the machine doesn't have services on 10.150.1.103:25 We can also test by running 'netstat -an' on the machine. Whle netstat doesn't connect to the port in question, it does indicate what interface services are using: -su-2.05b# netstat -an | grep -i listen tcp4 0 0 *.5801 *.* LISTEN tcp4 0 0 *.5901 *.* LISTEN tcp4 0 0 *.6001 *.* LISTEN tcp4 0 0 *.3306 *.* LISTEN tcp4 0 0 10.150.1.103.8118 *.* LISTEN tcp4 0 0 10.150.1.103.80 *.* LISTEN tcp4 0 0 127.0.0.1.25 *.* LISTEN tcp4 0 0 *.22 *.* LISTEN tcp6 0 0 *.22 *.* LISTEN See port 25? What IP address is assigned to the service? Loopback! This means that this service isn't exposed to any other machine on the LAN or internet. The other services are listening (for example, *.22) but the '*' usually means that the service is assigned to an interface (which may have a number of IPs assigned to it). Ports 80 and 8118 have an IP assigned to the service, instead of '*'. This means that only IP 10.150.1.103 is assigned to that interface. Ports 80 and 8118 also do not show up when scanning localhost, but yet I can telnet to port 80 and 8118 when using the telnet command (and also browser), using 'telnet localhost 80' or 'telnet localhost 8118'. Port 80 is a web server. Port 8118 is a Privoxy proxy. The reason is probably because my PF install on that machine filters some loopback traffic. If I scan the IP of the machine, port 80 is then detected. The reason is because PF is configured to allow port 80 traffic to/from 'slackbox' from/to 10.150.1.103. What's curious is the fact that the VNC ports (5801, 5901) are showing as assigned to an interface, but not 127.0.0.1 and they aren't reachable from the outside of the machine (so sayeth nmap). They may well be assigned to the 'lo' interface or iptables/pf may be filtering this traffic...this is worth checking out at a later time. All of this is very elaborate. Everything has to be taken into consideration: what the firewall does/doesn't allow; what services run on 127.0.0.x; what services run on interfaces; what services run on IP addresses. The last thing we'll do is scan the LAN from the internet. The results will be determined by what ports the gateway router/firewall are forwarding to machines within the LAN. For example, I know I've port 22/tcp open to the world because I've told my gateway firewall to forward any traffic on 22/tcp to 10.150.1.103. I also don't allow much else and also allow some traffic to be forwarded to different machines within the LAN. So, when a scan is being conducted from the outside, the whole LAN's security posture is taken into account. Now, let us scan from the internet: Starting nmap V. 3.00 ( www.insecure.org/nmap/ ) Interesting ports on pool-xx-xxx-xx-xx.washdc.fios.verizon.net xx.xxx.xx.xxx): (The 1599 ports scanned but not shown below are in state: filtered) Port State Service 22/tcp open ssh 3306/tcp open mysql NICE! Of all the scans we've conducted thus far, this is the one that is most important. The other scans paint the smaller picture, but this one puts it all together and is THE security assessment that one wants to conduct. So, you can see, ports 22 and 3306 are open to the world. This could be two different machines that need those ports open to the internet, or this could be one machine that has those two ports open to the world wide web. While I can reach those ports, my firewall is configured to allow communication from the machine I scanned from. If a machine, from Google.com or any other IP/domain that is not accounted for within the FW policy, attempted the same thing, those ports wouldn't show as opened, as the firewall would drop the traffic. So, while the two ports appear to be open to the world in the above results, they actually aren't, as the traffic is being filtered. I hope all of this has helped some in understanding security and how to assess your LAN gateway and hosts within the LAN. We've used Nmap, telnet, and netstat to determine the security posture of a given machine. There are other tools that I didn't mention for brevity, (such as socklist, tcpdump, snort, for example) but Unix and Linux machines offer much in the way of testing security of a machine. ''This tutorial is mirrored [http://slackfiles.blogspot.com/2007/09/assessment-of-hardened-box.html here]'' --[[User:Unixfool|Ron]] 00:44, 16 September 2007 (EDT) c2629de03fead7d8e0c8e98979a155bd663ba05e Sdogi's Script 0 149 177 2009-06-06T23:20:26Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Security]] <pre># Internet + sharing adsl-start iptables -F iptables -X iptables -t nat -F iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o "ppp0" -j MASQUERADE iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A OUTPUT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT # BANNED FROM LOGS iptables -A INPUT -i "ppp0" -p tcp --dport 445 -j DROP iptables -A INPUT -i "ppp0" -p tcp --dport 135 -j DROP iptables -A INPUT -i "ppp0" -p tcp --dport 139 -j DROP iptables -A INPUT -i "ppp0" -p tcp --dport 113 -j REJECT iptables -A INPUT -i "ppp0" -p tcp --dport 2449 -j DROP # Forwarded or accepted iptables -t nat -PREROUTING -i "ppp0" -p tcp --dport 6002 -j DNAT --to 192.168.0.3 iptables -t nat -A PREROUTING -i "ppp0" -p tcp --dport 1988 -j DNAT --to 192.168.0.2 iptables -t nat -A PREROUTING -i "ppp0" -p udp --dport 1988 -j DNAT --to 192.168.0.2 iptables -t nat -A PREROUTING -i "ppp0" -p tcp --dport 6666 -j DNAT --to 192.168.0.1:8000 iptables -A INPUT -i "ppp0" -p tcp --dport 1984 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 13931 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 8080 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 8001 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 8000 -j ACCEPT iptables -A INPUT -s 192.168.0.4 -p tcp --dport 6000 -j ACCEPT iptables -A INPUT -s 192.168.0.4 -p udp --dport 177 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 2086 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 31731 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 2000:2500 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 6881:6889 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 9176 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 2234 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 5534 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 80 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 21 -j ACCEPT iptables -A INPUT -i "ppp0" -p tcp --dport 22 -j ACCEPT # Log everything else to messages and drop them(logging is not really good idea because # /var/log/messages can get full pretty fast. Look above for making them not show up in logs) iptables -A INPUT -i "ppp0" -p tcp --dport 1:65535 -j LOG iptables -A INPUT -i "ppp0" -p tcp --dport 1:65535 -j DROP </pre> 2a2ef8e7db25076f7eab5cf0804c0e83192bd307 Selkfoster firewall 0 150 178 2009-06-06T23:21:01Z Erik 1 Copy from old wikitext text/x-wiki === rc.fireball === is a simple and powerful firewall script for a Home PC. The most recent version of this script can be found here: http://selkfoster.com.ar/scripts/rc.fireball.gz <pre> #!/bin/sh # Start/stop/restart/status # # Versión: 0.3 Mié Ago 30 16:42:25 ART 2006 # # Escrito por Matías A. Fonzo <selkfoster@gmail.com>, <http://selkfoster.com.ar>. IPT=/usr/sbin/iptables fireball_start() { # INTERFACE POR DEFECTO: IFACE="ppp0" # Flush de reglas: $IPT -F; $IPT -X; $IPT -Z # Políticas por defecto: $IPT -P INPUT DROP $IPT -P FORWARD DROP $IPT -P OUTPUT ACCEPT # Bloquea las conexiones nuevas, excepto, si vienen desde adentro: $IPT -N block $IPT -A block -m state --state ESTABLISHED,RELATED -j ACCEPT $IPT -A block -m state --state NEW -i ! $IFACE -j ACCEPT $IPT -A block -m state --state NEW,INVALID -i $IFACE -j DROP $IPT -A block -p tcp ! --syn -m state --state NEW -i $IFACE -j DROP $IPT -A block -j DROP # Prevención de ataques SYN flood: $IPT -N syn-flood $IPT -A INPUT -i $IFACE -p tcp --syn -j syn-flood $IPT -A syn-flood -m limit --limit 1/s --limit-burst 4 -j RETURN $IPT -A syn-flood -j LOG --log-prefix "SYN flood: " $IPT -A syn-flood -j DROP # Descartar paquetes fragmentados: $IPT -A INPUT -i $IFACE -f -j DROP $IPT -A INPUT -i $IFACE -f -j LOG --log-prefix "pkt frag: " # Recibir PING's desde el exterior: $IPT -A INPUT -i $IFACE -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT # Loguear peticiónes de Ping: $IPT -A INPUT -i $IFACE -p icmp --icmp-type echo-request -j LOG --log-prefix "ping request: " # Activar protección contra IGMP's: $IPT -A INPUT -i $IFACE -p igmp -j DROP # Evitar Spoofing: $IPT -A INPUT -i $IFACE -s 127.0.0.0/8 -j REJECT --reject-with icmp-host-prohibited $IPT -A INPUT -i $IFACE -s 192.168.0.1/16 -j REJECT --reject-with icmp-host-prohibited ## Saltar a la cadena block desde las cadenas INPUT y FORWARD: $IPT -A INPUT -j block $IPT -A FORWARD -j block # Evitar técnicas del tipo "OS fingerprint guessing": $IPT -A OUTPUT -p icmp -o $IFACE --icmp-type 3/4 -j DROP $IPT -A OUTPUT -p icmp -o $IFACE --icmp-type 5 -j DROP $IPT -A OUTPUT -p icmp -o $IFACE --icmp-type 13 -j DROP $IPT -A OUTPUT -p icmp -o $IFACE --icmp-type 14 -j DROP $IPT -A OUTPUT -p icmp -o $IFACE --icmp-type 15 -j DROP $IPT -A OUTPUT -p icmp -o $IFACE --icmp-type 16 -j DROP $IPT -A OUTPUT -p icmp -o $IFACE --icmp-type 17 -j DROP $IPT -A OUTPUT -p icmp -o $IFACE --icmp-type 18 -j DROP # Verificación de dirección. for f in /proc/sys/net/ipv4/conf/*/rp_filter ; do echo "1" > $f done # Envio de mensajes de redireccion. for f in /proc/sys/net/ipv4/conf/*/send_redirects ; do echo "0" > $f done # FORWARD entre interfaces (routing). echo "0" > /proc/sys/net/ipv4/ip_forward # Redireccion de interfaces. for f in /proc/sys/net/ipv4/conf/*/accept_redirects ; do echo "0" > $f done # Para gateway o enrutador. for f in /proc/sys/net/ipv4/conf/*/accept_source_route ; do echo "0" > $f done # IP dinámica (SLIP, PPP o DHCP). echo "1" > /proc/sys/net/ipv4/ip_dynaddr # Ignorar respuestas extrañas de ICMP. echo "1" > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses # Ignorar broadcasts. echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts # Protección TCP SYN Cookie. echo "1" > /proc/sys/net/ipv4/tcp_syncookies # Log marciano (paquetes con direcciónes imposibles). echo "1" > /proc/sys/net/ipv4/conf/all/log_martians # Timestamps. echo "0" > /proc/sys/net/ipv4/tcp_timestamps # Reducir la habilidad de los DoS, reduciendo los timeouts. # Defaults: 60 - 7200 - 16384 echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout echo "3600" > /proc/sys/net/ipv4/tcp_keepalive_time echo "4096" > /proc/sys/net/ipv4/tcp_max_orphans echo "1" > /proc/sys/net/ipv4/tcp_window_scaling echo "0" > /proc/sys/net/ipv4/tcp_sack echo "fireball start on $IFACE" } fireball_stop() { # flush de reglas... $IPT -F; $IPT -X; $IPT -Z # set de políticas... $IPT -P INPUT ACCEPT $IPT -P FORWARD ACCEPT $IPT -P OUTPUT ACCEPT # remover modulos... # para kernel 2.6.16+ for modules in ipt_REJECT xt_limit ipt_LOG xt_tcpudp xt_state iptable_filter ip_conntrack ip_tables x_tables ; do rmmod $modules 2> /dev/null done # anterior a 2.6.16 y de la serie 2.4 #for modules in ipt_REJECT ipt_limit ipt_LOG ipt_state iptable_filter ip_conntrack ip_tables ; do # rmmod $modules 2> /dev/null #done echo "fireball stopped" } fireball_restart() { echo -n "Restarting... " fireball_start } fireball_status() { $IPT -L -n -v } case "$1" in 'start') fireball_start ;; 'stop') fireball_stop ;; 'restart') fireball_restart ;; 'status') fireball_status ;; *) echo "uso $0 start|stop|restart|status" esac </pre> [[Category:Security]] befb4df4f2529bbb9d399b4ea9336839c185a402 Sendmail: Listen on Loopback Only 0 151 179 2009-06-06T23:21:37Z Erik 1 Copy from old wikitext text/x-wiki It is almost always necessary to run the [[sendmail]] daemon, even on systems that don't act as public SMTP servers. Without sendmail, output from [[cron]] and [[at]] jobs won't be delivered. However, unnecessarily exposing your SMTP ports to the Internet or even to a large LAN is poor security practice. This article will explain how to configure sendmail to listen ''only'' on the local [[loopback]] interface (127.0.0.1). === Required Packages === You must have the '''sendmail-cf''' package installed, which in turn requires the '''m4''' package. These packages are available as part of the official Slackware distribution. === Edit the Configuration File === Change into the directory '''/usr/share/sendmail/cf/cf'''. This directory is installed by the sendmail-cf package and contains a wide variety of sample sendmail configuration files. The default configuration on Slackware is the '''sendmail-slackware.mc''' file. Edit this file, and make the following additions: * Along with the other FEATURE options, add this line: <code>FEATURE(`no_default_msa')dnl</code> * Right before the MAILER lines, add this line: <code>DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1,Name=MTA')dnl</code> == Install the Configuration File == <tt>m4 sendmail-slackware.mc >/etc/mail/sendmail.cf</tt> '''Warning:''' If you had previously hard-coded any configuration options in sendmail.cf, they will be overwritten. It is recommended (and generally easier) to make changes only to sendmail-slackware.mc and then rebuild sendmail.cf with the command above. == Restart Sendmail == <tt>/etc/rc.d/rc.sendmail restart</tt> == Sources == * http://rg03.wordpress.com/2007/01/20/making-sendmail-listen-on-the-loopback-interface-only-under-slackware/ [[Category:Security]] 9e20fa0bf226075f8a3f32133b1ad2448991e04e Sendmail TLS SASL SMTP-AUTH 0 152 180 2009-06-06T23:22:18Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] = Sendmail TLS SMTP-AUTH - A Quick and Dirty howto = Reliable, flexible, and configurable enough to solve any mail routing needs, '''sendmail''' has withstood the test of time, but has become no less daunting in its complexity. Even the most experienced system administrators have found it challenging to configure and difficult to understand. We cut through the chase and describe how to setup sendmail with industry standard encryption and discourage spam in less than an hour. Although described as a Slackware specific howto, the actual setup is similar for all UNIX's. This HOWTO is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Copyright (C) 2006 Strykar: s_at_hackerzlair_dot_org * NOTE: I hate wiki markup and the latest and much more readable version of this howto can always be found at [http://www.hungryhacker.com/articles/misc/sendmail_howto.html] == Sendmail server configuration achieved by this howto: == * SMTP-AUTH based relay for authorized users only. * Encrypted SMTP-AUTH client/server transaction preventing sniffing of username and passwords. * Configure and use Cyrus SASL to verify user credentials against the UNIX shadow file. * Create and use your own SSL certificates. Get them signed at no charge by cacert.org and use their CRL. * Disable using the old SSLv2 protocol and support SSLv3 and TLSv1. * Enable/Disable use and verification of client certificates for user identification. * Throttle the number of connections sendmail will accept and limit the number of child processes it spawns. * Use features like delay checks to make full use of the versatile access_db. * Enable blacklisting recipients and use DNSBL for real-time blackisting of known spam hosts. * Use regular expressions and the MAP_REGEX feature to ease complicated header processing and re-writing. -- '''TBD''' * The ability to add any missing/desired sendmail feature to itself by mailing the author a postcard with pictures of mountains in your area. == Prerequisites: == * Untouched Slackware 12 or updated to Slackware-current install Sendmailwise. * Latest version of sendmail - v 8.14.1 at the time of writing. You can check your version by <code>sendmail -d0.1 -bt < /dev/null</code> * Just <code>wget && upgradepkg</code> the latest version from your favorite Slackware mirror. * Make sure the output of the command above at least includes: <blockquote>Compiled with: <code>DNSMAP LOG MAP_REGEX SASLv2 STARTTLS USERDB</code></blockquote> * Ensure you have the latest version of Cyrus-SASL - v 2.1.22 at the time of writing. See that our required password mechanisms are allowed by doing: <code>root@john:~# saslauthd -v saslauthd 2.1.22 authentication mechanisms: getpwent rimap shadow</code><br/>shadow is what we will use. * A real hostname that is available when you: <code>host myhost.org</code> * Reset any configurations you may have played with for Cyrus-SASL and sendmail. Keep your pack of smokes and mug of coffee handy. Figure out why your system won't play nice if it doesn't meet any of the above prerequisites. * Call that friend who told you to move to Postfix and ask him to call you back in an hour. === Diving right in: === ''For the purpose of this HOWTO, we will assume the FQDN of the host is <code>john.doe.org.</code>'' First, start by creating your private key and Certificate Signing Request (CSR) as shown in the much easier than before steps below. The only field in you need to fill is the Common Name (CN). Put your mailserver hostname there when prompted, like <code>mail.doe.org</code> <br /><code>root@john:~# openssl genrsa 1024 > smtp.key.pem <br />root@john:~# openssl req -new -key smtp.key.pem > newreq.csr</code> Get the CSR signed by CAcert.org. That will give you the server certificate, paste it into a file named <code>smtp.cert.pem</code> '''1.''' Make sure you have the user <code>smmsp</code>, sendmail will not start up unless it has it's own userid: <code>root@john::~# cat /etc/passwd | grep smmsp smmsp:x:25:25:smmsp:/var/spool/clientmqueue:</code> <br/>If not, create one: <code>root@john:~# groupadd -g 25 smmsp <br />root@john:~# useradd -u 25 -g 25 -c smmsp -d /var/spool/clientmqueue -s /usr/bin/true smmsp <br />root@john:~# mkdir -p /var/spool/clientmqueue /var/spool/mqueue <br />root@john:~# chmod 770 /var/spool/clientmqueue <br />root@john:~# chown smmsp /var/spool/clientmqueue <br />root@john:~# chgrp smmsp /var/spool/clientmqueue <br />root@john:~# chmod 700 /var/spool/mqueue <br />root@john:~# chown root /var/spool/mqueue <br />root@john:~# chgrp daemon /var/spool/mqueue </code> '''2.''' Now edit <code>/etc/mail/access</code> and make sure your hostname is in there: <code>root@john:~# cat /etc/mail/access <br/>john.doe.org RELAY <br/>doe.org RELAY</code> '''3.''' Now edit <code>/etc/hosts</code> and make sure 127.0.0.1 points to localhost: <code>root@john:~# cat /etc/hosts <br/>127.0.0.1 localhost localhost.localdomain <br/>1.2.3.4 john.doe.org john</code> Replace 1.2.3.4 with the actual public IP address of your mailserver. '''4.''' Now edit <code>/etc/resolv.conf</code> and make sure the DNS settings your ISP provided you are in there: <code>root@john:~# cat /etc/resolv.conf search doe.org nameserver 1.2.3.4</code> Replace 1.2.3.4 with the IP address of your ISP's DNS box. '''5.''' Create a directory where sendmail will read your certificates for TLS from: <code>root@john:~# mkdir /etc/mail/certs</code> Download the CAcert root certificate and their CRL from http://www.cacert.org/index.php?id=3 and name them <code>CA.cert.pem</code> and <code>revoke.crl</code> Copy all three (including the private key file) into <code>/etc/mail/certs</code> These need strict permissions as they shouldn't be world-readable: <code>root@john:~# chmod -R 700 /etc/mail/certs root@john:~# chown -R root:sys /etc/mail/certs</code> '''6.''' Whip up your favorite editor (mine's <code>joe</code>) and edit <code>/usr/share/sendmail/cf/cf/sendmail-slackware-tls-sasl.mc</code> Make sure it includes all the options below. CAREFULLY READ the notes after the end of the configuration, denoted by <code>dnl# EOF</code> to understand the additions I have made to the default <code>sendmail-slackware-tls-sasl.mc</code> file. Ensure you know what you're doing if you modify anything. <code> root@john:~# cat /usr/share/sendmail/cf/cf/sendmail-slackware-tls-sasl.mc<br /><br /> dnl# This is the a sendmail .mc file for Slackware with TLS support.<br /> dnl# To generate the sendmail.cf file from this (perhaps after making<br /> dnl# some changes), use the m4 files in /usr/share/sendmail/cf like this:<br /> dnl#<br /> dnl# cp sendmail-slackware-tls.mc /usr/share/sendmail/cf/config.mc<br /> dnl# cd /usr/share/sendmail/cf<br /> dnl# sh Build config.cf<br /> dnl#<br /> dnl# You may then install the resulting .cf file:<br /> dnl# cp config.cf /etc/mail/sendmail.cf<br /> dnl#<br /> include(`../m4/cf.m4')<br /> VERSIONID(`TLS supporting setup for Slackware Linux')dnl<br /> OSTYPE(`linux')dnl<br /> dnl#<br /> dnl# You will need to create the certificates below with OpenSSL first:<br /> define(`confCACERT_PATH', `/etc/mail/certs/')<br /> define(`confCACERT', `/etc/mail/certs/CA.cert.pem')<br /> define(`confSERVER_CERT', `/etc/mail/certs/smtp.cert.pem')<br /> define(`confSERVER_KEY', `/etc/mail/certs/smtp.key.pem')<br /> define(`confCRL', `/etc/mail/certs/revoke.crl')<br /> dnl# These settings help protect against people verifying email addresses<br /> dnl# at your site in order to send you email that you probably don't want:<br /> define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl<br /> dnl# Uncomment the line below to send outgoing mail through an external server:<br /> dnl define(`SMART_HOST',`mailserver.example.com')<br /> dnl# No timeout for ident:<br /> define(`confTO_IDENT', `0')dnl<br /> dnl# Enable the line below to use smrsh to restrict what sendmail can run:<br /> dnl FEATURE(`smrsh',`/usr/sbin/smrsh')dnl<br /> dnl# LOCAL_CONFIG dnl <br/>dnl#CipherList=ALL:!ADH:!NULL:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:-LOW:+SSLv3:+TLSv1:-SSLv2:+EXP:+eNULLdnl#dnl<br /> See the README in /usr/share/sendmail/cf for a ton of information on<br /> dnl# how these options work:<br /> FEATURE(`delay_checks')dnl<br /> FEATURE(`use_cw_file')dnl<br /> FEATURE(`use_ct_file')dnl<br /> FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl<br /> FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl<br /> FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl<br /> FEATURE(`blacklist_recipients')dnl<br /> dnl #FEATURE(`enhdnsbl', `relays.ordb.org', `', `t', `127.0.0.2')<br /> FEATURE(`dnsbl',`dnsbl.sorbs.net',`"554 Rejected spam as" $&{client_addr} " found in dnsbl.sorbs.net"')dnl<br /> FEATURE(`enhdnsbl', `zen.spamhaus.org', `"Spam blocked see: http://www.abuse.net/sbl.phtml?IP="$&{client_addr}', `t')dnl<br /> FEATURE(`enhdnsbl', `bl.spamcop.net', `"Spam blocked see: http://spamcop.net/bl.shtml?"$&{client_addr}', `t')dnl<br /> FEATURE(`enhdnsbl', `list.dsbl.org', `"Spam blocked see: http://dsbl.org"$&{client_addr}', `t')dnl<br /> FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl<br /> FEATURE(`always_add_domain')dnl<br /> FEATURE(`redirect')dnl<br /> FEATURE(`no_default_msa')dnl<br /> dnl# Turn this feature on if you don't always have DNS, or enjoy junk mail:<br /> dnl FEATURE(`accept_unresolvable_domains')dnl<br /> EXPOSED_USER(`root')dnl<br /> dnl# Also accept mail for localhost.localdomain:<br /> LOCAL_DOMAIN(`localhost.localdomain')dnl<br /> MAILER(local)dnl<br /> MAILER(smtp)dnl<br /> MAILER(procmail)dnl<br /> dnl# Allow SASL authentication/relaying:<br /> define(`confAUTH_OPTIONS', `A p y')dnl<br /> define(`confAUTH_MECHANISMS', `LOGIN PLAIN DIGEST-MD5 CRAM-MD5')dnl<br /> TRUST_AUTH_MECH(`LOGIN PLAIN DIGEST-MD5 CRAM-MD5')dnl<br /> DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl<br /> DAEMON_OPTIONS(`Port=smtps, Name=MSA-SSL, M=E')dnl<br />dnl# EOF </code> Notice the filenames in <br/><code>define(`confCACERT', `/etc/mail/certs/CA.cert.pem') <br/>define(`confSERVER_CERT', `/etc/mail/certs/smtp.cert.pem') <br/>define(`confSERVER_KEY', `/etc/mail/certs/smtp.key.pem')</code> -- make sure your certificates are named exactly the same as in your mc configuration. I use free certificates signed by [http://www.cacert.org www.cacert.org] and use their CRL - <code>define(`confCRL', `/etc/mail/certs/revoke.crl')</code> above. The <code>define(`confAUTH_OPTIONS', `A p y')dnl</code> configures sendmail to: * <code>A</code> is a workaround for broken MTAs that do not implement RFC 2554. * The <code>p</code> option tells sendmail: "don't permit mechanisms susceptible to simple passive attack (e.g., <code>LOGIN, PLAIN</code>), unless a security layer (think TLS tunnel) is active." * The <code>y</code> option prohibits anonymous logins. Take note that this will only allow <code>LOGIN/PLAIN SMTP-AUTH</code> after encryption has been established in a TLS tunnel. Allowing both TLS and non-TLS <code>PLAIN/LOGIN SMTP-AUTH</code> is left as an exercise to the reader. Read: http://www.sendmail.org/~ca/email/doc8.12/op-sh-5.html#sh-5.6 for more information. The <code>define(`confCONNECTION_RATE_THROTTLE', `100')</code> and <code>define(`confMAX_DAEMON_CHILDREN',`1000')</code> are for my configuration and should be set to 50% higher than what your requirements are. If you don't understand what this does (sendmail forks); comment those two lines out with a <code>dnl#</code> before them like: <code>dnl# define (`confMAX_DAEMON_CHILDREN',`1000')</code> None of my user's email clients use certificates; this tells sendmail not to ask for them for one: <code>define(`confTLS_SRV_OPTIONS', V')</code> '''SLACKWARE USERS NOTE''' line 37: <code>LOCAL CONFIG CipherList=ALL:!ADH:!NULL:!EXPORT56:RC4 RSA: HIGH: MEDIUM:-LOW: SSLv3: TLSv1:-SSLv2: EXP: eNULL</code> This disables using the older SSLv2 protocol and allows SSLv3 and TLSv1. You'll need some <code>openssl ciphers</code> and <code>perl</code>-fu to get this going with Slackware 12 as it's not compiled with <code>_FFR_TLS_1. STARTTLS</code> Read [http://sial.org/howto/sendmail/cipherlist this for info] on setting it up in Slackware, it's trivial. Some older clients don't speak TLS and you may want to skip this. '''7.''' Now: <code>root@john:~# cd /usr/share/sendmail/cf/cf <br/>root@john:~# m4 sendmail-slackware-tls-sasl.mc > /etc/mail/sendmail.cf</code> Also remember that the mc file should always end in a new line. So hit enter at the end of <code>sendmail-slackware-tls-sasl.mc</code> if m4 crashes with an <code>m4: INTERNAL ERROR: recursive push_string error</code>. '''8.''' If the previous command gives no errors, you're done! Simply restart sendmail using <code>/etc/rc.d/rc.sendmail restart</code> Now see what sendmail is saying by <code>tail -f /var/log/maillog</code> You can increase log verbosity by adding: <code>-O LogLevel=16</code> to <code>/etc/rc.d/rc.sendmail</code> '''9.''' Also: Add hosts for which you receive mail to <code>/etc/mail/local-host-names</code> <code>root@john:~# cat /etc/mail/local-host-names</code> <code><br/># names of hosts for which we receive email <br/>john.doe.org doe.org</code> '''10.''' Make sure SASL is with you: <code>root@john:~# cat /usr/lib/sasl2/Sendmail.conf</code> <br/><code>pwcheck_method:saslauthd mech_list:login plain</code> <code>root@john:~# testsaslauthd -u yourusername -p yourpassword</code> If you see: <code>0: OK! Success!</code> Congratulations! SASL is now working. If not, make sure saslauthd is running by: <code>/etc/rc.d/rc.saslauthd start</code> '''11.''' Most errors are because of not following this HOWTO to the T. Go over each step again and confirm you did everything right. 1c686bb774fa50e46559d9f5c22d40e28dc0bf33 Server firewall 0 153 181 2009-06-06T23:22:58Z Erik 1 Copy from old wikitext text/x-wiki An iptables script with ingress/egress filtering, rate-limiting, logging and dynamic IP allow/block listing and more. Useful as a starting point when making your own server firewall policy. Does not do NAT and is intended for a standalone public server running some services. To prevent having to update the script in 2 places, you can find the latest version at http://www.hungryhacker.com/articles/security/rc.firewall.html - Strykar [[Category:Security]] 18979e026e1777142bfaef17fc6f66a178a39e0c Shoutcast radio 0 154 182 2009-06-06T23:23:25Z Erik 1 Copy from old wikitext text/x-wiki = Introduction = This tutorial is written for people who want to broadcast music to other people but don't know how. This tutorial is dealing with SHOUTCAST client and server, although there are many others. Also this tutorial is going to teach you how to make a "radio" user. So you can give other people this users password and they can broacast music too. = Getting Started = First thing to do is make an user account for radio. Let's choose user radio: <pre>adduser radio</pre> Put the home directory wherever you want. Firstly, download the [http://www.shoutcast.com/download/files.phtml server] and [http://www.shoutcast.com/download/broadcast.phtml broadcasting tool]. Now comes unpacking part.. first let's unpack server: <pre> tar zxvf shoutcast-(your version here).tar.gz tar zxvf sc_trans_posix_(your version here).tgz </pre> You should rename the server directory to shoutcast: <pre>mv shoutcast-(your version here).tar.gz shoutcast</pre> and broadcasting tools folder to sc_sender: <pre>mv sc_trans_posix_(your version here).tgz sc_sender</pre> This is done to make scripts work, we talk about them later. Now you should configure server and broadcasting tool as you like. There are some things you should definately do though, for the scripts. = Configuring the Broadcasting Tool = First create a playlist file: <pre>touch sc_sender/playlist</pre> Now configure the broadcasting tool. Let's cd to it's directory and delete some files we don't want and rename binary: <pre> cd sc_sender rm sc_trans_freebsd sc_trans_macosx example.lst # unneeded files mv sc_trans_linux sender # rename for convenience </pre> Now open sc_trans.conf in your favourite editor, and change: * "PlaylistFile" to "playlist" * "ServerIP" to "localhost" * "LogFile" to blank * Your password * "Shuffle" to "0" The logfile is blanked to avoid broadcasting tool crashing. When log file grows too big, the broadcasting tool usually crashes. There are lots of other things to edit; fortunately this file is well commented. = Configuring the Shoutcast Server = <pre>cd ../shoutcast && pico sc_serv.conf</pre> Only thing you need here is setting password to the same password you did set broadcasting tool. Then edit 'MaxUser' to something you can handle. And then disable LogFile again.(same problem as broadcasting tool): <pre>LogFile=</pre> Nothing more is needed. You should edit things like 'TitleFormat' etc for making it look nice on http:/yourhost:8000 and client player. = Configuration of scripts = Now create 'bin' directory to your radio user's root dir. <pre>mkdir bin</pre> After that create a file '.profile' to your users root dir. <pre>pico .profile</pre> Add this line to that file: <pre>export PATH=~/bin:$PATH</pre> Character ~ stands for your homefolder, so with my user radio it's like /home/radio/ and ~/bin means /home/radio/bin/. Now if you use program 'screen' alot then you should add the same line to a file .bashrc too. Because 'screen' doesn't use .profile. Now go to your bin directory and download scripts. <pre>cd ~/bin/</pre> and <pre>wget http://www.hot.ee/sdogi/scripts.tar.gz</pre> then unpack them and delete scripts.tar.gz <pre>tar zxvf scripts.tar.gz</pre> and <pre>rm scripts.tar.gz</pre> These scripts are all simple bash scripts. If you didn't follow my filenaming and playlist creation then you can always change filenames from those scripts. Also you could change them however you like and put a newer and better ones link up here. These are kind a outdated. Now I have created scripts that you can use from remote host. Like you write "next" and ssh connection is made to radio server to change the song with signal. It is actually easy to implement to those scripts if you are familiar with bash. Although it is possible that I will some day add my improved scripts here. = Add command = Add command works like this. You go to some folder, find some file you like, and then you write <pre>add filename.mp3</pre> Pretty simple eh? Anyway, if i remember correct it won't support adding multible files, if it does it's great. But what it does support is just writing add, then it adds all files from folder, also the folder name, which could screw up the playing, so you usually do like this <pre>cd somefolder/</pre> and <pre>add</pre> and then you write edit and get rid of the folder name. Edit uses pico so you just press Ctrl+K on the folder line and it removes the whole line. = Other scripts and using them all together = Now basic usage of those scripts is like this. You log to system, want to change songs... first you write 'dlist' it deletes your old playlist. Then you go and add some mp3's with add command. If just wrote add in a folder you write 'edit' after adding all the songs and you remove stuff you don't want. These could be the songs you don't want, folder names and maby even pictures or some other crap. After you have done editing you just write 'reload' to load new playlist in. After that you can again delete that playlist, it's known to broadcasting tool already. For checking what files are in the playlist you write 'list', dohh.. for next song you write 'next' if you want to check what song is playing without going to webinterface(http://localhost:8000) you write 'radio'. Also there is a command 'shuffle' which shuffles, dohh. = Making it all run 24/7 = When you are creating a dedicated Shoutcast server, you should make it come up even when program crashes or computer goes rebooting for some reason. For this i have made simple spawn scripts. You can get them here: <pre>wget http://www.hot.ee/sdogi/spawn.tar.gz</pre> Extract it to your users root dir. Like this: <pre>tar zxvf spawn.tar.gz</pre> Delete spawn.tar.gz, and again, if you didn't follow my renamings, sc_trans_linux to sender, etc then you should edit these two files. Spawn is for server and spawn2 is for broadcasting tool. you have to set exec bit on them if they don't have one. You do it like this: <pre>chmod +x spawn spawn2</pre> Also keep in mind that if you let some other guy to broadcast to your radio you should take exec bit off from spawn2, because it will autoconnect and rune your friends broadcast be overbroadcasting it. You do it like this: <pre>chmod -x spawn2</pre> And then kill your broadcasting tool. Do it like this: <pre>killall sender</pre> Now for the crontab part finally. Crontab is for making it to exec spawn and spawn2 every couple of minutes. You can edit crontab by writing <pre>crontab -e</pre> This brings up crontab file in vi. If you don't like vi you can do <pre>export VISUAL="pico"</pre> and use pico. Then type crontab -e. Anyway, to crontab you have to add two lines, these are: <pre> */10 * * * * ~/spawn &> /dev/null */10 * * * * ~/spawn2 &> /dev/null </pre> This makes crontab hit spawn and spawn2 after every 10 minutes. You can make this interval larger or smaller if you want. And remember, if spawn and spawn2 don't have exec bit, they aren't ran. [[Category:Tutorials]] 1382022dee12391b59b36496910e421b4d89efe2 Showing Slackware Changelog 0 155 183 2009-06-06T23:23:57Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] Since this is most useful on Login, make sure to comment out /etc/rc.d/rc.S, line 385 (or 334 in Slack 12) so it reads # echo "$(/bin/uname -sr)." > /etc/motd Otherwise, Slackware will keep printing the kernel version you're using. root@tachikoma:/tmp# cat /etc/cron.daily/slacklog #!/bin/sh wget -q ftp://ftp.slackware.com/pub/slackware/slackware-10.2/ChangeLog.txt -O /tmp/slacklog.$$ diff /tmp/.slack-changelog /tmp/slacklog.$$ > /etc/motd mv /tmp/slacklog.$$ /tmp/.slack-changelog root@tachikoma:/tmp# cat /etc/motd 0a1,17 > Tue Sep 19 14:07:49 CDT 2006 > patches/packages/gzip-1.3.5-i486-1_slack10.2.tgz: > Upgraded to gzip-1.3.5, and fixed a variety of bugs. > Some of the bugs have possible security implications if gzip or its tools are > fed a carefully constructed malicious archive. Most of these issues were > recently discovered by Tavis Ormandy and the Google Security Team. Thanks > to them, and also to the ALT and Owl developers for cleaning up the patch. > For further details about the issues fixed, please see: > http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-0758 > http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-0988 > http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-1228 > http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-4334 > http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-4335 > http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-4336 > http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-4337 > http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-4338 > (* Security fix *) 1f9d16373f60c980af859b0b36521e5e77a1894e Simple firewall 0 156 184 2009-06-06T23:24:31Z Erik 1 Copy from old wikitext text/x-wiki This script should suit most people well - simply edit the EXT_IF variable below and replace it with your network interface that's connected to the net. --rworkman #!/bin/bash # Define variables IPT=/usr/sbin/iptables # change if needed EXT_IF=eth0 # external interface (connected to internet) # Enable TCP SYN Cookie Protection # ** comment the line below if it throws an error; # ** TCP_SYN_COOKIES must be enabled in the kernel # ** for this to work echo 1 > /proc/sys/net/ipv4/tcp_syncookies # Disable ICMP Redirect Acceptance echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects # Do not send Redirect Messages echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects # Enable bad error message protection echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses # Enable broadcast echo protection echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts # Disable source-routed packets echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route # Log spoofed packets, source-routed packets, and redirect packets echo 1 > /proc/sys/net/ipv4/conf/all/log_martians # Set default policy to DROP $IPT -P INPUT DROP $IPT -P OUTPUT ACCEPT $IPT -P FORWARD DROP # Flush old rules $IPT -F # Allow loopback traffic $IPT -A INPUT -i lo -j ACCEPT $IPT -A OUTPUT -o lo -j ACCEPT # Allow packets of established connections and those # which are related to established connections $IPT -A INPUT -i $EXT_IF -p all -m state --state ESTABLISHED,RELATED -j ACCEPT # Allow incoming ssh from internet # ** (uncomment the line below if you want to allow incoming ssh) #$IPT -A INPUT -i $EXT_IF -p tcp --destination-port 22 -m state --state NEW -j ACCEPT [[Category:Security]] 2e131379ce0fd481c1eb0997ac7bdd0b2556463c SlackRoll Tutorial 0 157 185 2009-06-06T23:25:35Z Erik 1 Copy from old wikitext text/x-wiki <strong>SlackRoll</strong> is a package or update manager for Slackware Linux. Part of this tutorial has been taken from its [http://wiki.github.com/rg3/slackroll/ official webpage] and FAQ. SlackRoll's defining points: * Its internal mechanism based on package states. * Like <em>slackpkg</em>, SlackRoll only works with official mirrors, meaning that to keep third party packages up to date you need to perform the task by hand (recommended practice, using SlackBuild scripts) or use a second different tool. * It does not try to compare package version numbers to decide if a package should be upgraded or not. * Partly as a consequence of the previous point, it has no known flaws detecting package updates (including reverts), new packages, removed packages, third party packages getting an official version and blacklisted packages (<em>frozen</em> in its terminology) being removed. * It has a broad range of operations and features. * It attempts to be fast. Most internal operations like listing available upgrades usually take less than one second on a modern computer. = Installation = == Requirements == * Python 2.4 or later (provided by package <em>python</em> starting with Slackware 10.1). * GnuPG (provided by package <em>gnupg</em> or <em>gnupg2</em>). * Vim (provided by package <em>vim</em>). * A pager which is <em>less</em> by default (provided by package <em>less</em>). == Procedure == Download the SlackRoll package from the [http://github.com/rg3/slackroll/downloads project download page] and install it in your system using <tt>installpkg</tt>. = Background Information = The majority of SlackRoll commands that receive a list of packages expect only the package names (<em>foo</em> as opposed to <em>foo-1.1-i486-3.tgz</em>). Some of them also allow using a specific version, but they are the exception. SlackRoll creates a persistent database of packages in your hard drive. Each package is in one of several possible states. Part of the initial configuration consists in deciding which states some of your packages will have. There are two types of states: states to avoid (temporary states) and normal states. When the remote Slackware official tree is updated, SlackRoll may put some packages in temporary states. By upgrading, installing, removing and marking packages your objective is to correct those packages and put them in a normal state. == States to Avoid == === New === New packages are packages present in the remote tree that weren't present before. You should decide if you want to install them or mark them as not installed. === Outdated === Outdated packages are present in your system, but the version you have does not match any relevant one in the remote tree. You should upgrade these packages. === Unavailable === Unavailable packages are packages present in your system. Previously, they probably existed in the remote tree, but now they do not seem to be available for downloading and installing. You should decide if you want to remove them or mark them as foreign. == Normal States == === Installed === Installed packages are very common. They are present in your system and in the remote tree, and both versions match. === Not Installed === Not installed packages are also very common. They are present in the remote tree but not in your system. They can be downloaded and installed if you want. === Foreign === Foreign packages are packages present in your system but not in the remote tree. However, unlike unavailable packages, they are supposed to be present in your system. No package will enter this state automatically. Only the ones you mark. It's usually reserved for third party packages and packages you build yourself. It's worth noting that if a foreign package ever appears in the remote official tree, it will be marked as installed or, probably, outdated. Thus, SlackRoll will give priority to the new official package over yours. If you still want to use your own build, mark it as frozen. === Frozen === Frozen packages are present in your system and in the remote tree. Your version may or may not match the ones from the remote tree, but SlackRoll will not tell you they need to be upgraded. No package will enter this state automatically. It's usually reserved for packages that shouldn't be upgraded automatically or ever (<em>aaa_elflibs</em>, kernels, etc) and sometimes for customized versions of official packages. It's also worth mentioning that a frozen package will be moved to unavailable if it disappears from the remote tree. It that happens and you want to continue using it, you'll need to mark it as foreign. = Initial Configuration = Word of warning: it's highly recommended to do the initial configuration from an up-to-date and controlled system. This will avoid confusion and helps preventing mistakes setting the initial package states. == Preparing Your System == Choose a Slackware mirror for your Slackware version. Use the <em>set-mirror</em> operation to select one mirror. SlackRoll can work with stable trees as well as the <em>current</em> tree. Example: # slackroll set-mirror 'http://slackware.example.org/slackware-current/' Do not forget to include the trailing slash in the mirror URL. Import, to your keyring, the GnuPG key used to sign the official Slackware packages. This key can be found in Slackware CDs and DVDs as the file GPG-KEY, and you can import the key to your keyring using the command <em>gpg --import</em>, but SlackRoll is able to download the key from the mirror and importing it automatically, if you trust the mirror. # slackroll import-key Finally, retrieve the mirror information for the first time. This will download a few metadata files, and this is what you need to do when you're going to handle a new round of updates. # slackroll update == Going Over Package States for The First Time == When you run SlackRoll for the first times, it will put every remote package not present in your system in the state New. When your system is up to date and under control, you can blindly mark every new package as not installed with the following command: # slackroll new-not-installed Any third party package present in your system will be put in the state Unavailable. When your system is up to date and under control you can blindly mark all unavailable packages as foreign. <em>However</em>, the number of foreign packages is usually not very high and forgetting to remove from your system a package that was removed from the remote tree is a common mistake. The Book of Best Practices would suggest that you review the list of unavailable packages once and carefully in order to detect packages that should not be present in your system. To print the list run: # slackroll list-unavailable If you locate any package that needs to be removed, you can remove them using <em>removepkg</em> or the <em>remove</em> operation. The later has additional functionality so it's recommended: # slackroll remove foo bar Now you can mark the rest as foreign packages. # slackroll unavailable-foreign Finally, you probably want to mark some packages as frozen. It's usually a good idea to do this with <em>aaa_elflibs</em>, kernel packages and others. # slackroll frozen aaa_elflibs foo bar = Day to Day Usage = Apart from the operations listed here, you can run the <em>help</em> operation to get the full list of supported operations, along with a brief description of each one. A more detailed description can be found in the [http://wiki.github.com/rg3/slackroll/operations-guide operations guide]. == New Round of Updates == What to do when there is a new round of updates? The Book of Best Practices suggests taking care of different events in a specific order: * Updates to glibc-solibs, sed and pkgtools need to be handled first, in that order. * If there are new packages, handle them second. * Then, it's time to upgrade outdated packages. * If packages have been deleted from the remote tree, handle them last. This is the correct order in 99% of the cases. SlackRoll will attempt to warn you and ask for confirmation if it detects you may be breaking this order. However, <strong>you</strong> have the last word on what to do, so proceed with caution and don't break your system. First, update the remote mirror information with the <em>update</em> operation we mentioned before. New changelog entries will be saved to your hard drive. It's recommended that you take a look at the changelog at this point, using the <em>changelog</em> operation. Then, get an overview of the events using the <em>list-transient</em> operation, which will list the new, outdated and unavailable packages along with a big fat warning message if activity in key system packages is detected. The best way to deal with glibc-solibs, sed and pkgtool updates is to use the <em>upgrade-key-packages</em> operation. # slackroll upgrade-key-packages You could also use the <em>install</em> operation. Despite its name, it can be used to both install and upgrade individual packages. Let's suppose packages <em>glibc-solibs</em> and <em>sed</em> where updated: # slackroll install glibc-solibs sed The <em>install</em> operation is one of the few operations allowing you to pass specific package versions. It will proceed in the order you indicate, so remember to give the packages in the correct order if you use this method. Second, you should handle new packages. You can clearly get a list of new packages with the <em>list-new</em> operation. New packages can be installed with the <em>install</em> operation as we just showed. When installing a remote package, SlackRoll will give you the opportunity of selecting the version to install if there are several available in the remote tree. Or, if you are not interested in installing a new package, mark it as not installed: # slackroll not-installed foo bar If the package names are not enough for you to decide if you want to install it or not, you can always use the <em>info</em> operation and SlackRoll will download and display the package info file (small <em>txt</em> files in the remote tree). And, of course, be carefull with new libraries as they may have been included to extend the functionality of an existing package you may have installed. The third step is taking care of outdated packages. For that, a few operations are available. <em>list-upgrades</em> lets you see a summary of the available upgrades. You can download and install them with <em>upgrade</em> or download them with <em>download-upgrades</em> or even print their URLs with <em>urls-upgrades</em>. And, finally, review the list of unavailable packages. Be careful with unavailable packages. Sometimes you install a foreign package but forget to mark it as such in SlackRoll. To avoid that problem, it's better to install them with the <em>install-foreign</em> operation. Individual unavailable packages can be removed with the <em>remove</em> operation as we showed before, and also all of them at the same time with the <em>remove-unavailable</em> operation. == Installing and Removing Individual Packages == There are a few operations related to installing and getting some information about individual packages. The most common ones are <em>install</em> to upgrade or install packages, <em>info</em> to maybe download and display package info files, <em>urls</em> to get a list of URLs and <em>remove</em> to remove individual packages. Operations that install packages let you manage <em>.new</em> files after the installation is completed, in a similar way to <em>slackpkg</em>. You can view the differences between the <em>.new</em> file and its counterparts with <em>vimdiff</em> (which provides a nice and colorized way of spotting the differences and maybe porting the old configuration to the new file), you can overwrite the old file with the <em>.new</em> file, delete the <em>.new</em> file directly, etc. Additionally, removal operations also track pairs of <em>.new</em> files and give you the opportunity of deleting configuration files that have been left behind. You are not forced to remove the files left behind, of course. Upgrade operations will perform both tasks. First, they will let you review the <em>.new</em> files and then they will give you the opportunity of deleting obsolete configuration files left behind. While using <em>vimdiff</em>, turning off syntax highlighting is recommended. <em>Vim</em> uses colors to highlight file differences and those can interfere with syntax highlighting colors, making text invisible or hard to read. Syntax highlighting can be turned off temporarily by using "<tt>:syntax off</tt>" in command mode, or you can disable it permanently putting "<tt>syntax off</tt>" in your <tt>~/.vimrc</tt> file (noting that usually you run SlackRoll as the superuser). == Managing Customized Versions of Official Packages == There are at least three ways of dealing with customized versions of official packages. These are custom versions or compilations of packages present in the remote official tree. They are normally used to add or remove features, or activate or apply patches that are disabled by default. For example, if you want to activate the <em>freetype</em> bytecode interpreter, you need to rebuild that package. The simplest way of dealing with these packages is to give them the same name and version as the official packages. When they are upgraded in the remote tree, however, SlackRoll will want to upgrade them. You can mark them as frozen before upgrading and only unfreeze them after you have rebuilt the new version, if you want to avoid SlackRoll replacing them with the new official version. Second, you can give them the same name and version as the official package, <strong>but</strong> keep them frozen all the time. How would you know then if they need to be rebuilt? With the <em>list-outdated-frozen</em> operation. Take into account the information given by <em>list-outdated-frozen</em> is not reflected by any other command. Specifically, it's not reflected as part of <em>list-transient</em> and friends. Third, you can give them a name or version different to the official package. Typically this means adding a custom build suffix and marking the package as frozen. How would you know if you need to rebuild it? Paying attention to the changelog specifically searching for upgrades in those packages and also using the <em>list-versions</em> operation, that lets you view the different known versions of a package, including local and remote ones. == Maintenance == SlackRoll barely requires maintenance. It keeps all downloaded packages in its package cache, located in the <em>/var/slackroll/packages</em> directory. When downloading files, it keeps them in a temporary directory until they're fully downloaded. If you want to remove every downloaded package, you can simply perform <code>slackroll erase-cache</code>. There is, however, a <em>clean-cache</em> operation which does <strong>not</strong> remove every downloaded package, but only those that are no longer present in the remote tree. Running that operation from time to time keeps your package cache sane and controlled. It may also be a good idea to delete the temporary directory contents from time to time, with <code>slackroll erase-tmp</code>, but it should be empty unless you interrupt SlackRoll while downloading stuff and never attempt to complete the download. == Other Operations == If you run the <em>help</em> operation you will see SlackRoll has many other operations, including operations to list packages by state, list local packages, list remote packages and list all known packages. It has operations to put packages in specific states and checking the state of packages. You can also download, install, display info or remove new or unavailable packages or packages with a matching path (like <em>/slackware/kde/</em>). Finally, there are search operations, to search for packages by name or path, search for files in your local system (like running <em>grep</em> on the contents of <em>/var/log/packages</em>), query the Slackware Package Browser, and finally a few very slow but sometimes useful operations to search for broken symlinks under a specific hierarchy and the same for orphan files (files not belonging to any package), as well as searching for missing files. As a general rule, every operation either does not accept arguments or allows a list of them. Operations accepting packages as arguments expect the package name only unless the help text mentions that they also accept specific package versions. Some operations need regular expressions. For the most part they have the same syntax as they have in <em>grep</em> or <em>Perl</em>, but you can read the [http://docs.python.org/lib/re-syntax.html Python regular expressions syntax reference] if you want to perform an unusually complex search. [[Category:Tutorials]] 293de572ee50a5b8ce6c81a72544e87c6ea662d6 Slackware-Upgrade-HowTo 0 158 186 2009-06-06T23:26:40Z Erik 1 Copy from old, had no category, placed in Tutorials wikitext text/x-wiki [[Category:Tutorials]] === Upgrading to Slackware 12.0: List of things to do beforehand === ====Get the installation discs & other software ==== ---- *Slackware Install Discs I, II & III *Download /patches directory for 12.0 from one of Slackware's mirrors *Download nvidia Linux driver installer utility for Geforce FX5200 to /mnt/cruzer *Download XAMPP package to /mnt/cruzer ====Backup the system ==== ---- *Backup the entire $HOME folder to /mnt/freeagent, the external hard drive *Backup website folder /opt/lampp/htdocs to /mnt/freeagent, the external hard drive *Backup /etc/X11/xorg.conf to /mnt/cruzer *Backup entire /etc folder to /mnt/cruzer *Print current xorg.conf for reference ====Start Installation ==== ---- *Place Installation Disc I in cd drive and reboot the system *Follow Instructions on screen to launch the installer =====Partitioning ===== ---- *Launch cfdisk and delete existing partitions *Create two new partitions, Swap 2GB & Linux Remaining space (approx 240GB) *Write partition table to the disc and exit *Launch setup program and follow the instructions for a complete install *Make sure not to install php, apache and mysql. We're going to install that separately using XAMPP later on *Choose one of the generic "huge" or "huge-smp" kernels at the end of installation process. ====Fresh System ==== ---- *Hopefully, I will have a working fresh system after the installation is complete. *The default runlevel is 3 *Launch xorgconfig, and set up xorg.conf *Try launching X server to see if it works. If it works, we're good for next steps. *Exit the window manager (KDE by default). This will drop you off at the terminal. ====Compile Kernel ==== ---- *Backup /lib/modules/your-kernel to /lib/modules/your-kernel.backup. This step will make sure that your current kernel is available as backup if the kernel we're going to compile does not work. *Copy /boot/config to /usr/src/linux/.config *Become root *cd /usr/src/linux *make menuconfig *Remove Riva Framebuffer Support from the configuration menu, save and exit the configuration menu *make bzImage. This will create a new kernel "bzImage" in /usr/src/linux/arch/i386/boot/ *make modules && make modules_install. This will compile and install kernel modules in /lib/modules/your-kernel directory. *cp /usr/src/linux/arch/i386/boot/bzImage /boot #This copies our newly compiled kernel in /boot directory. *Edit /etc/lilo.conf as follows. Add this at the end of lilo.conf #Bootable partition configuration starts image = /boot/bzImage root = /dev/your-device-where-root-is-located label = Tux (use any label you want for the new kernel) #Bootable partition configuration ends *Run /sbin/lilo to add the new kernel info to the boot loader. ==== Test the new Kernel ==== ---- *If everything went fine, reboot the computer. *Select new kernel to boot from *If the kernel boots properly and you get a working system back, we're good for next steps. ==== Install the nVidia Graphics Driver ==== ---- *Get the driver from nvidia's website *Make it executable and launch using sh utility *This will compile the kernel module for driver and install it. *If the driver was installed successfully, change xorg.conf to reflect that. Just change driver name from ''nv'' to ''nvidia''. *Launch X server with startx and test the system out. *glxinfo | grep dri Third line of the output should tell you if you have direct rendering enabled now. *telinit 4. Change the runlevel to 4 and enjoy your new graphic powers. 2b5e032aa2bcec12295888039e1098a30d35baca VMware Guest Install 0 159 187 2009-06-06T23:27:17Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] '''HOWTO: Install Slackware 11.0 as a guest on VMWare Workstation for Windows 5.5 with:''' * a 2.6 kernel; * the ext3 filesystem; * the LSI Logic SCSI adapter; * and tips using XDMCP on the guest. == Prerequisites == * Some previous experience installing any version of Slackware (no experience with 2.6 kernels necessary). * Some previous experience using VMware Workstation for Windows. * Experience using console-based editors such as Vi, pico, or Emacs. * Some degree of comfort using a bash prompt. == Tips and recommendations == * Use the VMWare "snapshot" feature throughout the installation. That way, if you make a mistake, you won't have to start over from the beginning. I take a snapshot during each reboot. You can delete the snapshots after you're sure the installation is successful. * Make sure to install the Slackware 11.0 patches after successfully completing the installation. * This is not the only way to install Slackware 11.0 on a VMware guest. For example: ** You don't have to run a 2.6 kernel if you don't want, the 2.4 kernel will work just fine. If you decide to use the 2.4 kernel, just skip the [[#Upgrade_the_kernel_from_2.4_to_2.6|kernel upgrade step]]. ** You can use the BusLogic SCSI adapter instead of the LSI Logic adapter, you'll just need to load the appropriate drivers for this adapter instead of the ones listed in the [[#Upgrade_the_kernel_from_2.4_to_2.6|mkinitrd step]]. ** You can use something other than ext3 for the filesystem (for example, ext2 or ReiserFS). If you do this, you'll need to load different drivers during the [[#Upgrade_the_kernel_from_2.4_to_2.6|mkinitrd step]]. ** Technically, you don't need to install the VMWare guest tools as covered [[#Build.2C_install.2C_and_configure_the_VMware_guest_system_tools|here]], but they are highly recommended as they greatly increase performance and usability (particularly when using X, or when running the guest from a laptop host). == Use the VMware new guest wizard to create the new guest == Use the following settings: <ul> <li>Custom</li> <li>New – Workstation 5</li> <li>Linux, Other Linux 2.6.x Kernel</li> <li>Name your machine</li> <li>1 Proc</li> <li>set memory not less than 256 MB</li> <li>Use either bridged or NAT; I used NAT because bridged gave me problems with the wireless networking adapter on my laptop</li> <li>LSI Logic adapter (you can use BusLogic, but you'll have to use different drivers than the ones listed here in the initrd configuration)</li> <li>new virt disk</li> <li>SCSI</li> <li>Not less than 4GB</li> <li>Name disk file</li> </ul> == Install Slackware 11.0 on the guest == <ol> <li>Either insert the Slackware install CD in your CD-ROM drive, or add the Slackware install ISO as a new CD-ROM device in the guest configuration.</li> <li>Boot</li> <li>At the boot: prompt from Slackware install CD, type “raid.s”. This will start the installation with the 2.4 kernel & SCSI support for the VMware LSI SCSI adapter.</li> <ul><li>Note: I haven't figured out a way to install Slackware using the 2.6 kernel and/or installing the 2.6 kernel during the installation. The easiest way I can figure out how to do it is to install with the 2.4 kernel and then upgrade to 2.6 after installation is complete.</li></ul> <li>create your partitions using: <tt>cfdisk /dev/sda</tt>.</li> <ul><li>You will need to create at least a swap partition and a root partition. My partition table usually looks something like this:</li></ul> </ol> cfdisk 2.12r Disk Drive: /dev/sda Size: 8589934592 bytes, 8589 MB Heads: 255 Sectors per Track: 63 Cylinders: 1044 Name Flags Part Type FS Type [Label] Size (MB) --------------------------------------------------------------------- sda1 Primary Linux swap 296.12 sda2 Boot Primary Linux 8291.09 <ol start="5"> <li>Start networking (network) if doing a network install from NFS. This will load the pcnet32 network driver.</li> <li>Start setup; set up your swap & root partitions, use ext3 for the partition type. Take note of the root partition device name. Set up your install source and package selections, and start the install.</li> <li>Things I know for sure you DON'T need to install for a guest to run correctly:</li> <ul> <li>Package e (emacs)</li> <li>Package f (faqs/howtos)</li> <li>Package k (kernel source; this will be replaced anyway when we upgrade to 2.6)</li> <li>Package kde and kdei (KDE)</li> <li>Package t (TeX)</li> <li>Package xap (but if you're using X at all, you'll probably want some of the things in there like a good window manager & desktop environment)</li> </ul> <li>Things I know for sure you DO need to install for a guest to run correctly:</li> <ul> <li>Package x (X11) (the VMware-tools installation, while console-based, depends on X to complete the installation successfully. I imagine you can uninstall package X after the VMware-tools installation is complete).</li> </ul> <li>If you are installing from the ISO mapped to a virtual guest CDROM device, you'll need to switch to the second CD after the first CD is done (you'll receive a message to switch the CDs). To do this, right-click on the CD-ROM device icon in the lower-right corner of the VMWare status bar. Select edit, and change the ISO image location to the second ISO image.</li> <li>When configuring the options (after the package install) make sure to:</li> <ul> <li>install the “raid.s” kernel to the hard drive.</li> <li>Enable hotplug/udev system at boot.</li> <li>Simple LILO install: Install LILO automatically</li> <li>install LILO to the MBR</li> <li>I use the standard Linux console, however some of the framebuffer modes do work.</li> <li>ps2 port mouse</li> <li>on startup services, make sure rc.pcmcia is unchecked (if this runs it causes a huge amount of kernel error messages and subsequent performance problems)</li> <li>hardware clock is set to local time</li> </ul> <li>Reboot, not from the CD. If everything goes well you should get a regular console login prompt right after the message <tt>Welcome to Linux 2.4.33.3</tt>.</li> <li>If for some reason you didn't get the raid.s kernel installed and instead installed the default 2.4 kernel, you won't be able to boot because the SCSI driver will not load (you will instead get a message about not being able to mount the root device, followed by a kernel panic). Do this:</li> <ul> <li>Boot from the installation CD and enter this at the <tt>boot:</tt> prompt:</li> <li><tt>raid.s root=/dev/''[your_root_partition]'' noinitrd ro</tt> (where <tt>''[your_root_partition]''</tt> is the device name of the root partition (eg: /dev/sda1 or /dev/sda2 etc)).</li> <li>Boot and continue at the next [[#Upgrade_the_kernel_from_2.4_to_2.6|section]].</li> </ul> </ol> == Upgrade the kernel from 2.4 to 2.6 == # log in as root # Install the 2.6 kernel located in the patches or testing installation directory: #* mount the installation CD or NFS mountpoint containing the Slackware 11.0 testing and/or patches directories (as of this writing, Slackware contains a 2.6 kernel in both testing and patches; the one in testing is a little newer). #* Change to the patches/testing directory containing the linux 2.6 kernel installation .tgz files. Take note of the version number of the 2.6 kernel (ie: 2.6.18). #* <tt>upgradepkg –-install-new kernel-generic*.tgz</tt> #* <tt>upgradepkg –-install-new kernel-modules*.tgz</tt> #* <tt>upgradepkg –-install-new kernel-source*.tgz</tt> (only if you want the source) # <tt>cd /etc/rc.d</tt> # <tt>rm rc.modules; ln -s rc.modules-''[X]'' rc.modules</tt> #* where <tt>''[X]''</tt> is the version number of your installed 2.6 kernel. # Create the initrd filesystem with the ext3 and LSI Logic SCSI drivers: #* <tt>mkinitrd -c -k ''[X]'' -m jbd:ext3:scsi_transport_spi:mptbase:mptscsih:mptspi -f ext3 -r /dev/''[Y]'' </tt> #** where ''[X]'' is the version of your 2.6 kernel and ''[Y]'' is the name of your root partition device. #** the order of these modules (the ones separated by colons) is important. #** if you're not using ext3, you won't need to load the ext3 or jdb modules (but you'll need to load the modules for your filesystem unless you're using ext2). You need the rest of the modules loaded for SCSI driver support, which you need to mount the VMware LSI scsi hard drive. #* <tt>cat /boot/initrd-tree/load_kernel_modules</tt> and inspect to insure that all the modules listed in the mkinitrd command are correctly listed in this file. # Edit the file /etc/lilo.conf, add the following after the <tt>image =</tt> line: #* <tt>initrd = /boot/initrd.gz</tt> # <tt>lilo</tt> #* (you should receive the response <tt>Added Linux *</tt>) # Reboot. If everything goes well, after bootstrap, you should receive the message <tt>Welcome to Linux ''[X]''</tt>, where ''[X]'' is the version of your 2.6 kernel, and a login prompt. == Build, install, and configure the VMware guest system tools == # Log in as root. # From the VMware Workstation menu bar, choose VM->Install VMware tools # From the linux bash prompt: <tt>mount /dev/cdrom /mnt/cdrom</tt> # <tt>mkdir /tmp/toolsinstall; cd /tmp/toolsinstall</tt> # <tt>tar zxf /mnt/cdrom/VMwareTools*.tar.gz</tt> # Create the dummy System V init filesystem for the VMware-tools install program: #* <tt>mkdir init.d</tt> #* <tt>for i in {0,1,2,3,4,5,6}; do mkdir rc$i.d; done</tt> #* <tt>touch init.d/network init.d/networking</tt> # Bring down the networking so the install program can create the VMware high-performance network driver: #* <tt>ifconfig eth0 down</tt> #* <tt>rmmod pcnet32</tt> # <tt>cd vmware-tools-distrib</tt> # <tt>./vmware-install.pl</tt> #* For the options use the defaults; the only thing I change is the default bin directory from /usr/bin to /usr/local/bin #* after answering all the configuration questions, vmware-install.pl will build and install all the VMware guest tools and update the dummy System V init filesystem. # Move the changes in the dummy System V init filesystem into the Slackware BSD init scripts: #* <tt>cp /tmp/toolsinstall/init.d/vmware-tools /etc/rc.d/rc.vmware-tools</tt> #* <tt>sed -i "s/pcnet32/vmxnet/" /etc/rc.d/rc.netdevice</tt> #* <tt>echo "/etc/rc.d/rc.vmware-tools start" >>/etc/rc.d/rc.local</tt> # Reboot # Directly before the <tt>Welcome to Linux 2.6.x</tt> message, you should see messages from the VMware-tools init script: Starting VMware Tools services in the virtual machine: Switching to guest configuration: done Guest filesystem driver: done DMA setup: done Guest operating system daemon: done Welcome to Linux 2.6.18 (tty1) virtslack2 login: == (Optional) Setting up XDMCP == If you want to use XDMP on the guest system, the following caveats apply: # I recommend the xming X server over Cygwin/X. Cygwin/X doesn't seem to play well with VMware guests for some reason. I had problems with it gradually slowing down until the Cygwin X server would grind to a halt. # If you're using NAT instead of bridging, make sure you set your <tt>-from</tt> parameter with the IP address of the VMware network adapter on the host system (on my system, this is 192.168.223.1; you can do an <tt>ipconfig</tt> on the host system to determine this IP address). If you don't do this step, you'll find performance to be abysmal. 3ef57ae70e56d72452a267579781ef57b51e0e5e Slamd64 FAQ 0 160 188 2009-06-06T23:27:57Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Slamd64]][[Category:Information]] __TOC__ ==What is Slamd64?== Slamd64 is an '''unofficial''' port of Slackware to x86_64. ==Is Slamd64 just for AMD64 systems?== No, Slamd64 is compiled for generic x86_64; this means it should work on both AMD64 and EM64T. ==Do I need all 7 CDs?== Usually the disc 1 is all you need to download. If you want the packages included on the 2nd, 3rd or 4th discs such as KDE, you can download them after you have installed Slamd64. The 5th, 6th, and 7th discs contain sources and are not needed by most users. If you have only the first disc, you still don't need to worry when selecting the packages to be installed. If you happen to select packs that are not on the first disc and the installer prompts you for the disc 2, simply press skip. There are no packs on the second or third discs that would be critical for a working system. You can install them later. You can find out what's on them by looking at the scripts used to create them, which are in extra/scripts/ ==Is there SATA support?== Yes! I've no idea where the misconception that there isn't came from; my development system uses SATA drives. ==Can I use normal Slackware packages?== Mostly yes, as long as they don't use Qt/KDE. Libraries can be complicated. ==How do I use these ".jigdo" files?== Firstly, you need to install [http://atterer.net/jigdo/ jigdo]; a slamd64 package can be found on [http://files.fredemmott.co.uk/jigdo-0.7.2-x86_64-1.tgz files.fredemmott.co.uk]. You will then need to download the tarball of .jigdo, .template, and other files from the "[http://www.slamd64.com/getslamd64.html Get Slamd64]" page. Extract the tarball somewhere, and open a terminal, and 'cd' into the created directory. If you want to use a mirror other than ftp.heanet.ie, change the following lines in the .jigdo files: Mirror=ftp://ftp.heanet.ie/pub/slamd64/slamd64-current/ Mirror=ftp://ftp.heanet.ie/pub/slamd64/slamd64-10.2/tree/ If you keep a copy of the tree locally, you can use a "file:/" url, like the following (assuming you have your tree in /home/ftp/pub/slamd64/): Mirror=file://home/ftp/pub/slamd64/slamd64-current/ Mirror=file://home/ftp/pub/slamd64/slamd64-10.2/tree/ Then simply run "jigdo-lite filename.jigdo" for each disk you want - for example, if you want disks 1 and 2, non-us: jigdo-lite slamd64-10.2-disk1.jigdo jigdo-lite slamd64-10.2-nonus-disk2.jigdo ==Is there a DVD version?== Yes. ==Is there flash support?== Not out-of-the-box, but there's a work-around to get Konqueror to use 32-bit plugins instead of 64-bit; see the [http://forums.gentoo.org/viewtopic.php?t=216959 post on the gentoo forums]. You can also use a 32-bit web-browser, such as Opera, or a version of Firefox from mozilla.org. (The package included in Slamd64 is a 64-bit package) ==Is GNOME included?== Not out-of-the-box, but [http://gnomeslackbuild.org/ GSB: Gnome SlackBuild] has a [http://gnomeslackbuild.org/download/#quick port] available. There is also a port of [http://droplinegnome.org Dropline GNOME 2.14.1] desktop available, for download [http://dlg64.droplinegnome.org/dlg-2.14.1-x86_64.iso.torrent a bittorrent link is provided]. Also ==I use the NVidia drivers, I updated/reinstalled 32x11, and now I don't have 3D-acceleration in 32-bit applications. How do I fix this?== Reinstall the nvidia drivers. 32x11 contains generic 32-bit OpenGL libraries, which overwrite the NVidia drivers. ==I have an ATi card, how do I get the fglrx drivers to build?== fglrx requires 64bit GCC 3.3 C++ libraries to build (cxxlibs-6.0.3-x86_64-1) and the 32 bit c/ compatibility packages. Install those libraries, and then get fglrx64 (not fglrx) from ATi's website. You may also need the 32bit compatibility packages in Slamd64, and the driver may require further patching if you want to use it on the latest kernel. ==How can I help?== Firstly, look at [http://bugs.slamd64.com the bug list], and see if you can provide a fix; also, just using Slamd64 and reporting any bugs you find (after checking that they're not already reported) on that page is useful. Financial assistance is also always appreciated; please use the PayPal link on [http://www.slamd64.com the Slamd64 website]. 38742f7d8e95a8546b99c1f84dd2e8e1dc6ec9aa Slapt-get 0 161 189 2009-06-06T23:28:37Z Erik 1 Copy from old wikitext text/x-wiki '''slapt-get''' is an [[APT]]-like system for [http://en.wikipedia.org/wiki/Slackware Slackware] [[package management]]. It tries to emulate the features of [[Debian]]'s [[apt-get]] as closely as possible. ==Features== * uses native [http://en.wikipedia.org/wiki/Slackware Slackware] tools (installpkg, upgradepkg, and removepkg) * supports multiple package sources (including http://linuxpackages.net) * cache data concerning packages and updates from package sources * supports sources from ftp, ftps, http, https, file:/// and more (libcurl) * resumes broken downloads and will verify package integrity with [http://en.wikipedia.org/wiki/Md5 MD5] checksum * show packages that are available (from cached data) and installed * search package listing using [http://en.wikipedia.org/wiki/POSIX POSIX] and extended [http://en.wikipedia.org/wiki/Regular_expressions regular expressions] by package name, location, and description * retrieve, install, and remove packages by name or by specific version * retrieve and apply updates * upgrade from one Slackware release to another in a few simple steps - see [[Upgrade_Using_Slapt-get]] * show description of packages, including mirror location, version, size, dependencies (where available, see [http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ10 FAQ]), conflicts (where available, see [http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ31 FAQ]), suggestions (where available, see [http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ44 FAQ]), description, and installation status * exclude (hold) packages from upgrades, by name or by regular expression * transaction engine for install, remove, and upgrades, reporting concise information on what is to be done, ensuring each step happens correctly * "compare package version" algorithm to prevent downgrades * recursive dependency resolution using slack-required meta-data ([http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ10 see FAQ]) supporting hard, soft, and conditional dependencies * package conflict resolution using slack-conflicts meta-data ([http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ31 see FAQ]) * package suggestion support for complimentary packages ([http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ44 see FAQ]) * Package data download robustness, only writing changes if all sources download successfully as well as only downloading those sources that have changed since the last download * [http://en.wikipedia.org/wiki/I18n i18n] support via [http://en.wikipedia.org/wiki/GNU GNU] gettext with over 20 language translations * extremely fast and easy to script with ==Dependencies== slapt-get does not provide dependency resolution for packages included within the Slackware distribution. It does, however, provide a framework for dependency resolution in Slackware compatible packages similar in fashion to the hand-tuned method [http://en.wikipedia.org/wiki/Advanced_Packaging_Tool Advanced Packaging Tool|APT] utilizes. Several package sources and Slackware based distributions take advantage of this functionality. Adding dependency information requires no modification to the packages themselves. Rather, the package listing file, PACKAGES.TXT, is used to specify these relationships. This file is provided by [http://en.wikipedia.org/wiki/Patrick_Volkerding Patrick Volkerding] and is similar to the Packages.gz file in use by [http://en.wikipedia.org/wiki/Debian Debian]. Several scripts are available to generate the PACKAGES.TXT file from a group of packages (See [http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ17 FAQ #17]). The file format used by [http://en.wikipedia.org/wiki/Patrick_Volkerding Patrick Volkerding] is extended by adding a few extra lines per package. slapt-get then parses this file during source downloads. Typically, third party packages store the dependency information within the package itself for later extraction into the PACKAGES.TXT ([http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ19 See FAQ #19]). The inclusion of this information within the Slackware package format does not inhibit the ability for Slackware pkgtools to install these packages. This information is silently ignored and discarded after the package is installed. [http://www.stabellini.net/depslack.html Other methods] exist for adding dependency information for official Slackware packages without altering the packages themselves. ==Package Sources== slapt-get works with official Slackware mirrors and third party package repositories. slapt-get looks for support files, PACKAGES.TXT and CHECKSUMS.md5, in the repository for package information. These files provide package names, versions, sizes (both compressed and uncompressed), checksums, as well as a package description. These files can be extended, as discussed in the previous section, to add dependency listings, conflict information, and package suggestions. These files can also proxy for other remote sources by specifying a MIRROR declaration for each package. ==libslapt== slapt-get exports a [http://en.wikipedia.org/wiki/C_programming_language C] [http://en.wikipedia.org/wiki/Library_(computer_science) library] that is used by [http://en.wikipedia.org/wiki/gslapt gslapt] to provide similar functionality through a [http://en.wikipedia.org/wiki/GTK+ GTK+] frontend. ==Distributions== Besides Slackware, slapt-get may be used with or included by the following distributions: * [http://www.vectorlinux.com Vector Linux] * [http://www.mutagenix.org Mutagenix] * [http://slax.linux-live.org SLAX] * [http://www.slamd64.com/ Slamd64] * [http://gsb.sourceforge.net/ Freerock GNOME] * [http://www.gware.org/ GWARE GNOME] * [http://slampp.abangadek.com/ SLAMPP] * [http://getopenlab.com/ OpenLab GNU/Linux] * [http://ocsid.spaghettilinux.org/ Open Community Slackware Install DVD] * [http://floyd-linux.pappapc.com/ Floyd GNU/Linux] * [http://www.stibs.cc/stx/ STX GNU/Linux] * [http://www.nnlinux.com/ Nonux GNU/Linux] * [http://wolvix.org/ Wolvix LiveCD] * [http://www.collegelinux.org College Linux] * [http://www.zenwalk.org/ Zenwalk Linux] * [http://www.truvalinux.org.tr Truva Linux] ==Examples== $ slapt-get --update Retrieving package data http://www.slackware.at/data/slackware-10.0/ ...Done Retrieving patch list http://www.slackware.at/data/slackware-10.0/ ...Done Retrieving checksum list http://www.slackware.at/data/slackware-10.0/ ...Done Reading Package Lists...Done Retrieving package data http://software.jaos.org/slackpacks/10.0/ ...Cached Retrieving patch list http://software.jaos.org/slackpacks/10.0/ ...Cached Retrieving checksum list http://software.jaos.org/slackpacks/10.0/ ...Cached Reading Package Lists...Done $ slapt-get --upgrade Reading Package Lists... Done The following packages have been EXCLUDED: devs kernel-headers The following packages will be upgraded: binutils bash bin bind cdrtools bzip2 kbd cups cxxlibs e2fsprogs etc gawk gcc gdb inetd infozip less links logrotate lynx man man-pages openssh openssl openssl-solibs pidentd pkgtools procps sed shadow slocate sysklogd sysvinit tar tcpip util-linux vim wget zlib 39 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. Need to get 36710K of archives. After unpacking 17880K of additional disk space will be used. Do you want to continue? [y/N] $ slapt-get --show slapt-get Package Name: slapt-get Package Mirror: http://software.jaos.org/slackpacks/10.0/ Package Location: . Package Version: 0.9.9f-i386-1 Package Size: 147 K Package Installed Size: 530 K Package Required: curl >= 7.12.0-i486-1,glibc-solibs >= 2.3.2-i486-7,binutils,openssl >= 0.9.7d-i486-1,pkgtools,zlib Package Conflicts: Package Suggests: Package MD5 Sum: cb4b44cbb4efee4e993109231b107828 Package Description: slapt-get: slapt-get (APT like system for Slackware) slapt-get: slapt-get is an APT like system for Slackware package management. slapt-get: slapt-get: * See /usr/doc/slapt-get-0.9.9f/ for complete documentation. slapt-get: * You will also want to customize /etc/slapt-get/slapt-getrc, slapt-get: using a local mirror. www.slackware.com may be very busy. slapt-get: * Support: slapt-get: http://software.jaos.org/cgi-bin/mailman/listinfo/slapt-get-user slapt-get: * Please translate slapt-get: http://software.jaos.org/BUILD/slapt-get/po/slapt-get.pot slapt-get: then send to slapt-get-devel@software.jaos.org slapt-get: Package Installed: yes ==External links== *[http://software.jaos.org/#slapt-get Homepage] [[Category:Information]] 8d67ca2cb94dcee4f5c9af9af4745e84019c282a Soft Reboot 0 162 190 2009-06-06T23:29:00Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] Avoid the full POST by your BIOS for a slightly faster reboot time, in <code>lilo.conf</code>: append = "reboot=bios,warm" Brief explanation of options: bios Use the CPU reboot vector for warm reset warm Don't set the cold reboot flag Using warm reset will be much faster especially on big memory systems because the BIOS will not go through the memory check. Disadvantage is that not all hardware will be completely reinitialized on reboot so there may be boot problems on some systems. See <code>/usr/src/linux/Documentation/x86/x86_64/boot-options.txt</code> for more details. 6df4d7a62c5a599353bdf4af1d101d23e5b37235 Software Licenses 0 163 191 2009-06-06T23:29:33Z Erik 1 Copy from old wikitext text/x-wiki == A == {| !Software !License |- |AbiWord |GNU GPL |- |Apache |Apache license |- |aspell |GNU LGPL |} == B == {| !Software !License |- |bash |GNU GPL |- |BitchX |BSD license |} == C == {| !Software !License |- |CUPS |GNU GPL & GNU LGPL |} == D == == E == == F == == G == {| !Software !License |- |Gaim |GNU GPL |- |gcc |GNU GPL |- |gdb |GNU GPL |- |getmail |GNU GPL |- |GIMP |GNU GPL |- |gFTP |GNU GPL |- |glibc |GNU LGPL |- |GKrellM |GNU GPL |- |gnupg |GNU GPL |- |gnuchess |GNU GPL |} == H == == I == {| !Software !License |- |libIDL |GNU LGPL |} == J == {| !Software !License |- |joe |GNU GPL |} == K == {| !Software !License |- |KDE |GNU GPL, GNU LGPL |} == L == == M == {| !Software !License |- |mutt |GNU GPL |- |MySQL |GNU GPL |} == N == {| !Software !License |- |nmap |GNU GPL |} == O == == P == {| !Software !License |- |Perl |GPL or Artistic License |- |PHP |PHP License |} == Q == {| !Software !License |- |Qt |GPL, Proprietary, QPL |} == R == {| !Software !License |- |rxvt |GNU GPL |} == S == {| !Software !License |- |SDL |GNU LGPL |} == T == {| !Software !License |- |t1lib |GNU GPL |} == U == == V == == X == {| !Software !License |- |xine-lib |GNU GPL |- |xv |Shareware |} == Z == [[Category:Information]] ce32a5c1c75ddd5afaf11ad0e206eb20c90d813e Sony VAIO PCG-C1XD 0 164 192 2009-06-06T23:30:00Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Hardware]] ==Slackware on a Sony VAIO PCG-C1XD== The PCG-C1XD is a very small Pentium II based laptop (I mean, really small). I have had access to one and the opportunity to install Linux on one (it's small enough that with a wireless card I believe I can make a very nice portable wireless access point). I believe it varies only from other PCG-C1X's in the keyboard layout (the D is a German QWERTZ keyboard - as a non-German QWERTY user I find this very difficult to use!). You can therefore modify these instructions accordingly for your keyboard layout. (Please note that this is a work in progress and will be updated as I work through setting up the laptop and have more details to hand.) So far: The laptop boots, I've built a working 2.6 kernel for it, standby appears to work, and I've configured X (and managed to get KDE 3.4 running at a very reasonable speed). ==Hardware== Output of lspci:<pre> Coming Soon </pre> ===Overview=== * Intel Mobile Pentium II 400MHz processor * 128mb RAM * 1024x480 LCD * NeoMagic Graphics Chip (1.5MB dedicated memory) * 8GB Hard Drive * External PCMCIA CD-ROM Drive * External USB Floppy Drive (untested) * Yamaha sound chip * 1 x IR port * 1 x IEEE-1394 (Firewire) port * 1 x USB port * 1 x Sony proprietary port * 1 x PCMCIA slot * 1 x Camera (Built into top of laptop) ===Working=== * Video Card: NeoMagic * Soundcard * Nib Mouse (Doesn't need a driver - does make strange sounds though) * CD-ROM (requires boot parameter) * Battery Status (See 'Battery' section below). ===Not Tested, but probably works=== * Battery Status (I believe the battery with this laptop is dead) * Infra Red * VGA out * Function/Hot Keys (have not tried all though; extra configuration is probably required) ===Does Not Work=== * Camera (There is a driver in the kernel for this, but I haven't tried it out) ==Kernel Configuration== You don't need a particularly modern kernel to use this laptop, the default 2.4 series will work fine. For the challenge though, I have successfully built a 2.6 kernel. As with all Sony VAIO laptops, you will need to select any options that refer to Sony (e.g. the sonypi module). Also, this is an APM based laptop, so no ACPI here. ==Hardware Package and Software Dependencies== ===CD-Drive=== To use the CD drive that comes with this laptop, you will need to add the following line when installing Slackware, and add it to the append line in LILO. hd1=0x180,0x386 ===xorg.conf=== Coming Soon - This laptop requires a custom mode line and a few other tweaks due to the very strange resolution of this screen. ===Special Keys=== There is a jogdial on this laptop, but it is untested as of the present. ===Special Keys with X and kde=== To be done. ===Battery info via APM=== To get the battery to display information, you will need to load APM. If you have APM as modules, you will need to load apm and start the APM daemon by hand, or create a startup script to do this for you. ==Troubleshooting== ===Scrolling is too slow in a window manager=== Drop the colours down to 16 bit in /etc/X11/xorg.conf ==External Links/ References== Coming Soon 7af8d2df16f7efb9edd304e91224ff26b5da92dd Ssh-tunneling 0 165 193 2009-06-06T23:30:34Z Erik 1 Copy from old wikitext text/x-wiki Sometimes you want to run vnc on a remote machine and do not have the port forwarded, but you have ssh forwarded. This is a time where ssh tunneling would work great. It's fast, efficient and its encrypted. This first example is when you connecting to the server or client that is running a vnc server: ssh -L 5901:localhost:5901 user@server Now the first -L means that we are going to tunnel from the localhost to the actual remote host. The first field is ''5901'', the localport to use, so that when we type '''localhost:5901''' we actually go through the tunnel (on the vnc client). The next field is ''localhost'' which is resolved on the remote host side. So, localhost in this example would be the remote host (who said it's confusing ?). The last field ''5901'' is the port number on the remote host that we want to connect to. The user@server is the username and host we want to forward to. Now if we wanted to forward port 631 on the remote host, but it is only binded on the hostname ''server'' the following example would be used: ssh -L 9000:server:631 user@server Port 631 is usually used for CUPS so we can tunnel this as well. So in order to get that page we would type http://localhost:9000. This would go through the tunnel and get the cups server remotely. Keep in mind if you type a password it will be encrypted. ssh -R 9000:localhost:3128 user@server2 Now in this example we are going to forward a remote port to the local box. For instance the above example we are going to open up port 9000 on server2 and it is going to tunnel to port 3128. This is the same syntax as the -L option just the other way around for tunneling. The best explanation between -L and -R is that -R is remotely opening up the port 9000 while -L is locally opening that port up. Now say you are already in an ssh session and want to add ports later on? Well this is possible through what we call the SSH escape key. Make sure you are on a new line and type ~C in and you should see: ssh> Now you can run the commands -L and -R. These are the same syntax above just do not put the ssh in front of it.So for instance you could type: -L 8000:localhost:631 server And if it happened successfully it would say: Forwarding port Now hit enter after it says Forwarding port because sometimes it just hangs there, but it forwards it fine. There are also more things you can do with the ~ key. All you have to do is type ~?. (Note do not type the . after the ?) Adding tunneling to ssh is great, but you can also make a socks proxy out of ssh as well: ssh -D 7800 user@server Then you can use your localhost:7800 as your socks proxy. Now say you want other computers to be able to connect to your forward ports or the socks proxy? Thats possible with the -g argument: ssh -gD 8700 user@server ssh -gL 8000:localhost:3128 user@server Both of these examples would allow a remote user to connect to them. [[Category:Tutorials]] 7399751f61b344923bf7dd6bdc8a4a8190f0f1b2 Subversion 0 166 194 2009-06-06T23:31:06Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] == Slackware - SVN Howto == --[[User:Dadexter|dadexter]] 02:49, 14 Dec 2005 (GMT) This how to will explain how to setup Subversion, a replacement for CVS. These instructions were written for use with an apache2 web server. Don't know if it will actually work with apache1. Thanks to my good old buddy cactus (e.cactuswax.net) for the original version of this, which I adapted to Slackware :) 1) Install Subversion Download subversion and compile it using these steps: # wget http://subversion.tigris.org/downloads/subversion-1.2.3.tar.bz2 # tar -jxvf subversion-1.2.3.tar.bz2 # cd subversion-1.2.3 # ./configure --prefix=/usr --with-apr=/usr/bin/apr-config --with-apr-util=/usr/bin/apu-config --with-zlib # make # checkinstall If you're on Slackware 10.2 and above, subversion should already be installed. If not, grab it from your nearest friendly slackware mirror :) 2) As root, create the svn root: # mkdir -p /home/svn/repositories 3) Configure apache-svn support Add these 2 lines to your httpd.conf (mine is in /etc/apache2): LoadModule dav_svn_module lib/apache/mod_dav_svn.so LoadModule authz_svn_module lib/apache/mod_authz_svn.so I use SSL for apache, so I need to add <Location /svn> DAV svn SVNParentPath /home/svn/repositories AuthzSVNAccessFile /home/svn/.svn-policy-file AuthName "Test SVN Repo" AuthType Basic AuthUserFile /home/svn/.svn-auth-file Satisfy Any Require valid-user </Location> to my /etc/apache2/ssl.conf, inside the VirtualHost directive. Don't forget to restart your httpd at this point 4) Setup the svn root directory: Create /home/svn/.svn-policy-file [/] * = r [test:/] dadexter = rw The * in the / section is matched to anonymous users. Any access above and beyond read only will be prompted for a user/pass by apache AuthType Basic. The /svn/test section inherits permissions from those above, so anon users have read only permission to it. I granted myself read/write permissions to the repo. Create the svn-auth-file This is either an htpasswd, or htdigest file. I used htpasswd. Again, because of SSL, I don't worry as much about password sniffing. htdigest would provide even more security vs sniffing, but at this point, I don't have a need for it. htpasswd -cs /home/svn/.svn-auth-file dadexter The above creates the file (-c) and uses sha1 for storing the password (-s). The user cactus is created. To add additional users, leave off the (-c) flag. htpasswd -s /home/svn/.svn-auth-file userX Create a repository svnadmin create --fs-type fsfs /home/svn/repositories/test I prefer the newer file-system based repository. No database corruption/blocking issues. (--fs-type fsfs) Set permissions The apache user needs permissions over the new repository. chown -R nobody.nobody /home/svn/repositories/test 4) Client setup Install the package created above (or the package from the Slackware mirror) on your development machine. Next, create a directory to hold your development stuff, and create the svn directory structure: mkdir -p ~/coding cd ~/coding mkdir branches tags trunk Put your source files into the created trunk directory. Here, I copy my development directory for an online reservation system I'm working on. cp -R /home/martin/cal2/* trunk Finally, import your development project into the svn repository: svn import -m "Initial import" https://192.168.100.1/svn/test/ 5) Testing the checkout cd ~ rm -rf coding svn co https://192.168.100.1/svn/test/ I end up with the same ~/coding I had before :) c59ec895016c435bbba1e508e678ed9e8687da23 Sudo 0 167 195 2009-06-06T23:31:33Z Erik 1 Copy from old wikitext text/x-wiki Sudo is a program that lets a certain user run a program as root or another user. For instance say you want to let a user run <br> /usr/sbin/alsactl with root privilege , but not give them your root password? In sudo you can do this! First su into root and type: visudo You will now see a few example lines, Now first lets make the user "sandman1" be able to run alsactl as root: sandman1 ALL = /usr/sbin/alsactl Now of course you change the values of the following above. The first value "sandman1" is of course the username. the ALL <br> is the hostname, now you can actually put the real host name there , or you can allow a user to be on any host by adding <br> ALL. Now log into the user and type the following: sudo /usr/sbin/alsactl This command will ask you for a password, type YOURS in and not root and boom, you now can run /usr/sbin/alsactl as <br> root. With sudo you can also run programs as a different username besides root: sandman1 192.168.0.2 = (test) /usr/sbin/alsactl Now you noticed that I used an actual IP address in this example. (That is my local IP anyways) Now you noticed the <br> (test) that is the username that it will run as if i type the following command: sudo -u test /usr/sbin/alsactl Now the following example makes it so you do not have to type any password in: %wheel ALL = NOPASSWD: /usr/sbin/alsactl The % symbolizes that wheel is not a user, but a group. Now if you are in the group wheel and type "sudo /usr/sbin/alsactl", <br> you will notice that it did not ask you for the password! Now all of this is great, but what happens when you have more <br> than 1 user that is not in the same group, but want to run the same command as root? User_Alias GROUPOFUSERS = sandman1, sandy GROUPOFUSERS ALL = NOPASSWD: /usr/sbin/alsactl Now the 2 users sandman1, and sandy can run /usr/sbin/alsactl as root! Now see how easy it is to add multiple users? <br> You can also add multiple Hosts as well: Host_Alias SWEETHOST = 192.168.0.2, 192.168.0.3 sandman1 SWEETHOST = NOPASSWD: /usr/sbin/alsactl Now you see how easy it is to setup multiple hosts? Now to find out what commands you can run using sudo just type the <br> following command: sudo -l That will list all the commands you are aloud to run! Now sudo is an easy tool and I hope you have a great time using it. [[Category:Tutorials]] b7772e02c504ef2ca451312605e2aa54db499ea8 SysRq 0 168 196 2009-06-06T23:31:58Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] --[[User:Drijen|Drijen]] 15:06, 22 September 2007 (EDT) ==Recovering from a System Lock== Sometimes a process can go out to lunch, or the system will simply stop responding to user input. This could be from a process waiting for resources or a zombie, but in any case there is no reason to have to reach for that reset button! ==The Magic SysRq== The SysRq can be used as a means to save your work, sync the file system(s) and reboot the computer in a clean manner. If you don't know where the SysRq key is, look for the "Prt Scr" (Print Screen) button on your keyboard. SysRq is generally assigned to the same keypress. ===Enabling the SysRq Function=== To enable the SysRq functionality, you must have a 2.6.15 or higher kernel, and it must be compiled directly in. Not as a Module! To check that you have it enabled you may run this command: :<pre>cat /boot/config |grep CONFIG_MAGIC_SYSRQ</pre> OR :<pre>zcat /proc/config.gz |grep SYSRQ</pre> if you have /proc/.config support compiled in. (All base slack kernels do) which should return: :<pre>CONFIG_MAGIC_SYSRQ=y</pre> If you find that you need to compile it in, the option can be found under the heading ''Kernel Hacking'' on your make <(x)(menu)config> screen. Once you are satisfied that you have the SysRq funtion correctly compiled, ensure that it has not been disabled at boot: :<pre>cat /proc/sys/kernel/sysrq</pre> If the response is <tt>0</tt> : :<pre>echo 1 > /proc/sys/kernel/sysrq</pre> ===Recovering from a Lock Up using SysRq=== If your system has gone out to lunch, you can now use the Magic SysRq key to save your work and reboot. The basic commands are as follows: <tt>Alt+SysRq+R</tt> :Attempts to remove keyboard from Raw mode <tt>Alt+SysRq+K</tt> :Kills all processes (SIGKILL / kill -9) <tt>Alt+SysRq+E</tt> :Terminates all processes (SIGTERM / kill -15) <tt>Alt+SysRq+I</tt> :Interrupts all processes (SIGINT / kill -2) <tt>Alt+SysRq+U</tt> :Force unmount and remount of all filesystems readonly <tt>Alt+SysRq+S</tt> :Syncs all disks <tt>Alt+SysRq+B</tt> :Reboots (INIT 6) An alternative method is to: :<pre>Alt+SysRq+R CTRL+ALT+DEL</pre> This command will move the keyboard out of raw mode, and attempt to issue a <tt>SHUTDOWN NOW</tt> command. However, this will not work under some configurations, or if tty1 is defunct. ==Futher Information== Further instructions and other options can be found in: <pre>/usr/src/<linux-version>/Documentation/sysrq.txt</pre> e77ef928f1ee794eede374fa0587ccaeeae0c9ee Tagfile Install 0 169 197 2009-06-06T23:32:41Z Erik 1 Copy from old wikitext text/x-wiki ==What is a tagfile?== Tagfiles are text files found in each category directory that Slackware's installer uses to install, not install or ask for each package. ==Where are the tagfiles found?== There is a single tagfile located in each of the sub-directories under <code>/slackware/</code> on the Slackware install CD. Each tagfile lists the packages that are in that sub-directory and tells the Slackware installer to install, not install or ask about each package. EXAMPLE-<br> slackware/ |-- a | +- blahblah.tgz | +- tagfile | +- u-blahblah.tgz | \- etctera | |-- ap | +- blahblah.tgz | +- tagfile | +- u-blahblah.tgz | \- etctera | |-- etcetera ==What are the tagfile options?== <code>REC</code> = Required, these packages are automatically installed.<br> <code>ADD</code> = Add, these packages are automatically installed.<br> <code>OPT</code> = Optional, the installer will stop and ask to install these packages.<br> <code>SKP</code> = Skip, these packages will NOT be installed.<br> ==How do I use them?== You use them to automate an install. You can either customize the Slackware Install discs with your own tagfiles or you can use custom tagfiles in another director (e.g. a [[floppy]], [[USB_Memory_Stick|memstick]] or whatever). You need to edit each tagfile and make each package either a <code>ADD</code> (or <code>REC</code>) or a <code>SKP</code>. REMOVE ALL <code>OPT</code>s. '''Customized Slackware install CD-'''<br> 1) Obtain/make an ISO image(s) of the Slackware Install CD(s).<br> 2) Using an ISO Editor program, edit each tagfile as you wish.<br> 3) Burn new Install CDs from your modified ISO images.<br> 4) During Slackware installation, choose "CUSTOM" as your install method.<br> 5) Go get a beer because the install does the rest.<br> '''Non-customized Install CD method-'''<br> 1) Create the /slackware package directory structure from the install CD(s) on to some media. Copy each tagfile over but DO NOT COPY THE PACKAGES.<br> 2) Edit the tagfiles as you wish.<br> 3) Before/during the Slackware installation, mount the media so the files are accessible.<br> 4) During Slackware installation, choose "TAG PATH" as your install method and enter to path to your custom tagfiles (where you mounted tor media).<br> 5) Go get a beer because the install does the rest.<br> [[Category:Tutorials]] 08c6f72547aafbf2fff896547fa78ae40af07cd1 Third Party Package Managers 0 170 198 2009-06-06T23:33:41Z Erik 1 Copy from old wikitext text/x-wiki = Purpose = The mere mention of third party package managers (such as [http://software.jaos.org/#slapt-get slapt-get] and [http://swaret.sourceforge.net/ swaret]) often results in a quick admonishment from Slackware users, and unfortunately, the only reason given in most cases is something along the lines of "they'll break your system." This leaves users in a state of confusion, as the respective web sites of these third party tools tout them as an improvement. The purpose of this page is to explain why and how these tools will often result in system breakage. = Overview of Slackware's Native Package Tools = Slackware's native package management utilities (<tt>pkgtool(8)</tt>, <tt>installpkg(8)</tt>, <tt>removepkg(8)</tt>, and <tt>upgradepkg(8)</tt>) do not support any form of dependency checking. A Slackware package is essentially a compressed tarball of the files associated with an application, a file containing a short description of the application (<tt>./install/slack-desc</tt>), and a script that performs some essential post-installation tasks (<tt>./install/doinst.sh</tt>). Installing a Slackware package simply copies those files to the filesystem and then executes the post-install script, while removing the package removes the files and reverses the post-install script. As result, there is no guarantee that libraries and other files needed by a particular package are already present on the system when that particular package is installed. = Overview of Selected Third Party Tools = As stated above, Slackware's native package management suite neither has nor supports dependency resolution. Because the third-party add-ons all use Slackware's native package tools, they are bound by this same limitation, at least to some extent, but some of them try to mitigate this in various ways; the following is an overview. == swaret == === Overview === Swaret makes use of an unofficial file that tries to list all package dependencies based on output of <tt>ldd(1)</tt>. The idea is that by running <tt>ldd(1)</tt> on some binary or shared object, you can see what that file is linked to, and then see what package(s) contain those files, and then install those packages. === Potential Problems === Since some library developers don't see the need to update their shared object version strings when making changes that are incompatible with the previous release, it's easy to need a newer release of some package but for swaret to not be able to determine this. Since swaret is meant for upgrading packages, it will fail to roll back a package's version number if this occurs in the upstream Slackware tree for some reason. == slapt-get == === Overview === Slapt-get makes use of additional files (<tt>slack-required</tt>, <tt>slack-suggests</tt>, <tt>slack-conflicts</tt>) inside a Slackware package. Essentially, if a package is listed in <tt>slack-required</tt>, then slapt-get will install or upgrade it first; if a package is listed in <tt>slack-conflicts</tt>, then slapt-get will remove it first; if a package is listed in <tt>slack-suggests</tt>, then slapt-get will offer to install it in addition to the packages noted in <tt>slack-required</tt>. === Potential Problems === Since official Slackware packages do not have the <tt>slack-required</tt> and other files needed for slapt-get to determine dependencies, it is not able to resolve dependencies for them. Therefore, slapt-get's perceived usefulness is in keeping unofficial third-party packages (or at least those which do contain the necessary files) up to date. See the discussion below for more information on unofficial third-party packages. Also, slapt-get, like swaret, will not "downgrade" a package to a previous version if it occurs in the upstream Slackware tree. == sbopkg == === Overview === [http://www.sbopkg.org/ SBopkg] is a tool for automating the download, compile and package build for SBo projects hosted in the [http://www.slackbuilds.org SlackBuilds.org ] repository. SBo packages are reviewed by team members for completeness as well as applicability to each Slackware release. SBo package documentation includes information regarding dependencies. = Third Party (Unofficial) Packages = This subject can elicit opinions just as strong as the topic of third-party package managers, and there are knowledgeable people on both sides of the issue. Third party packages can obviously present a security risk, as there's no way to know what's really in them, but for the average user, there are (amazingly enough) bigger concerns. On one hand, the user wants a package of some application that's not included with Slackware, but he doesn't want it to create other problems. Oftentimes, third party packages are not built on "clean" systems -- that is, the computer on which they're built has quite a few other non-official packages installed -- so the resulting package needs those other things to work properly. If the packager doesn't make note of all the different packages that this one depends on, the user installs it only to find that it still doesn't work. Even worse, those other dependencies are often not even necessary if the package is built on a clean system - if the other package had not been present, the new one obviously wouldn't have linked against it. Installing third party packages from two different packagers can cause problems. Package A might depend on Package B, which depends on Package C and optionally Package D. If the person who built Package B only linked it against Package C (not D), but the Package A expects Package B to have both Package C and Package D dependencies, then Package A may not work, even though you (think you) have everything it needs installed. Another frequent problem with third party packages is encountered by replacing stock (official) packages with unofficial ones. In addition to the library version issues mentioned in the swaret discussion, newer package versions often require newer versions of other packages, which might require newer versions of still other packages, and before you know it, you have replaced a sizable portion of the official Slackware packages. If/when something breaks, you will find it very difficult to find someone willing to help you, as there's no way to know how much effect the unofficial packages are having. = Slackware -current = Slackware -current is *not* a stable release of Slackware. It is intended for advanced users who are familiar with how Slackware works to test (and report success/failure, find and fix bugs, etcetera) the new packages leading to the next stable release of Slackware. Packages are constantly being added, removed, split up, merged, and otherwise mangled, and third party package managers (swaret/slapt-get/et al) should not be expected to know how to deal with this. If you use one of those tools while trying to run Slackware -current and you don't understand how they work and their limitations, you *will* break your system and you will *not* have much luck finding someone who is sympathetic. You have been warned. You may be wondering why these tools have trouble with -current. I won't even attempt to detail all of the potential issues, but here are a couple: 1. When upgrading to -current with one of these tools, the package sets are upgraded in alphabetical order (and the packages therein also in alphabetical order). This means that a/bash will be upgraded before a/glibc-solibs. If bash has been recompiled against newer glibc, and you upgrade to that new version, it will promptly stop working due to the fact that the needed version of glibc has not been upgraded yet; at that point, you are stuck with a "chicken and egg" problem. 2. Third party package tools will not install *new* packages that have been added in Slackware -current. This is not a bug - it's a feature; if you purposefully didn't install something, then you don't want your automatic package updater reinstalling it. However, when a package depends on something else that has been added or split out of an existing package, and your add-on package manager upgrades the existing package but doesn't install the added one, then the (upgraded) existing package will not work any more. = Solutions and Suggestions = For upgrading to Slackware -current, there is only *one* supported method: <tt>UPGRADE.TXT</tt> -- you can find this file on any Slackware mirror. Note that this is also the only supported method to upgrade from one stable release of Slackware to another. For keeping up to date on post-release patches added to a stable release of Slackware, you will *usually* be okay to use one of the third party package managers. You should still read the <tt>ChangeLog.txt</tt> before doing any upgrades, though, as new packages are occasionally added in /patches when circumstances require it. For software not included in official Slackware, consider building it yourself or using a SlackBuild script from one of the projects which provides them. One of the regular Slackware contributors, PiterPUNK, wrote and maintains a third-party package manager that minimizes all of the risks mentioned above. [http://slackpkg.org Slackpkg] does not support downloading or installing unofficial packages, and it has provisions to install any added packages and uninstall any removed packages as well as the normal install/upgrade/remove routines. Another third party package manager that promotes good practices is [http://slackroll.sourceforge.net/ SlackRoll] (see [[SlackRoll Tutorial|tutorial]]). Its philosophy is similar to that of Slackpkg but it is not included as part of Slackware. Programmed in Python, it is faster, has more features and detects more events from Slackware -current. However, the initial setup and workflow are a bit more complex. = See Also = * <tt>pkgtool(8)</tt> -- man 8 pkgtool * <tt>installpkg(8)</tt> -- man 8 installpkg * <tt>removepkg(8)</tt> -- man 8 removepkg * <tt>upgradepkg(8)</tt> -- man 8 upgradepkg * <tt>makepkg(8)</tt> -- man 8 makepkg * <tt>explodepkg(8)</tt> -- man 8 explodepkg = TODO = * Add links to other wiki pages that are related to this topic (add to "See Also" above) * Add hyperlinks to slapt-get, swaret, and other projects mentioned on this page * Others? [[Category:Information]] [[Category:Tutorials]] 87b633ead33c6105087ad9f9bdb3b153f769897e USB Memory Stick 0 171 199 2009-06-06T23:34:15Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] ==IMPORTANT== This information primarily applies to Slackware 11.0 and older; if you're using Slackware 12.0 or newer, you probably want to use [[HAL]] instead. ==Prerequisites== You must have USB support [[Compiling A Kernel|compiled into the kernel]] or [[Modules|loaded as modules]]. ==Mounting A USB Memory Stick== 1)Pick/make a mountpoint. (e.g. <code>/mnt/memstick</code>) 2)Mount the device- :If you have an [[fstab]] entry for it: <code>mount <i>mountpoint</i></code><br> ::EXAMPLE: <code>mount /mnt/memstick</code> :Otherwise: <code>mount <i>device mountpoint</i></code><br> ::EXAMPLE: <code>mount /dev/sda1 /mnt/memstick</code><br> :: <b>NOTE:</b> if you have multiple USB devices or Sata/SCSI disks, the device may not be <code>/dev/sda1</code>, it could be <code>/dev/sdb1</code>, <code>/dev/sdc1</code> or any <code>/dev/sd*</code>. * you can see which devfile (in /dev/*) some devices get assigned by tracking the /var/log/messages (dmesg) changes. $ su # tail -f /var/log/messages and plug the USB device in the computer. This can be used for any other plug'n'play device. ==Unmounting a USB Memory Stick== <code>umount <i>mountpoint</i></code> :EXAMPLE: <code>umount /mnt/memstick</code> ==Errors and Solutions== Error: <code>mount: special device /dev/sda<i>x</i> does not exist</code> Solution: Check to see if <code>/dev/sda<i>x</i></code> exists- ::::<code>ls /dev/sda*</code> ::if <code>/dev/sda<i>x</i></code> does not exist, create it: ::::<code>mknod -m 666 /dev/sda<i>x</i> b 8 0</code> 7263c8de9cf0df9d13e2b94f4ba2c55150029a6f Udev 0 172 200 2009-06-06T23:34:43Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] This page was originally written by Don Tanner aka [[User:dtanner|dtanner]], but due to the fact that udev has historically been a moving target, most of it is now out of date. This is an attempt to bring it up to date, but for the most part, you should refer to the official udev documentation. The information in this page is, to the best of my knowledge, current as of Slackware 11.0 -- the general ideas still apply on later versions, but sysfs keys have different names and such. See the relevant man pages and udev documentation for information on how to adapt this for later udev (and Slackware) versions. Users often want to have a device (such as a removable usb flash memory stick) always get assigned the same device node - this makes it easy to specify the node in /etc/fstab for mounting it. You don't actually want to assign the same device node (in other words, rather than renaming the *real* device node, you want to create a persistent symlink to it - changing the name of the node itself can cause problems later, especially with respect to logging - the kernel logs will show device nodes that no longer exist). To do this, first plug in the removable memory stick and run <tt>dmesg | tail</tt> to see what device node is assigned. rworkman@tritium:~$ dmesg | tail sda: Mode Sense: 03 00 00 00 sda: assuming drive cache: write through SCSI device sda: 2001888 512-byte hdwr sectors (1025 MB) sda: Write Protect is off sda: Mode Sense: 03 00 00 00 sda: assuming drive cache: write through sda: sda1 sd 0:0:0:0: Attached scsi removable disk sda usb-storage: device scan complete sd 0:0:0:0: Attached scsi generic sg0 type 0 As you can see, the device is attached to /dev/sda (and since it has one partition, what I'm actually interested in is /dev/sda1). Now use <tt>udevinfo(8)</tt> to find out the sysfs path to the device. rworkman@tritium:~$ udevinfo -q path -n /dev/sda1 /block/sda/sda1 Now use <tt>udevinfo(8)</tt> again to show all of the keys exported to sysfs: rworkman@tritium:~$ udevinfo -q all -a -p /block/sda/sda1 Udevinfo starts with the device specified by the devpath and then walks up the chain of parent devices. It prints for every device found, all possible attributes in the udev rules key format. A rule to match, can be composed by the attributes of the device and the attributes from one single parent device. looking at device '/block/sda/sda1': KERNEL=="sda1" SUBSYSTEM=="block" DRIVER=="" SYSFS{stat}==" 131 131 0 0" SYSFS{size}=="1999627" SYSFS{start}=="245" SYSFS{dev}=="8:1" looking at parent device '/block/sda': ID=="sda" BUS=="block" DRIVER=="" SYSFS{stat}==" 11 121 139 28 0 0 0 0 0 28 28" SYSFS{size}=="2001888" SYSFS{removable}=="1" SYSFS{range}=="16" SYSFS{dev}=="8:0" looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb4/4-6/4-6:1.0/host0/target0:0:0/0:0:0:0': ID=="0:0:0:0" BUS=="scsi" DRIVER=="sd" SYSFS{ioerr_cnt}=="0x1" SYSFS{iodone_cnt}=="0x15" SYSFS{iorequest_cnt}=="0x15" SYSFS{iocounterbits}=="32" SYSFS{timeout}=="30" SYSFS{state}=="running" SYSFS{rev}=="0.2 " SYSFS{model}=="Cruzer Micro " SYSFS{vendor}=="SanDisk " SYSFS{scsi_level}=="3" SYSFS{type}=="0" SYSFS{queue_type}=="none" SYSFS{queue_depth}=="1" SYSFS{device_blocked}=="0" SYSFS{max_sectors}=="240" looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb4/4-6/4-6:1.0/host0/target0:0:0': ID=="target0:0:0" BUS=="" DRIVER=="" looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb4/4-6/4-6:1.0/host0': ID=="host0" BUS=="" DRIVER=="" looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb4/4-6/4-6:1.0': ID=="4-6:1.0" BUS=="usb" DRIVER=="usb-storage" SYSFS{modalias}=="usb:v0781p5151d0020dc00dsc00dp00ic08isc06ip50" SYSFS{bInterfaceProtocol}=="50" SYSFS{bInterfaceSubClass}=="06" SYSFS{bInterfaceClass}=="08" SYSFS{bNumEndpoints}=="02" SYSFS{bAlternateSetting}==" 0" SYSFS{bInterfaceNumber}=="00" looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb4/4-6': ID=="4-6" BUS=="usb" DRIVER=="usb" SYSFS{configuration}=="" SYSFS{serial}=="SNDK5D1BF51877607705" SYSFS{product}=="Cruzer Micro" SYSFS{manufacturer}=="SanDisk Corporation" SYSFS{maxchild}=="0" SYSFS{version}==" 2.00" SYSFS{devnum}=="2" SYSFS{speed}=="480" SYSFS{bMaxPacketSize0}=="64" SYSFS{bNumConfigurations}=="1" SYSFS{bDeviceProtocol}=="00" SYSFS{bDeviceSubClass}=="00" SYSFS{bDeviceClass}=="00" SYSFS{bcdDevice}=="0020" SYSFS{idProduct}=="5151" SYSFS{idVendor}=="0781" SYSFS{bMaxPower}=="200mA" SYSFS{bmAttributes}=="80" SYSFS{bConfigurationValue}=="1" SYSFS{bNumInterfaces}==" 1" looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb4': ID=="usb4" BUS=="usb" DRIVER=="usb" SYSFS{configuration}=="" SYSFS{serial}=="0000:00:1d.7" SYSFS{product}=="EHCI Host Controller" SYSFS{manufacturer}=="Linux 2.6.17.13 ehci_hcd" SYSFS{maxchild}=="6" SYSFS{version}==" 2.00" SYSFS{devnum}=="1" SYSFS{speed}=="480" SYSFS{bMaxPacketSize0}=="64" SYSFS{bNumConfigurations}=="1" SYSFS{bDeviceProtocol}=="01" SYSFS{bDeviceSubClass}=="00" SYSFS{bDeviceClass}=="09" SYSFS{bcdDevice}=="0206" SYSFS{idProduct}=="0000" SYSFS{idVendor}=="0000" SYSFS{bMaxPower}==" 0mA" SYSFS{bmAttributes}=="e0" SYSFS{bConfigurationValue}=="1" SYSFS{bNumInterfaces}==" 1" looking at parent device '/devices/pci0000:00/0000:00:1d.7': ID=="0000:00:1d.7" BUS=="pci" DRIVER=="ehci_hcd" SYSFS{modalias}=="pci:v00008086d000024CDsv00001028sd00000126bc0Csc03i20" SYSFS{local_cpus}=="1" SYSFS{irq}=="7" SYSFS{class}=="0x0c0320" SYSFS{subsystem_device}=="0x0126" SYSFS{subsystem_vendor}=="0x1028" SYSFS{device}=="0x24cd" SYSFS{vendor}=="0x8086" looking at parent device '/devices/pci0000:00': ID=="pci0000:00" BUS=="" DRIVER=="" As you can see, this is a lot of information. The actual device information exported (the first block that says <tt>looking at device '/block/sda/sda1'</tt> is not useful to us, as there's no guarantee that it is unique (in other words, some other device could very easily have the same information). Continue looking down the output (which is actually up the device chain) to parent devices until you find one that has unique information in it. In this case, the third block (<tt>looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb4/4-6/4-6:1.0/host0/target0:0:0/0:0:0:0':</tt>) might at first appear useful, but it's not -- instead, look at the seventh block (<tt>looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb4/4-6'</tt>) which has the serial number of the device exported. looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb4/4-6': ID=="4-6" BUS=="usb" DRIVER=="usb" SYSFS{configuration}=="" SYSFS{serial}=="SNDK5D1BF51877607705" SYSFS{product}=="Cruzer Micro" SYSFS{manufacturer}=="SanDisk Corporation" SYSFS{maxchild}=="0" SYSFS{version}==" 2.00" SYSFS{devnum}=="2" SYSFS{speed}=="480" SYSFS{bMaxPacketSize0}=="64" SYSFS{bNumConfigurations}=="1" SYSFS{bDeviceProtocol}=="00" SYSFS{bDeviceSubClass}=="00" SYSFS{bDeviceClass}=="00" SYSFS{bcdDevice}=="0020" SYSFS{idProduct}=="5151" SYSFS{idVendor}=="0781" SYSFS{bMaxPower}=="200mA" SYSFS{bmAttributes}=="80" SYSFS{bConfigurationValue}=="1" SYSFS{bNumInterfaces}==" 1" This is the information that we can use to create a custom udev rule for this device. It's important to remember that all of the information in a single udev rule must come from the same block of information (all from the same device or parent device) or it will not work. Based on the keys above, we should be able to use this udev rule to always create a custom symlink to <tt>/dev/cruzer</tt> when the device is plugged in: BUS=="usb", SYSFS{manufacturer}=="SanDisk Corporation", SYSFS{product}=="Cruzer Micro", SYSFS{serial}=="SNDK5D1BF51877607705", KERNEL=="sd?1", NAME="%k", SYMLINK+="cruzer" Note that the "<tt>==</tt>" string is a test operator and the "<tt>=</tt>" string is an assignment operator. In essence, the above rule tests for all the conditions with "<tt>==</tt>" and makes assignments with "<tt>=</tt>" - in other words, the rule will assign the default name for the device node (in this case, <tt>/dev/sda1</tt>), and make a symlink to it at <tt>/dev/cruzer</tt>. Now that we've got a rule, where do we put it? You might think that it would go in the default <tt>/etc/udev/rules.d/udev.rules</tt> file, but you'd be wrong -- this file should *never* be edited by the system admin unless you are prepared to make the edits after every udev update/upgrade. The default rules file is *always* overwritten by an upgraded udev package, as these rules *must* remain in sync with the upstream udev rules. Therefore, the proper place to put our new custom rule is in a custom rules file. The choice of naming for this file is up to you, but note that it must end with the suffix <tt>.rules</tt> for <tt>udevd(8)</tt> to look at it. A common choice of name is either <tt>10-custom.rules</tt> or <tt>10-local.rules</tt>. Place the rule above into whichever name you choose for the file and unplug the device. To see if it works properly, the easiest thing to do is run <tt>udevtrigger(8)</tt> with no arguments: root@tritium:/home/rworkman# udevtrigger root@tritium:/home/rworkman# ls -l /dev/cruzer lrwxrwxrwx 1 root root 4 2007-05-13 16:25 /dev/cruzer -> sda1 As you can see, the symlink to the device was created correctly, and I can now add this device to /etc/fstab using the /dev/cruzer link. Note that udev's rule parsing order can influence whether your custom rule works as expected. That's not to say it will influence whether it works - it just might not work as expected. For example, your rule in <tt>10-local.rules</tt> might work properly, but then one of the default rules in <tt>udev.rules</tt> (this file is named <tt>50-udev.rules</tt> in Slackware post-11.0) will be evaluated and change the device nodes and such to the defaults. If you suspect this is happening, either try placing your custom rule in a file that will be evaluated after the default rules, or the ":=" operator (see <tt>udev(7)</tt>) might help. See also: * <tt>udev(7)</tt> -- type "<tt>man 7 udev</tt>" * <tt>udevd(8)</tt> * <tt>udevinfo(8)</tt> * <tt>udevmonitor(8)</tt> * <tt>udevtrigger(8)</tt> * <tt>udevsettle(8)</tt> * <tt>udevtest(8)</tt> * <tt>/usr/doc/udev-$VERSION/</tt> -- especially the <tt>./docs/writing_udev_rules/</tt> directory OLD INFO - this information is almost certainly out of date, and the sysfs keys are definitely changed, but just in case anyone still needs it, the idea is still basically the same, so I'm leaving it here. Your mileage may vary... Cranky Card Readers Some card readers fail to report the existence of any partitions if they are plugged in before a card is inserted. Thus, if the card reader is assigned <code>/dev/sda</code> the <code>/dev/cardreader</code> symlink is created, but <code>/dev/sda1</code> does not yet exist, and the <code>/dev/cardreader1</code> symlink is missing. One solution to this problem is to set up a rule that causes all possible device node names to be created when the cardreader is plugged in. The following rule causes all device nodes to be created for any removable media with a size of zero, i.e., a card reader with no card in it: : <code>SUBSYSTEM=="block", SYSFS{size}=="0", SYSFS{removable}=="1", NAME{all_partitions}="cardreader%n"</code> 29386bee582dcda3ed0d6bf9f72379d94698b8ac Upgrading Slackware 0 173 201 2009-06-06T23:35:10Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Subject: Upgrading Slackware<br> Author: Chris Clymer aka:[[User:omal|omal]] / Pat Volkerding<br> Why: I've found this all very useful<br> When: Fri Aug 26 07:11:53 EDT 2005<br> Running: Slackware-current kernel 2.6.11<br> Rather than waiting to upgrade every 6 months or so when theres a release, I like my Slackware systems to be current. The way I do this is by mirroring most of the Slackware ftps on my own fileserver with a handy little tool called "rsync". Rsync downloads only the parts of files that have changed, so by having it run nightly, I always have an up-to-date mirror, with little bandwidth being used up. You'll want to add a script something like the following to crontab, probably by executing "crontab -e": #!/bin/sh /usr/bin/rsync -avz rsync://inferno.bioinformatics.vt.edu/slackware/slackware-current/ /mnt/mirror/slackware/ This inferno.bioinformatics server is one i've found to be fairly reliable...they even have -current isos if what one really wants is a fresh install off a CD! The script just syncs that directory on their server with /mnt/mirror/slackware on the target server...obviously this will probably be different on your server. Now if you are a SMART person, you will copy all of the files you need over to a local machine before upgrading. It's what Pat recommends in the guide I've got below...however it's also something I don't personally do ;) If you like to live on the edge, just mount your shares over SAMBA or NFS, and then proceed, adjusting the guide below accordingly. Again, this isn't mine but I've always found it useful. In this case it's the official UPGRADE.txt that Pat always includes with slack. Any Slackware release is accompanied by this file on the FTPs. This is my bible for upgrading, and while i deviate in some small ways, it is a very good guide. Straight from the source himself! ********************************* <br> = Process = Slackware 10.0 to 10.1 Upgrade HOWTO <volkerdi@slackware.com> This document explains how to upgrade from Slackware 10.0 to Slackware 10.1 ----------------------------------------------------------------------------- Before you begin, I would strongly recommend making a backup of your system, or, if not the entire system, at least the /etc directory. You might find that you need to refer to a few things about the upgrade process is complete. Back it up, or take your chances. OK, now that everything is safely backed up, let's proceed. :-) To do this, you'll need the Slackware 10.1 packages. If these are on a CD, create a new directory to mount the CD on so that it doesn't get in the way during the upgrade: mkdir /packages mount /dev/cdrom /packages The packages don't have to be on a CD-ROM, as an alternative you could copy the slackware directory (the one with the various package subdirectories in it, basically the "slackware" directory from the install CD) to someplace like /root/slackware/. The important thing is that you know where the slackware packages directory is. We'll use /root/slackware in the following examples. 0. Put your machine in single-user mode: telinit 1 1. Upgrade your glibc shared libraries. This is important, or things might go haywire during the first part of the upgrade: upgradepkg /root/slackware/a/glibc-solibs-*.tgz 2. Upgrade your package utilities: upgradepkg /root/slackware/a/pkgtools-*.tgz 3. Install sed. You should already have this, but since it's used by the package utilities it is best to be sure: upgradepkg --install-new /root/slackware/a/sed-*.tgz 4. Upgrade everything else (and install new packages): upgradepkg --install-new /root/slackware/*/*.tgz 5. Make sure your system will boot. If you use LILO, make sure the paths in /etc/lilo.conf point to a valid kernel and then type 'lilo' to reinstall LILO. If you use a bootdisk, you'll need to use makebootdisk to make a new bootdisk using the kernel in /boot. 6. Fix your config files. Some of the config files in /etc are going to need your attention. You'll find the new incoming config files on your system with the ".new" extension. You may need to fill these in with information from your old config files and then move them over. Feel brave? You can use this little script to install all of the .new config files in /etc. If you've made any local changes you'll need to add them to the newly installed files. Your old config files will be copied to *.bak. Anyway, it might be an easier starting point. Here it is: #!/bin/sh cd /etc find . -name "*.new" | while read configfile ; do if [ ! "$configfile" = "./rc.d/rc.inet1.conf.new" \ -a ! "$configfile" = "./group.new" \ -a ! "$configfile" = "./passwd.new" \ -a ! "$configfile" = "./shadow.new" ]; then cp -a $(echo $configfile | rev | cut -f 2- -d . | rev) \ $(echo $configfile | rev | cut -f 2- -d . | rev).bak 2> /dev/null mv $configfile $(echo $configfile | rev | cut -f 2- -d . | rev) fi done You'll probably also need to edit your /etc/X11/xorg.conf to change the name of the keyboard driver from "Keyboard" to "kbd". I don't know why this changed, but it did. 7. Return to multi-user mode: telinit 3 8. Remove obsolete packages. If you go into /var/log/packages and take a look at the package list: ls -lt | less You may spot some old, obsolete, or discontinued packages. If so, you can remove these using 'removepkg'. 9. Remove KDE language bloat. By upgrading all packages using --install-new you've probably installed all of the KDE language translations from the KDEI series, which will use up about 500MB. If you need only US English, you may remove the KDE language packs like this: cd /var/log/packages removepkg kde-i18n* koffice-i18n* Even if you need one of these, it might be best to start by removing them all, and then go back and install the ones you need with installpkg. At this point you should be running Slackware 10.1. :-) I wish everyone good luck with this! --- Patrick Volkerding volkerdi@slackware.com ********************************* <br> = Conclusion = You could of course omit the KDE International packages from your download scripts, or not copy them over for your install. For most people this is logical. It's possibly you don't even want all of KDE...I personally install it despite the fact that I don't run it, and reccomend you do the same. Why? Because somewhere down the road you may grab a package that depends on one of those KDE libraries, or even find you want a KDE app or two. Even with KDE slackware is only about 3GB, so unless you are really hardup for drive space, it makes good sense. Also, I should mention that one way I track slackware-current is through a nice little superkaramba script I wrote(which of course, depends on those KDE libraries!). There are other ways that may suit you better, like mailing lists and RSS feeds. I find that for me, this is simplest. If you want my script, you can grab it here: http://kdelook.org/content/show.php?content=23384 The requirements are basically just superkaramba, and whatever KDE libraries it requires. If you have the latest KDE, superkaramba is already included. = Related Links = * [[Release_Changes|Changes in Slackware Release Versions]] 4d3fd16e8bfada17db75e4939d14a25203ffd8fe Upgrade Using Slapt-get 0 174 202 2009-06-06T23:35:42Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] = Introduction = See the [[Slapt-get]] page for an introduction to slapt-get and its functionality. Prior to using slapt-get, you should really be familiar with proper usage of the native Slackware package management tools: man pkgtool man installpkg man upgradepkg man removepkg As indicated in the link above, slapt-get is *not* a replacement for those utilities - it *uses* those utilities. As such, any inherent "limitations" (yes, I use that term loosely) in the pkgtool suite will also apply to slapt-get. = Installation and Configuration = Get the [[slapt-get]] package for your version of Slackware. Once it's installed, configure it to point to your favourite mirror (edit '''/etc/slapt-get/slaptgetrc''') # See /usr/doc/slapt-get-0.10.1/example.slapt-getrc # for example source entries and configuration hints. WORKINGDIR=/var/slapt-get EXCLUDE=^kernel-.*,^alsa-.*,^glibc.*,.*-[0-9]dl$,^devs$,^udev$,aaa_elflibs,x86_64 SOURCE=http://slackware.osuosl.org/slackware-12.2/:OFFICIAL SOURCE=http://software.jaos.org/slackpacks/12.2/:OFFICIAL = Usage Hints = Depending upon your individual goals of using slapt-get, the usage hints will vary. An individual wishing to upgrade from one release of Slackware to another will have more issues with which to contend than another individual who simply wants to keep up-to-date with official security/stability patches. The biggest piece of advice I can give to *anyone* regardless of how/why you're using slapt-get is this: READ THE CHANGELOG! The pertinent portions of the changelog are also viewable for each package using --show option. You'll be okay most of the time if you ignore this advice, but don't come crying to ##slackware if you do... :) From '''man slapt-get''': UPGRADE.TXT and ChangeLog.txt is still required reading, the latter is especially true when running -current. By the way, don't even consider trying to follow the Slackware -current development using slapt-get; that's just *asking* for a problem (for reasons which will hopefully be clear later). Official ChangeLog is at ftp://ftp.slackware.com/pub/slackware/slackware-12.2/ChangeLog.txt Replace the "12.2" with the release version you're using. Rather than using the official ChangeLog (and Slackware.com bandwidth), it's better to use one of the official Slackware mirrors (you'll notice faster connections with the mirrors): <SlackwareMirror>/slackware-<version>/ChangeLog.txt See the Slackware site [[http://slackware.com/getslack/]] to find an official mirror site. == Usage Hint #1: Security and Stability Patches == If your only goal is to stay up-to-date with official security and stability patches for your version of Slackware, then the default configuration of slapt-get should work fine for you. While I'm not the author of slapt-get (Jason, feel free to jump in here), it seems to me that this was the original intent of slapt-get (and it works *extremely* well for that task, might I add). The only exception of which I can think is kernel upgrades; thankfully, those haven't happened *too* often in official releases in recent memory, but they do occur frequently enough to be worth considering. The default configuration of slapt-get will ignore kernel upgrades, so the only way you'll know about those is by reading the official ChangeLog. Anyway, every time you upgrade your kernel, you'll need to make sure the paths in '''/etc/lilo.conf''' point to a valid kernel, and then run '''/sbin/lilo''' to reinstall LILO. If you use some other boot loader, then I'm going to assume you know enough about its usage to perform the corresponding operation (if required) after upgrading your kernel. I would recommend that you keep your old kernel around when installing a new one; it's always good to have a known-good kernel lying around just in case the new one doesn't boot. However, you'll notice that by default, running this command: slapt-get --install kernel-$VERSION will *upgrade* the kernel; in other words, it will *remove* the old kernel package and *install* the new one. This is not desirable if you wanted to keep your old kernel, so you can run this command instead: slapt-get --install --no-upgrade kernel-$VERSION From '''man slapt-get''': --no-upgrade Install the package rather than attempting to detect if a previous version is installed and upgrading it. This is useful for installing kernel packages. This option is only valid for --install targets. You might also find this option useful for installing multiple versions of the alsa-* packages; if you're running both 2.4.x and 2.6.x kernels, you'll need the alsa-driver packages for both kernels, so an *upgrade* of the 2.4.x version to 2.6.x will remove the 2.4.x version. == Usage Hint #2: Upgrade From One Release To Another == Every Slackware release includes a file named UPGRADE.TXT - it was included for a reason, so READ IT! Once you are familiar with its contents, the rationale behind the information below will make more sense. === Step 1: Edit your /etc/slapt-get/slaptgetrc === Edit your '''/etc/slapt-get/slaptgetrc''' file to reflect the new Slackware version This: SOURCE=http://slackware.osuosl.org/slackware-12.1/ SOURCE=http://software.jaos.org/slackpacks/12.1/ becomes this: SOURCE=http://slackware.osuosl.org/slackware-12.2/:OFFICIAL SOURCE=http://software.jaos.org/slackpacks/12.2/:OFFICIAL === Step 2: Download all updated packages === Download all updated packages to slapt-get's working directory; by default, this is '''/var/slapt-get''' slapt-get --dist-upgrade --ignore-excludes --download-only === Step 3: Put your machine in single-user mode === Make sure you have already performed step 2, because the network will not be available in runlevel 1. telinit 1 === Step 4: Upgrade main packages === Versions >= 0.9.11 upgrade glibc-solibs, pkgtools, and sed first , and then upgrade the remainder of the packages. If you have read the UPGRADE.TXT file, you already know why this is needed. (hint, hint) * '''Step 4a:''' If you are using slapt-get version earlier than 0.9.11, do: slapt-get --install kernel --no-upgrade slapt-get --install glibc-solibs pkgtools sed slapt-get --dist-upgrade * '''Step 4b:''' If you are using slapt-get version 0.9.11 or later, do: slapt-get --install kernel --no-upgrade slapt-get --dist-upgrade --ignore-excludes The '''--dist-upgrade''' option will prompt you to install all *new* packages in the ./a series, and you should say "yes" to ensure that you have a working system after the upgrade. See step 8 below for more information on installing new packages. === Step 5: Update LILO and config files === * Make sure the paths in '''/etc/lilo.conf''' point to a valid kernel image, and then run '''/sbin/lilo''' * Fix your config files in '''/etc'''; the new ones are named with a *.new suffix. You should be able to use '''diff -u file file.new''' to show the differences between file and file.new. You'll have to decide whether to completely replace the old files with the new ones or merge your changes into the new ones first, but you *must* use the new files. === Step 6: Go back to multi-user mode === Sometimes the screen stays blank when you return to runlevel 3, and you might be worried that something went wrong. Before you panic, type '''clear''' and press Enter - you'll probably get your root prompt back :) telinit 3 === Step 7: Remove obsolete packages === There is an option to do this automatically with slapt-get: slapt-get [--remove|--dist-upgrade] --remove-obsolete From '''man slapt-get''' --remove-obsolete Remove installed packages that are no longer available. This works for dist-upgrade only. This removes packages that are no longer available from any current package sources, but are currently installed. Be careful as this will also remove custom built packages. As you see, this option will be fine ''if you don't have any custom-compiled packages'' installed (such as with [[checkinstall]] or using [[SlackBuild_Scripts]]). Read through the official ChangeLog to find all packages that were removed from Slackware during the development phase; you might be able use something like this to make the process go a bit more quickly: grep -i removed ChangeLog.txt OR grep Removed ChangeLog.txt === Step 8: Add new packages === Similar to removing obsolete packages, there is an option to do this automatically with slapt-get using the '''--install-set''' option: slapt-get --upgrade --install-set a ap d f k kde l n t tcl x xap y From '''man slapt-get''': --install-set [disk set(s)] Install specified disk set(s). example: --install-set xap n l This option will upgrade (or install, if not already installed) every package in every disk set. For reasons already detailed (kernel/alsa versions), this may not be desirable; additionally, if you don't have a full installation of Slackware for whatever reason, this will not be desirable. The safest option is to read through the official ChangeLog.txt, make a note of new packages added during the release cycle, and install them now with this command: slapt-get --install <newpackage1> <newpackage2> <...> You might be able to use something like this to make the process go a bit more quickly, but it will return quite a few extraneous results. grep -i added ChangeLog.txt === Step 9: Admire the Results :) === At this point, you should be running the latest version of Slackware. == Usage Hint #3: Keep Up With Slackware -current Development == After modifying your <code>/etc/slapt-get/slaptgetrc</code> file to reflect -current sources, the most important advice you should hear is: <b>READ THE CHANGELOG</b> Seriously, always read the ChangeLog.txt file associated with the -current tree; so long as you read it prior to running the <code>slapt-get --upgrade</code> command, you should be familiar with any issues that might be encountered. One idea you might consider is to use slapt-get as a "double checking" tool to ensure you haven't accidentally overlooked any packages. While the concerns detailed earlier in this article apply here (you won't be informed of any new packages added to -current), you can use the following lines to see if you missed anything that needed to be upgraded: slapt-get --update slapt-get --upgrade --simulate = Related Links = * [http://www.slackersbible.org/node/98 Unofficial slapt-get HOWTO] * [[Release_Changes|Changes in Slackware Release Versions]] ed5d8d7f93fc48ffb864c3b38a06e4e8c7d26594 User Administration 0 175 203 2009-06-06T23:36:15Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] ==Adding Users== To ADD users: <code>adduser <i>user</i></code> ==Deleting Users== To REMOVE users: <code>userdel <i>baduser</i></code> The above command will remove the entry matching the username <i>baduser</i> from the <code>/etc/passwd</code> file and if you're using the Shadow password format (which you should be), also from the <code>/etc/shadow</code> file. <b>NOTE: </b>The <code>/etc/group</code> file is not modified to avoid removing a group that other users may also belong to. This isn't much of a big deal because you can edit the group file and remove the entry manually. <b>Should you wish to remove the user's home directory as well</b>, add the <code>-r</code> option to the <code>userdel</code> command. EXAMPLE: <code>userdel -r <i>baduser</i></code> ==Changing User's Passwords== To change users password: <code>passwd <i>user</i></code> ==Adding User to Group== If you want to add your user to other groups in the <code>/etc/group</code> file, you can simply use the <code>gpasswd</code> command like this: <code>gpasswd -a user group</code> bb15faa84d503ceb2bc0f769fcb875e3166f938c User Limits 0 176 204 2009-06-06T23:36:42Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tips]] == CPU / Performance Limits == To set limits on users (e.g. CPU usage), use <code>ulimit</code>. EXAMPLE: <code>ulimit -t;</code> From the manpage: <code>-a</code> All current limits are reported<br> <code>-c</code> The maximum size of core files created<br> <code>-d</code> The maximum size of a process's data segment<br> <code>-f</code> The maximum size of files created by the shell<br> <code>-i</code> The maximum number of pending signals<br> <code>-l</code> The maximum size that may be locked into memory<br> <code>-m</code> The maximum resident set size<br> <code>-n</code> The maximum number of open file descriptors (most systems do not allow this value to be set)<br> <code>-p</code> The pipe size in 512-byte blocks (this may not be set)<br> <code>-q</code> The maximum number of bytes in POSIX message queues<br> <code>-s</code> The maximum stack size<br> <code>-t</code> The maximum amount of cpu time in seconds<br> <code>-u</code> The maximum number of processes available to a single user<br> <code>-v</code> The maximum amount of virtual memory available to the shell<br> <code>-x</code> The maximum number of file locks<br> == Disk Space Limits == Use <code>quota</code>. e89f1dd55c86ffae9e859b1031dd1455ae8efc43 Utf-8 linux console 0 177 205 2009-06-06T23:37:38Z Erik 1 Copy from old, had no category, placed in Tutorials wikitext text/x-wiki [[Category:Tutorials]] == A Quick Look at Using UTF-8 in the Linux Console (without X) == A few people have asked about this in #slackware lately so I though I'd put down a few notes on how I got utf-8 up and running. Feel free to add any further info. In these days of high powered X desktop environments with all their flashy composite bells and whistles it may seem strange to worry about how the plain Linux console behaves, but we need to remember that there are some very nice applications that live in the console and can be just as (or even more) productive than the X Windows counterparts. I'm thinking of screen, irssi, mutt, elinks, vim/vi, mplayer (using svga), links, zgv and slrn to name but a few. And of course we have to mention Slackware tools like pgktool, slackpkg and sbopkg. Once you get hooked on using the console it is hard to go back. Anyway here we go ... == The Console == The first thing to do is configure the console. There is a kernel parameter we can add to /etc/lilo.conf to do this: append="vt.default_utf8=1" Here's an example from mine: # Linux bootable partition config begins image = /boot/vmlinuz-2.6.27.7-custom root = /dev/hda1 label = Linux-custom append="resume=/dev/hda2 vt.default_utf8=1" read-only # Linux bootable partition config ends Once you have saved lilo.conf and run '''lilo''' a quick reboot is needed. == Fonts == After that we need to find a font that actually contains the characters you want to see. My 'font of the moment' is lat9w-16. This contains the British £ (pound) and € (euro) symbols that I need, plus a lot of useful accented characters. But what is just as important are the correct drawing characters so that curses programs like pkgtool and sbopkg are printed on the screen correctly. If you experiment with the '''setconsolefont''' command you will find that some fonts draw curses box borders as squares or question marks, so check out some fonts and see which ones work and which don't. The '''setconsolefont''' command will put your chosen font into /etc/rc.d/rc.font so it will load at bootup. == Keyboard == Ok, great you can now read characters correctly, but you need the correct keymap to be able to type them. That's a little harder. If you can find a utf-8 keymap for your locale/hardware then that's fine. Personally I didn't find any of the installed keymaps suitable so I looked around for an alternative. I found a uk-utf8 keymap on the intertubes, but this was unfortunately missing all the Ctrl+[a-z] keys so I edited it and added my own. I also added some AltGr+[a-z] (well not all of those) for accented characters. You may find this keymap useful as a starting point to create your own if you cannot find a more suitable one. Have a look through the comments and the codes and you should pick up the method. To add your own combinations you will need to know the correct codes for the characters you need. You can find a table of utf-8 characters here: [http://www.tony-franks.co.uk/UTF-8.htm]http://www.tony-franks.co.uk/UTF-8.htm Look up the code in that table and convert it to hex. E.G. è is 232 in decimal, E8 in hex; é is code 233 in decimal, E9 in hex, so the entry in your keymap should be: # key = normal shifted AltGr+e AltGr+shift+e keycode 18 = e E U+00E8 U+00E9 # prints: e E è é You can find the keycodes with the '''showkey''' program. Once edited you can load the map with the '''loadkeys''' program. Loadkeys will update /etc/rc.d/rc.keymap but you will need to copy the keymap to /usr/share/kbd/keymaps/i386/qwerty/ so it is found on bootup. Here is a link to my updated uk-utf8 map: [http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz]http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz You can load this ungzipped but it's better to gzip it back after editing to keep things consistent. == Conclusion == By now you should have a fully usable keyboard/console correctly printing unicode characters. You will probably need to tell some programs like mutt and irrsi that you are using a utf-8 system. Note: There exists two applications - '''unicode_start''' and '''unicode_stop''' - I think these are no longer required and only seem to mess up the screen if they are used together with the kernel parameter, but of course ymmv. Bye for now, [[User:Dive|Dive]] 02:33, 20 March 2009 (UTC) 262752dfe352b31d2ff4e84178fd83af07e8a3ae 223 205 2009-07-27T20:13:53Z Dive 19 /* Conclusion */ wikitext text/x-wiki [[Category:Tutorials]] == A Quick Look at Using UTF-8 in the Linux Console (without X) == A few people have asked about this in #slackware lately so I though I'd put down a few notes on how I got utf-8 up and running. Feel free to add any further info. In these days of high powered X desktop environments with all their flashy composite bells and whistles it may seem strange to worry about how the plain Linux console behaves, but we need to remember that there are some very nice applications that live in the console and can be just as (or even more) productive than the X Windows counterparts. I'm thinking of screen, irssi, mutt, elinks, vim/vi, mplayer (using svga), links, zgv and slrn to name but a few. And of course we have to mention Slackware tools like pgktool, slackpkg and sbopkg. Once you get hooked on using the console it is hard to go back. Anyway here we go ... == The Console == The first thing to do is configure the console. There is a kernel parameter we can add to /etc/lilo.conf to do this: append="vt.default_utf8=1" Here's an example from mine: # Linux bootable partition config begins image = /boot/vmlinuz-2.6.27.7-custom root = /dev/hda1 label = Linux-custom append="resume=/dev/hda2 vt.default_utf8=1" read-only # Linux bootable partition config ends Once you have saved lilo.conf and run '''lilo''' a quick reboot is needed. == Fonts == After that we need to find a font that actually contains the characters you want to see. My 'font of the moment' is lat9w-16. This contains the British £ (pound) and € (euro) symbols that I need, plus a lot of useful accented characters. But what is just as important are the correct drawing characters so that curses programs like pkgtool and sbopkg are printed on the screen correctly. If you experiment with the '''setconsolefont''' command you will find that some fonts draw curses box borders as squares or question marks, so check out some fonts and see which ones work and which don't. The '''setconsolefont''' command will put your chosen font into /etc/rc.d/rc.font so it will load at bootup. == Keyboard == Ok, great you can now read characters correctly, but you need the correct keymap to be able to type them. That's a little harder. If you can find a utf-8 keymap for your locale/hardware then that's fine. Personally I didn't find any of the installed keymaps suitable so I looked around for an alternative. I found a uk-utf8 keymap on the intertubes, but this was unfortunately missing all the Ctrl+[a-z] keys so I edited it and added my own. I also added some AltGr+[a-z] (well not all of those) for accented characters. You may find this keymap useful as a starting point to create your own if you cannot find a more suitable one. Have a look through the comments and the codes and you should pick up the method. To add your own combinations you will need to know the correct codes for the characters you need. You can find a table of utf-8 characters here: [http://www.tony-franks.co.uk/UTF-8.htm]http://www.tony-franks.co.uk/UTF-8.htm Look up the code in that table and convert it to hex. E.G. è is 232 in decimal, E8 in hex; é is code 233 in decimal, E9 in hex, so the entry in your keymap should be: # key = normal shifted AltGr+e AltGr+shift+e keycode 18 = e E U+00E8 U+00E9 # prints: e E è é You can find the keycodes with the '''showkey''' program. Once edited you can load the map with the '''loadkeys''' program. Loadkeys will update /etc/rc.d/rc.keymap but you will need to copy the keymap to /usr/share/kbd/keymaps/i386/qwerty/ so it is found on bootup. Here is a link to my updated uk-utf8 map: [http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz]http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz You can load this ungzipped but it's better to gzip it back after editing to keep things consistent. == Conclusion == By now you should have a fully usable keyboard/console correctly printing unicode characters. You will probably need to tell some programs like mutt and irrsi that you are using a utf-8 system. Note: There exists two applications - '''unicode_start''' and '''unicode_stop'''. Typing unicode_start <font> will load the required font and set up keyboard correctly for unicode input. Bye for now, [[User:Dive|Dive]] 02:33, 20 March 2009 (UTC) ae4b4ef16c82f3186f9c74a9217830f4c35450d6 224 223 2009-07-27T20:14:35Z Dive 19 /* Conclusion */ wikitext text/x-wiki [[Category:Tutorials]] == A Quick Look at Using UTF-8 in the Linux Console (without X) == A few people have asked about this in #slackware lately so I though I'd put down a few notes on how I got utf-8 up and running. Feel free to add any further info. In these days of high powered X desktop environments with all their flashy composite bells and whistles it may seem strange to worry about how the plain Linux console behaves, but we need to remember that there are some very nice applications that live in the console and can be just as (or even more) productive than the X Windows counterparts. I'm thinking of screen, irssi, mutt, elinks, vim/vi, mplayer (using svga), links, zgv and slrn to name but a few. And of course we have to mention Slackware tools like pgktool, slackpkg and sbopkg. Once you get hooked on using the console it is hard to go back. Anyway here we go ... == The Console == The first thing to do is configure the console. There is a kernel parameter we can add to /etc/lilo.conf to do this: append="vt.default_utf8=1" Here's an example from mine: # Linux bootable partition config begins image = /boot/vmlinuz-2.6.27.7-custom root = /dev/hda1 label = Linux-custom append="resume=/dev/hda2 vt.default_utf8=1" read-only # Linux bootable partition config ends Once you have saved lilo.conf and run '''lilo''' a quick reboot is needed. == Fonts == After that we need to find a font that actually contains the characters you want to see. My 'font of the moment' is lat9w-16. This contains the British £ (pound) and € (euro) symbols that I need, plus a lot of useful accented characters. But what is just as important are the correct drawing characters so that curses programs like pkgtool and sbopkg are printed on the screen correctly. If you experiment with the '''setconsolefont''' command you will find that some fonts draw curses box borders as squares or question marks, so check out some fonts and see which ones work and which don't. The '''setconsolefont''' command will put your chosen font into /etc/rc.d/rc.font so it will load at bootup. == Keyboard == Ok, great you can now read characters correctly, but you need the correct keymap to be able to type them. That's a little harder. If you can find a utf-8 keymap for your locale/hardware then that's fine. Personally I didn't find any of the installed keymaps suitable so I looked around for an alternative. I found a uk-utf8 keymap on the intertubes, but this was unfortunately missing all the Ctrl+[a-z] keys so I edited it and added my own. I also added some AltGr+[a-z] (well not all of those) for accented characters. You may find this keymap useful as a starting point to create your own if you cannot find a more suitable one. Have a look through the comments and the codes and you should pick up the method. To add your own combinations you will need to know the correct codes for the characters you need. You can find a table of utf-8 characters here: [http://www.tony-franks.co.uk/UTF-8.htm]http://www.tony-franks.co.uk/UTF-8.htm Look up the code in that table and convert it to hex. E.G. è is 232 in decimal, E8 in hex; é is code 233 in decimal, E9 in hex, so the entry in your keymap should be: # key = normal shifted AltGr+e AltGr+shift+e keycode 18 = e E U+00E8 U+00E9 # prints: e E è é You can find the keycodes with the '''showkey''' program. Once edited you can load the map with the '''loadkeys''' program. Loadkeys will update /etc/rc.d/rc.keymap but you will need to copy the keymap to /usr/share/kbd/keymaps/i386/qwerty/ so it is found on bootup. Here is a link to my updated uk-utf8 map: [http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz]http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz You can load this ungzipped but it's better to gzip it back after editing to keep things consistent. == Conclusion == By now you should have a fully usable keyboard/console correctly printing unicode characters. You will probably need to tell some programs like mutt and irrsi that you are using a utf-8 system. Note: There exists two applications - '''unicode_start''' and '''unicode_stop'''. Typing unicode_start [font] will load the required font and set up keyboard correctly for unicode input. Bye for now, [[User:Dive|Dive]] 02:33, 20 March 2009 (UTC) be79ca8359f41a05b6e25d21067fd639d4e915ed 225 224 2009-07-27T20:15:19Z Dive 19 /* Conclusion */ wikitext text/x-wiki [[Category:Tutorials]] == A Quick Look at Using UTF-8 in the Linux Console (without X) == A few people have asked about this in #slackware lately so I though I'd put down a few notes on how I got utf-8 up and running. Feel free to add any further info. In these days of high powered X desktop environments with all their flashy composite bells and whistles it may seem strange to worry about how the plain Linux console behaves, but we need to remember that there are some very nice applications that live in the console and can be just as (or even more) productive than the X Windows counterparts. I'm thinking of screen, irssi, mutt, elinks, vim/vi, mplayer (using svga), links, zgv and slrn to name but a few. And of course we have to mention Slackware tools like pgktool, slackpkg and sbopkg. Once you get hooked on using the console it is hard to go back. Anyway here we go ... == The Console == The first thing to do is configure the console. There is a kernel parameter we can add to /etc/lilo.conf to do this: append="vt.default_utf8=1" Here's an example from mine: # Linux bootable partition config begins image = /boot/vmlinuz-2.6.27.7-custom root = /dev/hda1 label = Linux-custom append="resume=/dev/hda2 vt.default_utf8=1" read-only # Linux bootable partition config ends Once you have saved lilo.conf and run '''lilo''' a quick reboot is needed. == Fonts == After that we need to find a font that actually contains the characters you want to see. My 'font of the moment' is lat9w-16. This contains the British £ (pound) and € (euro) symbols that I need, plus a lot of useful accented characters. But what is just as important are the correct drawing characters so that curses programs like pkgtool and sbopkg are printed on the screen correctly. If you experiment with the '''setconsolefont''' command you will find that some fonts draw curses box borders as squares or question marks, so check out some fonts and see which ones work and which don't. The '''setconsolefont''' command will put your chosen font into /etc/rc.d/rc.font so it will load at bootup. == Keyboard == Ok, great you can now read characters correctly, but you need the correct keymap to be able to type them. That's a little harder. If you can find a utf-8 keymap for your locale/hardware then that's fine. Personally I didn't find any of the installed keymaps suitable so I looked around for an alternative. I found a uk-utf8 keymap on the intertubes, but this was unfortunately missing all the Ctrl+[a-z] keys so I edited it and added my own. I also added some AltGr+[a-z] (well not all of those) for accented characters. You may find this keymap useful as a starting point to create your own if you cannot find a more suitable one. Have a look through the comments and the codes and you should pick up the method. To add your own combinations you will need to know the correct codes for the characters you need. You can find a table of utf-8 characters here: [http://www.tony-franks.co.uk/UTF-8.htm]http://www.tony-franks.co.uk/UTF-8.htm Look up the code in that table and convert it to hex. E.G. è is 232 in decimal, E8 in hex; é is code 233 in decimal, E9 in hex, so the entry in your keymap should be: # key = normal shifted AltGr+e AltGr+shift+e keycode 18 = e E U+00E8 U+00E9 # prints: e E è é You can find the keycodes with the '''showkey''' program. Once edited you can load the map with the '''loadkeys''' program. Loadkeys will update /etc/rc.d/rc.keymap but you will need to copy the keymap to /usr/share/kbd/keymaps/i386/qwerty/ so it is found on bootup. Here is a link to my updated uk-utf8 map: [http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz]http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz You can load this ungzipped but it's better to gzip it back after editing to keep things consistent. == Conclusion == By now you should have a fully usable keyboard/console correctly printing unicode characters. You will probably need to tell some programs like mutt and irrsi that you are using a utf-8 system. Note: There exists two shell scripts - '''unicode_start''' and '''unicode_stop'''. Typing unicode_start [font] will load the required font and set up keyboard correctly for unicode input. Bye for now, [[User:Dive|Dive]] 02:33, 20 March 2009 (UTC) ca6061f8b31f789e2352af83cfad79bacbf456a7 226 225 2009-07-27T20:15:47Z Dive 19 /* Conclusion */ wikitext text/x-wiki [[Category:Tutorials]] == A Quick Look at Using UTF-8 in the Linux Console (without X) == A few people have asked about this in #slackware lately so I though I'd put down a few notes on how I got utf-8 up and running. Feel free to add any further info. In these days of high powered X desktop environments with all their flashy composite bells and whistles it may seem strange to worry about how the plain Linux console behaves, but we need to remember that there are some very nice applications that live in the console and can be just as (or even more) productive than the X Windows counterparts. I'm thinking of screen, irssi, mutt, elinks, vim/vi, mplayer (using svga), links, zgv and slrn to name but a few. And of course we have to mention Slackware tools like pgktool, slackpkg and sbopkg. Once you get hooked on using the console it is hard to go back. Anyway here we go ... == The Console == The first thing to do is configure the console. There is a kernel parameter we can add to /etc/lilo.conf to do this: append="vt.default_utf8=1" Here's an example from mine: # Linux bootable partition config begins image = /boot/vmlinuz-2.6.27.7-custom root = /dev/hda1 label = Linux-custom append="resume=/dev/hda2 vt.default_utf8=1" read-only # Linux bootable partition config ends Once you have saved lilo.conf and run '''lilo''' a quick reboot is needed. == Fonts == After that we need to find a font that actually contains the characters you want to see. My 'font of the moment' is lat9w-16. This contains the British £ (pound) and € (euro) symbols that I need, plus a lot of useful accented characters. But what is just as important are the correct drawing characters so that curses programs like pkgtool and sbopkg are printed on the screen correctly. If you experiment with the '''setconsolefont''' command you will find that some fonts draw curses box borders as squares or question marks, so check out some fonts and see which ones work and which don't. The '''setconsolefont''' command will put your chosen font into /etc/rc.d/rc.font so it will load at bootup. == Keyboard == Ok, great you can now read characters correctly, but you need the correct keymap to be able to type them. That's a little harder. If you can find a utf-8 keymap for your locale/hardware then that's fine. Personally I didn't find any of the installed keymaps suitable so I looked around for an alternative. I found a uk-utf8 keymap on the intertubes, but this was unfortunately missing all the Ctrl+[a-z] keys so I edited it and added my own. I also added some AltGr+[a-z] (well not all of those) for accented characters. You may find this keymap useful as a starting point to create your own if you cannot find a more suitable one. Have a look through the comments and the codes and you should pick up the method. To add your own combinations you will need to know the correct codes for the characters you need. You can find a table of utf-8 characters here: [http://www.tony-franks.co.uk/UTF-8.htm]http://www.tony-franks.co.uk/UTF-8.htm Look up the code in that table and convert it to hex. E.G. è is 232 in decimal, E8 in hex; é is code 233 in decimal, E9 in hex, so the entry in your keymap should be: # key = normal shifted AltGr+e AltGr+shift+e keycode 18 = e E U+00E8 U+00E9 # prints: e E è é You can find the keycodes with the '''showkey''' program. Once edited you can load the map with the '''loadkeys''' program. Loadkeys will update /etc/rc.d/rc.keymap but you will need to copy the keymap to /usr/share/kbd/keymaps/i386/qwerty/ so it is found on bootup. Here is a link to my updated uk-utf8 map: [http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz]http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz You can load this ungzipped but it's better to gzip it back after editing to keep things consistent. == Conclusion == By now you should have a fully usable keyboard/console correctly printing unicode characters. You will probably need to tell some programs like mutt and irrsi that you are using a utf-8 system. Note: There exists two shell scripts - '''unicode_start''' and '''unicode_stop'''. Typing '''unicode_start [font]''' will load the required font and set up keyboard correctly for unicode input. Bye for now, [[User:Dive|Dive]] 02:33, 20 March 2009 (UTC) 00db55b66cd228e43deb1f75067b54771e88ee39 228 226 2009-08-08T18:33:56Z Dive 19 /* A Quick Look at Using UTF-8 in the Linux Console (without X) */ wikitext text/x-wiki [[Category:Tutorials]] ''by Dive'' == A Quick Look at Using UTF-8 in the Linux Console (without X) == A few people have asked about this in #slackware lately so I though I'd put down a few notes on how I got utf-8 up and running. Feel free to add any further info. In these days of high powered X desktop environments with all their flashy composite bells and whistles it may seem strange to worry about how the plain Linux console behaves, but we need to remember that there are some very nice applications that live in the console and can be just as (or even more) productive than the X Windows counterparts. I'm thinking of screen, irssi, mutt, elinks, vim/vi, mplayer (using svga), links, zgv and slrn to name but a few. And of course we have to mention Slackware tools like pgktool, slackpkg and sbopkg. Once you get hooked on using the console it is hard to go back. Anyway here we go ... == The Console == The first thing to do is configure the console. There is a kernel parameter we can add to /etc/lilo.conf to do this: append="vt.default_utf8=1" Here's an example from mine: # Linux bootable partition config begins image = /boot/vmlinuz-2.6.27.7-custom root = /dev/hda1 label = Linux-custom append="resume=/dev/hda2 vt.default_utf8=1" read-only # Linux bootable partition config ends Once you have saved lilo.conf and run '''lilo''' a quick reboot is needed. == Fonts == After that we need to find a font that actually contains the characters you want to see. My 'font of the moment' is lat9w-16. This contains the British £ (pound) and € (euro) symbols that I need, plus a lot of useful accented characters. But what is just as important are the correct drawing characters so that curses programs like pkgtool and sbopkg are printed on the screen correctly. If you experiment with the '''setconsolefont''' command you will find that some fonts draw curses box borders as squares or question marks, so check out some fonts and see which ones work and which don't. The '''setconsolefont''' command will put your chosen font into /etc/rc.d/rc.font so it will load at bootup. == Keyboard == Ok, great you can now read characters correctly, but you need the correct keymap to be able to type them. That's a little harder. If you can find a utf-8 keymap for your locale/hardware then that's fine. Personally I didn't find any of the installed keymaps suitable so I looked around for an alternative. I found a uk-utf8 keymap on the intertubes, but this was unfortunately missing all the Ctrl+[a-z] keys so I edited it and added my own. I also added some AltGr+[a-z] (well not all of those) for accented characters. You may find this keymap useful as a starting point to create your own if you cannot find a more suitable one. Have a look through the comments and the codes and you should pick up the method. To add your own combinations you will need to know the correct codes for the characters you need. You can find a table of utf-8 characters here: [http://www.tony-franks.co.uk/UTF-8.htm]http://www.tony-franks.co.uk/UTF-8.htm Look up the code in that table and convert it to hex. E.G. è is 232 in decimal, E8 in hex; é is code 233 in decimal, E9 in hex, so the entry in your keymap should be: # key = normal shifted AltGr+e AltGr+shift+e keycode 18 = e E U+00E8 U+00E9 # prints: e E è é You can find the keycodes with the '''showkey''' program. Once edited you can load the map with the '''loadkeys''' program. Loadkeys will update /etc/rc.d/rc.keymap but you will need to copy the keymap to /usr/share/kbd/keymaps/i386/qwerty/ so it is found on bootup. Here is a link to my updated uk-utf8 map: [http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz]http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz You can load this ungzipped but it's better to gzip it back after editing to keep things consistent. == Conclusion == By now you should have a fully usable keyboard/console correctly printing unicode characters. You will probably need to tell some programs like mutt and irrsi that you are using a utf-8 system. Note: There exists two shell scripts - '''unicode_start''' and '''unicode_stop'''. Typing '''unicode_start [font]''' will load the required font and set up keyboard correctly for unicode input. Bye for now, [[User:Dive|Dive]] 02:33, 20 March 2009 (UTC) 9db6ca8b3e73d9280e294a45f98e9396c442e0bd Vi 0 178 206 2009-06-06T23:38:42Z Erik 1 Copy from old wikitext text/x-wiki Vi-like editors are a class of editors, some instance of which is on every *nix ever made. So learning to use a vi-like editor is a must! In Slackware, elvis is the default editor, but Slackware also provides a console-only and gui-enabled vim as well. The core command set is the same, though details may vary. (For instance, 'g' and 'gg' are vim commands but not nvi commands, but both recognize 'G' commands.) To find out what you'll be executing, try $ ls -l `which vi` Then open the editor to an example file (as a user) vi /etc/fstab Now before we start you must realize that there are two modes. First is a command mode where you type commands, move the cursor. The other mode is the Insert Mode and this mode is where you type text. The basic movement keys are: (sorry for the bad graphic below) ^ k <h l> j v Move around with the keys above and you will find out that you will get used to it faster then you thought you would. Movement is the key thing to learn in VI and there are a few things you might need to know: $ Moves to end of the line 0 Moves to the beginning of the line ^ Moves the the end of the white space in the line. The above are pretty easy to understand, but I want to explain the ^ key more. Say you have this line: Hello Sandman1 is nice When you are on the line above and you press the ^, You will land on the H. In VI you can also move forward on words as well: w Goes to the next word including Punctuation W Goes to the next word NOT including Punctuation b Goes back a word including punctuation B Goes back a word NOT including Punctuation The above commands make your text editing go faster. To explain the no punctuation look at the follow line: Hello, My name is Sandman1. Now imagine your cursor is on the H. If you press the w key you will land on the comma, but if you press the W key it will land on the M in My. Now say you are in the insert mode (you will learn how to later in this tutorial) and you make a mistake? the c command is useful: cw Change the next word cb Change the word behind the cursor r Change Character C Change from the cursor to the end of the line c0 Change from the cursor to the beginning of the line c^ Change from the cursor to the white space at the begging of the line. Now these are pretty self explanatory, but I want you to notice how we used the other commands we learned already such as the B, $ , etc. You can also use the capital B and the capital W and get the same effect.Now say you want to erase things as well? We use the d key for that: dd Delete current line dw Delete word d$ Delete from the cursor to the end of the line d^ Delete from the cursor to the white space at the beginning of the line d0 Delete from the cursor to the beginning of the line These are again pretty basic to understand. i Insert text before the cursor I Insert text at the beginning of the line A Insert text at the end of the line a Insert text after the cursor o Insert text on a NEW line below the current line O Insert text on a NEW line above the current line Now these are a lot of memorize, but I only usually use o, A and i. Now say you are typing and you made a few mistakes the best way to get rid of the mistakes are getting out of insert mode: ESC <<<<<<<<<<< IMPORTANT, learn how to get out of insert mode Yes you actually press the escape key:). Now you can type the commands you wish such as delete, or even change a word. Once you start using VI you will learn these commands and you wont even have to think to do the tasks. Now say you have an error in a config file and you want to go to the line type this outside of vi: vi +100 /etc/apache/httpd.conf This will open to line 100. To verify that you're on that line, type C-g. You can also head to a different line by typing: :100 100G G Goes to the end of File (Special) 1G Goes to the beginning of the file (special) The reason why I marked the 1G and the G special is because they are REALLY useful and you shouldn't forget them. Since we have used a ctrl key in here why not just show you how to move up and down a page: C-f Forwards one page C-b Goes back on page Ok we have a general idea on how we make VI work, but we still don't know how to close the damn thing. The following are the basic commands to open and close VI: :w Saves the current buffer to the file you opened with :e! Reloads the current file not saving any changes :e Loads a file :q Quits :wq Quits and saves Now the :w and the :e you can also put with a file, for instance: :e /etc/lilo.conf This will open the file /etc/lilo.conf. If you opened a file, but also had another file opened? Just press C-6 to switch. Now say you have opened vi and don't want to save, but still quit? Just put a ! in the command: :q! The ! works with all the commands even :w. Another quick way to save and exit is just type ZZ in the command mode. That will exit and save. The next thing is out of place, but I think you should know it. Say you want to move down 5 lines? 5j That will move down five lines and you can do this on a lot of commands.For instance: 5dj The follow will erase 5 lines in the down direction! There are more commands than just listed in this tutorial and perhaps I will write an advanced tutorial for VI, But for now you know the basic VI. Good luck:) This is by Sandman1 @ freenode [[Category:Tutorials]] 1fc515610d0305e6896699ee5ec552aae1a17193 Wifi 0 179 207 2009-06-06T23:39:20Z Erik 1 Copy from old wikitext text/x-wiki [[Category:Tutorials]] Regarding wireless, I promised more info on getting wifi to work with linux. Here it is. I'm still utilizing the Linksys WPC11 wireless PCMCIA network card in Slackware. The methods I'm about to discuss work in Slackware v8.0 through v11 (I've not tested v12 yet, but there shouldn't be an issue). 9.0 and 9.1 seem to use orinoco drivers instead of prism drivers. I COULD fix this by installing prism drivers but the orinoco driver seem to work without problems (so far). When and if problems arise, I'll move to the prism drivers and update this page. Note: this page goes through the manual steps of gaining internet activity. I tend to use static IP configurations. This means that the system won't rely on a DHCP server for connectivty, which is why I cover how to edit the routing table of your system. Another reason I go through the manual process is so that the new user can know and understand the technical aspects of networking and the internals of Slackware (or any *nix-based system). Now, my particular laptop accepts a CAT5 connection and will also run PCMCIA wifi (and also USB wifi adapters). I've usually relied upon the PCMCIA method of internet connectivity. Slackware 9.1 (and 9.0) accept PCMCIA cards via the Hotplug function now, which makes things very easy to set up. I usually just insert my wifi card into the PCMCIA slot and hear the computer 'beep'. Follow along by doing what I do. :o) After insertion of the card, type 'dmesg' in a shell and you should see something akin to the below: orinoco_lock() called with hw_unavailable (dev=ce66f800) hermes.c: 4 Dec 2002 David Gibson orinoco.c 0.13d (David Gibson and others) orinoco_cs.c 0.13d (David Gibson and others) eth1: Station identity 001f:0005:0001:0003 eth1: Looks like an Intersil firmware version 1.3.5 eth1: Ad-hoc demo mode supported eth1: IEEE standard IBSS ad-hoc mode supported eth1: WEP supported, 104-bit key eth1: MAC address 00:06:25:A8:EA:50 eth1: Station name "Prism I" eth1: ready eth1: index 0x01: Vcc 5.0, irq 3, io 0x0100-0x013f eth1: New link status: Connected (0001) eth1: New link status: Disconnected (0002) eth1: New link status: Connected (0001) This shows that the wifi card has been recognized and that a device name was assigned to it (eth1, in this case). To use the card, you have to know how you're going to use the card. Most people gain internet access via WAP (wireless access point) and this is what we'll do. I've not net experimented with adhoc (direct computer(s)-to-computer(s) connections) yet, but when I do, this page will be updated. A WAP's DHCP server may automatically assign your wifi card an IP. If that is the case, you won't have much use for this tutorial, other than establishing encryption. Please be aware that I cover establishing WEP encryption but not WPA/WPA2 (yet). If you're using static IPs or to establish WEP encryption, continue to read the steps below. Next, you'll want to assign a WAP for the card to access. If you type 'iwconfig' (using 'sudo' or as the superuser), you'll see your wifi card's stats: ron@toshi:~$ sudo /usr/sbin/iwconfig lo no wireless extensions. eth0 no wireless extensions. eth1 IEEE 802.11-DS ESSID:"" Nickname:"Prism I" Mode:Managed Access Point: 00:00:00:00:00:00 Bit Rate:11Mb/s Tx-Power=15 dBm Sensitivity:1/3 Retry min limit:8 RTS thr:off Fragment thr:off Encryption key:off Power Management:off Link Quality:0/92 Signal level:-68 dBm Noise level:-122 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 As you can see, there's no ESSID and the MAC address for the card isn't showing. The wifi card needs to be set up to access the WAP: ron@toshi:~$ sudo /usr/sbin/iwconfig eth1 essid applejack ron@toshi:~$ sudo /usr/sbin/iwconfig lo no wireless extensions. eth0 no wireless extensions. eth1 IEEE 802.11-DS ESSID:"applejack" Nickname:"Prism I" Mode:Managed Access Point: 00:00:00:00:00:00 Bit Rate:11Mb/s Tx-Power=15 dBm Sensitivity:1/3 Retry min limit:8 RTS thr:off Fragment thr:off Encryption key:off Power Management:off Link Quality:0/92 Signal level:-68 dBm Noise level:-122 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 Now, you need to establish an interface. I'm using 'eth1' as an interface so I'd type: "ifconfig eth1 <Static-IP-HERE> up": ron@toshi:~# sudo /sbin/ifconfig eth1 10.150.1.171 up ron@toshi:~# sudo /sbin/ifconfig eth1 eth1 Link encap:Ethernet HWaddr 00:09:5B:05:8E:C7 inet addr:10.150.1.171 Bcast:10.255.255.255 Mask:255.0.0.0 inet6 addr: fe80::209:5bff:fe05:8ec7/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:468 (468.0 b) Interrupt:20 Base address:0xa000 Next, run 'iwconfig': eth1 IEEE 802.11-DS ESSID:"applejack" Nickname:"Prism I" Mode:Managed Frequency:2.437GHz Access Point: 00:07:23:78:95:80 Bit Rate:2Mb/s Tx-Power=15 dBm Sensitivity:1/3 Retry min limit:8 RTS thr:off Fragment thr:off Encryption key:off Power Management:off Link Quality:90/92 Signal level:5/153 Noise level:117/153 Rx invalid nwid:0 Rx invalid crypt:51 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 If you're not utilizing encryption on your WAP, then you should be set for online activity (provided your routing table is set up, if you're using static IPs...this is covered below). Some people use WEP/WPA (at the LEAST, use WEP), so we'll establish this now. You'll have to know what bit size your WAP is set to use but I normally use 128-bit. Type 'iwconfig eth1 key (your key here)'. Do this without the parentheses: iwconfig eth1 key xxxxxxxxxxxxxxxxxxxxxxxxxx I've put the 'xxxx's there because there's no way in a hot day in Hell I'm going to share my encryption with the world. Replace the x's with your own key. To check the WEP status: root@toshi:~# iwconfig lo no wireless extensions. eth0 no wireless extensions. eth1 IEEE 802.11-DS ESSID:"applejack" Nickname:"Prism I" Mode:Managed Frequency:2.437GHz Access Point: 00:07:23:78:95:80 Bit Rate:2Mb/s Tx-Power=15 dBm Sensitivity:1/3 Retry min limit:8 RTS thr:off Fragment thr:off Encryption key:xxxxxxxxxxxxxxxxxxxxxxxxxx Security mode:open Power Management:off Link Quality:88/92 Signal level:5/153 Noise level:117/153 Rx invalid nwid:0 Rx invalid crypt:291 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 If you haven't set your interface IP yet, try this: 'ifconfig eth1 10.150.1.171'. Now you'll have to set your routing table up (if you're running two interfaces like I am): root@toshi:~# route add -net 10.150.1.0 netmask 255.255.255.0 dev eth1 root@toshi:~# route add default gw 10.150.1.1 eth1 root@toshi:~# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.150.1.0 * 255.255.255.0 U 0 0 0 eth1 10.150.1.0 * 255.255.255.0 U 0 0 0 eth0 10.0.0.0 * 255.0.0.0 U 0 0 0 eth1 loopback * 255.0.0.0 U 0 0 0 lo default 10.150.1.1 0.0.0.0 UG 0 0 0 eth1 default 10.150.1.1 0.0.0.0 UG 1 0 0 eth0 Lastly, check to see that you can get outside of your local network: root@toshi:~# ping -I eth1 www.unixfool.com PING www.unixfool.com (216.0.115.49) from 10.150.1.171 eth1: 56(84) bytes of data. 64 bytes from www.unixfool.com (216.0.115.49): icmp_seq=1 ttl=240 time=207 ms 64 bytes from www.unixfool.com (216.0.115.49): icmp_seq=2 ttl=240 time=199 ms 64 bytes from www.unixfool.com (216.0.115.49): icmp_seq=3 ttl=240 time=138 ms --- www.unixfool.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2016ms rtt min/avg/max/mdev = 138.879/181.863/207.709/30.605 ms root@toshi:~# I created a script that gets my wifi card online. Because I sometimes use both the wifi card and the integrated ethernet card simultaneously (as you can see in the about routing output), getting them both running is sometimes cumbersome. Usually, I will be online with one of the two interfaces and I'll decide I want to use them both. I'll post the script sometime soon. You can also use 'ping www.unixfool.com' if you've no other interfaces to deal with. Let me know if any of this is faulty and keep in mind that not every system's going to be set up as mine is, so you may still run into problems if you've modified your Slackware setup beyond a fresh install. ______ The below are instructions to get the D-Link DWL-650 (revision M) working with Linux. I've added this because I had difficulty getting this card to work and because, when doing research, noticed that many others had issues with this card. I bought a D-Link DWL-650 without doing extensive research on if it would work with Linux. Since I dual-boot the Toshiba Satellite 1805-S274, I got it to work with Windows XP but not Slackware-current. I tried using Linuxant's product but had little success at the time (early 2004). Yesterday, I did extensive research on this card and its chipset. I utilizes the Atmel chipset. I'd tried using drivers from Atmel's page with little good results so I decided to try ndiswrapper. Tonight, I can attest that ndiswrapper works with this card. I'll document the process here: I downloaded [http://sourceforge.net/projects/ndiswrapper/ ndiswrapper-0.11.tar.gz] and moved the file to /usr/local/src. After moving the file, I ran: tar xvzf ndiswrapper-0.11.tar.gz cd ndiswrapper-0.11 As root, run: make install After compilation, you'll need your Windows driver installed. I got ndis5x-8180(173).zip from [http://www.opendrivers.com/categorycompany/1113/1358/RealTek.html opendrivers.com]. Unzip it using the unzip command: unzip ndis5x-8180(173).zip ndiswrapper -i </path/to/inffile.inf> Example: ndiswrapper -i /usr/local/src/ndis-drivers/net8180.inf Running "ndiswrapper -l" shows the status of the installed driver. In my case, this command shows: root@toshi:/usr/local/src/ndis-drivers# ndiswrapper -l Installed ndis drivers: net8180 driver present, hardware present Next, load the module: modprobe ndiswrapper Now we need to locate the wireless interface: iwconfig You may need to set the IP of the interface (if you like using static IPs): ifconfig wlan0 10.150.1.170 I used "10.150.1.170", as I use the 10.150.0.0 netblock. Use whatever IP is appropriate for your network. Next, run all your "iwconfig" settings. Mine is below: iwconfig wlan0 essid h@m mode auto enc xxxxxxxxxxxxxxxxxxxxx I had to add routes to get my wifi card functional: route add -net 10.150.1.0 netmask 255.255.255.0 dev wlan0 route add default gw 10.150.1.1 wlan0 This concludes my notes for utilizing the D-Link DWL-650, revision M wifi card. Keep in mind that certain revisions use certain chipsets. I couldn't use Prism-based drivers for my card since it uses the Atmel chipset. I've yet to get Atmel's Linux drivers to work, but I may continue to try as a side project. Let me know if you've comments to make this tutorial better. ''This tutorial is a [http://www.unixfool.com/toshiba_notes.html#wifi] mirror '' ''A wifi security perspective is [http://slackfiles.blogspot.com/2006/05/shell-scripting-creation-of-subnet-and.html here] '' --[[User:Unixfool|Ron]] 00:46, 16 September 2007 (EDT) 1ef92fa06230af4a5774672ff3aa58b71abe5866 ZSH 0 180 208 2009-06-06T23:41:54Z Erik 1 Copy from old wikitext text/x-wiki Zsh is one of the most powerfull shells you can get on the face of the planet, and is my favorate ([[Sandman1]]) Now its easier to show you the wonders of zsh with my config below, just copy this and rename it to /.zshrc: * Copy what is in the box below zstyle ':completion:*' completer _complete _correct _approximate zstyle ':completion:*' max-errors 3 numeric zstyle ':completion:*' prompt '>' zstyle :compinstall filename '/home/$USER/.zshrc' autoload -U compinit compinit PS1=$'%{\e[01;32m%}%n@%m:%d%{\e[00m%}> ' autoload -U zfinit #This is for the built in ftp client EMAIL_ADDR="Hi@hi.com" HISTSIZE=50000 HISTFILE="$HOME/.zsh_history" SAVEHIST=50000 setopt APPEND_HISTORY setopt NO_BEEP setopt CD_ABLE_VARS setopt AUTO_CD setopt CORRECT setopt NO_HUP bindkey "\e[1" beginning-of-line bindkey "\e[H" beginning-of-line bindkey "\e[2" transpose-words bindkey "\e[3" delete-char bindkey "\e[4" end-of-line bindkey "\e[F" end-of-line Now you paste this into /.zshrc and restart ZSH. Now you should have a green prompt color:) Now first type: removepkg <tab> With this you will recieve a list of packages you can remove, how cool (might need to be root). Another cool thing about zsh is that you can used the "vared" tool to edit variables, example: vared PATH Now you can see the path variable and you can see that you can edit this and erase an error if you need to. Press enter when you are done editing it. Now speaking on variable editing, you can put variables into the buffer too: print -z $PATH Another great feature that i use everyday is using M-q. (Alt-q basicly), For an example following the follow steps: type "Echo hi" (without quotes) type Alt-q type echo woot and press enter see that the old command was back on the buffer, so you can execute commands before (incase you forgot somthing) Now this is using my config, there is a tool to configure the auto completion stuff so you might want to run these: autoload -U compinit && compinit -U compinstall Now you will have questions to answer about the different tab completion modes. Another cool Zsh thing is the tetris game that you can play! to get to tetris just follow these following steps: autoload -U tetris tetris hit the keys M-x and then type tetris and hit RET. You can do quick math problems on the fly print $(( 2 + 2 )) [[Category:Tutorials]] 47b6e02f737dd65b1565439505e6505040afc0a3 Main Page 0 1 209 171 2009-06-06T23:44:47Z Erik 1 Manual copy of old wiki pages complete. wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 3b4ac0ee8e991072c11078b6521a420f19f8fb73 User:Trashbird1240 2 181 210 2009-06-08T13:37:15Z Trashbird1240 18 user page wikitext text/x-wiki Hello Fellow Slackers, I am a biology Ph.D. student at the University of North Carolina at Chapel Hill. Being a Unix-nut, Slackware was the logical choice for me. See my homepage [http://www.unc.edu/~adamsonj here] . 322f3221ba700dd8e5e1a205f8e545a044dc96c8 EeePC 0 86 211 108 2009-06-09T10:50:54Z Chopp 10 /* Network */ changed driver patch url wikitext text/x-wiki [[Category:Hardware]] == Kernel == === 2.6.24.4 === This is the default kernel that comes with Xandros. It is patched to work with a few things. It's ugly and some of the modules don't work correctly when the kernel is transplanted into Slackware. The source is available from Asus. === 2.6.26.3 === As of writing, 2.6.26.3 is the latest stable kernel. The acpi functionality has been merged into the kernel. but the ethernet and wireless require patching / external code to work === 2.6.27rc5 === As of writing this is still in testing. The ethernet patch is now in-kernel, not requiring a patch. The wireless still requires external code. == 701 == ===Wireless=== The 701 uses the Atheros chipset. Use madwifi-hal-0.10.5.6. *http://madwifi.org/ticket/1192 *http://wiki.eeeuser.com/ubuntu?s=madwifi#wireless_internet_using_native_madwifi_drivers == 901 == ===Network=== The network card uses the atl1e module, which requires a patch for the 2.6.26.3 kernel. as of writing it is slated to be merged into the 2.6.27 kernel. http://www.rootshell.be/~nix4me/EeePC/0001-atl1e-Atheros-L1E-Gigabit-Ethernet-driver.patch <pre>cd /usr/src/linux-2.6.26.3/ patch -p1 < 0001-atl1e-Atheros-L1E-Gigabit-Ethernet-driver.patch</pre> The following instructions have been tested (and work) on a fresh installation of Slackware 12.1 on the EEE 901 running the generic kernel 2.26.24-5-smp: http://www.patch-village.com/2008/oct/23/installing-ubuntu-804-server-asus-p5q/ The kernel source code was installed from the second installation disk (in directory 'k'). ===Wireless=== The wireless uses the rt2860sta module, an open source module from ralink.com. The source code can be downloaded from here: http://www.ralinktech.com/ralink/Home/Support/Linux.html Compiling is straightforward in Slackware 12.1 (see instructions below). It does however require patching to work with the 2.6.26.3 kernel. http://chopp.homelinux.com/EeePC/rt2860sta-patched.tar.gz There are some patches which need to be applied to this source both to get it to work, and to modify the code to the 2.6.26 way of using network devices, namely dev_nd->net is now dev_net(dev). The source above has the patches applied and the code fixed to work with 2.6.26.3 It should work with WPA, but I haven't tested it. <pre> tar -xzf rt2860sta-patched.tar.gz cd 2008_0708_RT2860_Linux_STA_v1.7.0.0 make make install modprobe rt2860sta </pre> ===Sound=== Front Mic does not work out of the box with Slackware 12.1. Compiling Alsa driver 1.0.18 solves this problem. However, doing this seems to remove the USB sound driver (copying back snd-usb-audio.ko resolves it). Be warned that other sound modules are missing after this procedure. This is a useful link: http://wiki.debian.org/DebianEeePC/HowTo/Sound ===ACPI=== The acpi extras require the eeepc_laptop module, kernel config is CONFIG_EEEPC_LAPTOP. In make menuconfig, it is under device drivers -> misc devices, near the bottom. You need to configure /etc/acpi to make acpi act on events. By default nothing happens. /etc/acpi/events/hotkey <pre> event=hotkey ATKD .* action=/etc/acpi/hotkey.sh %e </pre> /etc/acpi/hotkey.sh <pre> #!/bin/sh case $3 in #Fn+F2 #Wireless/Bluetooth button #Fn+F7 00000013) #Mute button amixer set Master toggle ;; #Fn+F8 00000014) #Volume Down amixer set Master 10%- ;; #Fn+F9 00000015) #Volume Up amixer set Master 10%+ ;; esac </pre> ===Camera=== The camera uses uvcvideo module: http://www.slackware.com/~alien/slackbuilds/linux-uvc/ {| border="1" |- ! module ! used by |- | uvcvideo | |- | compat_ioctl32 | uvcvideo |- | videodev | uvcvideo |- | v4l1_compat | uvcvideo,videodev |- | usbcore | uvcvideo |} ===X=== Slack 12.1 uses the same xorg version as the xandros that comes with the 901 linux eee currently. ====xorg.conf==== For the 901, for basic functionality, no configuration of X is required (no xorg.conf). The intel video driver from the 'x' directory of disc 1 is needed. This xorg.conf is a copy of the xandros one with a few changes. It allows you to scroll using two fingers and dragging, and middle click by tapping with two fingers. [[EeePC/xorg.conf|xorg.conf]] ====Touchpad==== http://rlworkman.net/pkgs/ Grab the xf86-input-synaptics package. Need synaptics for the touchpad. ====Battery Display==== gkrellm is a nice little program that can be made to show battery life. It comes with slack 12.1 ====Wireless Configuration==== Wicd works nicely to make connecting to wireless networks easy. http://rlworkman.net/pkgs/ Grab the Wicd package. ==Files== *http://chopp.homelinux.com/EeePC/ *http://www.ksandro.info/ *http://www.ksandro.info/rt2860sta-patched.tar.gz *http://www.ksandro.info/0001-atl1e-Atheros-L1E-Gigabit-Ethernet-driver.patch *http://rlworkman.net/pkgs/ 6fdb65891bea45b8a84fc3ccc1aa28642489eb9f 212 211 2009-06-09T10:53:30Z Chopp 10 /* Wireless */ changed patched driver url wikitext text/x-wiki [[Category:Hardware]] == Kernel == === 2.6.24.4 === This is the default kernel that comes with Xandros. It is patched to work with a few things. It's ugly and some of the modules don't work correctly when the kernel is transplanted into Slackware. The source is available from Asus. === 2.6.26.3 === As of writing, 2.6.26.3 is the latest stable kernel. The acpi functionality has been merged into the kernel. but the ethernet and wireless require patching / external code to work === 2.6.27rc5 === As of writing this is still in testing. The ethernet patch is now in-kernel, not requiring a patch. The wireless still requires external code. == 701 == ===Wireless=== The 701 uses the Atheros chipset. Use madwifi-hal-0.10.5.6. *http://madwifi.org/ticket/1192 *http://wiki.eeeuser.com/ubuntu?s=madwifi#wireless_internet_using_native_madwifi_drivers == 901 == ===Network=== The network card uses the atl1e module, which requires a patch for the 2.6.26.3 kernel. as of writing it is slated to be merged into the 2.6.27 kernel. http://www.rootshell.be/~nix4me/EeePC/0001-atl1e-Atheros-L1E-Gigabit-Ethernet-driver.patch <pre>cd /usr/src/linux-2.6.26.3/ patch -p1 < 0001-atl1e-Atheros-L1E-Gigabit-Ethernet-driver.patch</pre> The following instructions have been tested (and work) on a fresh installation of Slackware 12.1 on the EEE 901 running the generic kernel 2.26.24-5-smp: http://www.patch-village.com/2008/oct/23/installing-ubuntu-804-server-asus-p5q/ The kernel source code was installed from the second installation disk (in directory 'k'). ===Wireless=== The wireless uses the rt2860sta module, an open source module from ralink.com. The source code can be downloaded from here: http://www.ralinktech.com/ralink/Home/Support/Linux.html Compiling is straightforward in Slackware 12.1 (see instructions below). It does however require patching to work with the 2.6.26.3 kernel. http://www.rootshell.be/~nix4me/EeePC/rt2860sta-patched.tar.gz There are some patches which need to be applied to this source both to get it to work, and to modify the code to the 2.6.26 way of using network devices, namely dev_nd->net is now dev_net(dev). The source above has the patches applied and the code fixed to work with 2.6.26.3 It should work with WPA, but I haven't tested it. <pre> tar -xzf rt2860sta-patched.tar.gz cd 2008_0708_RT2860_Linux_STA_v1.7.0.0 make make install modprobe rt2860sta </pre> ===Sound=== Front Mic does not work out of the box with Slackware 12.1. Compiling Alsa driver 1.0.18 solves this problem. However, doing this seems to remove the USB sound driver (copying back snd-usb-audio.ko resolves it). Be warned that other sound modules are missing after this procedure. This is a useful link: http://wiki.debian.org/DebianEeePC/HowTo/Sound ===ACPI=== The acpi extras require the eeepc_laptop module, kernel config is CONFIG_EEEPC_LAPTOP. In make menuconfig, it is under device drivers -> misc devices, near the bottom. You need to configure /etc/acpi to make acpi act on events. By default nothing happens. /etc/acpi/events/hotkey <pre> event=hotkey ATKD .* action=/etc/acpi/hotkey.sh %e </pre> /etc/acpi/hotkey.sh <pre> #!/bin/sh case $3 in #Fn+F2 #Wireless/Bluetooth button #Fn+F7 00000013) #Mute button amixer set Master toggle ;; #Fn+F8 00000014) #Volume Down amixer set Master 10%- ;; #Fn+F9 00000015) #Volume Up amixer set Master 10%+ ;; esac </pre> ===Camera=== The camera uses uvcvideo module: http://www.slackware.com/~alien/slackbuilds/linux-uvc/ {| border="1" |- ! module ! used by |- | uvcvideo | |- | compat_ioctl32 | uvcvideo |- | videodev | uvcvideo |- | v4l1_compat | uvcvideo,videodev |- | usbcore | uvcvideo |} ===X=== Slack 12.1 uses the same xorg version as the xandros that comes with the 901 linux eee currently. ====xorg.conf==== For the 901, for basic functionality, no configuration of X is required (no xorg.conf). The intel video driver from the 'x' directory of disc 1 is needed. This xorg.conf is a copy of the xandros one with a few changes. It allows you to scroll using two fingers and dragging, and middle click by tapping with two fingers. [[EeePC/xorg.conf|xorg.conf]] ====Touchpad==== http://rlworkman.net/pkgs/ Grab the xf86-input-synaptics package. Need synaptics for the touchpad. ====Battery Display==== gkrellm is a nice little program that can be made to show battery life. It comes with slack 12.1 ====Wireless Configuration==== Wicd works nicely to make connecting to wireless networks easy. http://rlworkman.net/pkgs/ Grab the Wicd package. ==Files== *http://chopp.homelinux.com/EeePC/ *http://www.ksandro.info/ *http://www.ksandro.info/rt2860sta-patched.tar.gz *http://www.ksandro.info/0001-atl1e-Atheros-L1E-Gigabit-Ethernet-driver.patch *http://rlworkman.net/pkgs/ b07de0c1ef10c3b5c55e936b6215aea33c7ef54b 213 212 2009-06-09T11:32:52Z Chopp 10 /* Files */ updated a Files url wikitext text/x-wiki [[Category:Hardware]] == Kernel == === 2.6.24.4 === This is the default kernel that comes with Xandros. It is patched to work with a few things. It's ugly and some of the modules don't work correctly when the kernel is transplanted into Slackware. The source is available from Asus. === 2.6.26.3 === As of writing, 2.6.26.3 is the latest stable kernel. The acpi functionality has been merged into the kernel. but the ethernet and wireless require patching / external code to work === 2.6.27rc5 === As of writing this is still in testing. The ethernet patch is now in-kernel, not requiring a patch. The wireless still requires external code. == 701 == ===Wireless=== The 701 uses the Atheros chipset. Use madwifi-hal-0.10.5.6. *http://madwifi.org/ticket/1192 *http://wiki.eeeuser.com/ubuntu?s=madwifi#wireless_internet_using_native_madwifi_drivers == 901 == ===Network=== The network card uses the atl1e module, which requires a patch for the 2.6.26.3 kernel. as of writing it is slated to be merged into the 2.6.27 kernel. http://www.rootshell.be/~nix4me/EeePC/0001-atl1e-Atheros-L1E-Gigabit-Ethernet-driver.patch <pre>cd /usr/src/linux-2.6.26.3/ patch -p1 < 0001-atl1e-Atheros-L1E-Gigabit-Ethernet-driver.patch</pre> The following instructions have been tested (and work) on a fresh installation of Slackware 12.1 on the EEE 901 running the generic kernel 2.26.24-5-smp: http://www.patch-village.com/2008/oct/23/installing-ubuntu-804-server-asus-p5q/ The kernel source code was installed from the second installation disk (in directory 'k'). ===Wireless=== The wireless uses the rt2860sta module, an open source module from ralink.com. The source code can be downloaded from here: http://www.ralinktech.com/ralink/Home/Support/Linux.html Compiling is straightforward in Slackware 12.1 (see instructions below). It does however require patching to work with the 2.6.26.3 kernel. http://www.rootshell.be/~nix4me/EeePC/rt2860sta-patched.tar.gz There are some patches which need to be applied to this source both to get it to work, and to modify the code to the 2.6.26 way of using network devices, namely dev_nd->net is now dev_net(dev). The source above has the patches applied and the code fixed to work with 2.6.26.3 It should work with WPA, but I haven't tested it. <pre> tar -xzf rt2860sta-patched.tar.gz cd 2008_0708_RT2860_Linux_STA_v1.7.0.0 make make install modprobe rt2860sta </pre> ===Sound=== Front Mic does not work out of the box with Slackware 12.1. Compiling Alsa driver 1.0.18 solves this problem. However, doing this seems to remove the USB sound driver (copying back snd-usb-audio.ko resolves it). Be warned that other sound modules are missing after this procedure. This is a useful link: http://wiki.debian.org/DebianEeePC/HowTo/Sound ===ACPI=== The acpi extras require the eeepc_laptop module, kernel config is CONFIG_EEEPC_LAPTOP. In make menuconfig, it is under device drivers -> misc devices, near the bottom. You need to configure /etc/acpi to make acpi act on events. By default nothing happens. /etc/acpi/events/hotkey <pre> event=hotkey ATKD .* action=/etc/acpi/hotkey.sh %e </pre> /etc/acpi/hotkey.sh <pre> #!/bin/sh case $3 in #Fn+F2 #Wireless/Bluetooth button #Fn+F7 00000013) #Mute button amixer set Master toggle ;; #Fn+F8 00000014) #Volume Down amixer set Master 10%- ;; #Fn+F9 00000015) #Volume Up amixer set Master 10%+ ;; esac </pre> ===Camera=== The camera uses uvcvideo module: http://www.slackware.com/~alien/slackbuilds/linux-uvc/ {| border="1" |- ! module ! used by |- | uvcvideo | |- | compat_ioctl32 | uvcvideo |- | videodev | uvcvideo |- | v4l1_compat | uvcvideo,videodev |- | usbcore | uvcvideo |} ===X=== Slack 12.1 uses the same xorg version as the xandros that comes with the 901 linux eee currently. ====xorg.conf==== For the 901, for basic functionality, no configuration of X is required (no xorg.conf). The intel video driver from the 'x' directory of disc 1 is needed. This xorg.conf is a copy of the xandros one with a few changes. It allows you to scroll using two fingers and dragging, and middle click by tapping with two fingers. [[EeePC/xorg.conf|xorg.conf]] ====Touchpad==== http://rlworkman.net/pkgs/ Grab the xf86-input-synaptics package. Need synaptics for the touchpad. ====Battery Display==== gkrellm is a nice little program that can be made to show battery life. It comes with slack 12.1 ====Wireless Configuration==== Wicd works nicely to make connecting to wireless networks easy. http://rlworkman.net/pkgs/ Grab the Wicd package. ==Files== *http://www.rootshell.be/~nix4me/EeePC/ *http://www.ksandro.info/ *http://www.ksandro.info/rt2860sta-patched.tar.gz *http://www.ksandro.info/0001-atl1e-Atheros-L1E-Gigabit-Ethernet-driver.patch *http://rlworkman.net/pkgs/ 2dc1da276434c2b64303667a57e715dece3ad7aa Forced Fsck 0 92 214 114 2009-06-23T20:29:14Z RobRistroph 23 /* Bypassing A Hung Forced Fsck */ wikitext text/x-wiki [[Category:Tips]] A Forced Fsck (forced file check) happens on boot up due to one of three things: :1) The system was not cleanly shutdown previously (you just turned off the power) and the file system was not cleanly un-mounted. :2) The maximum number of sucessive re-boots (re-mounts ([[Mount Count|mount count]])) between fsck checks has been reached (you have reached [[Maximum Mount Count]]). :3) A period of time has passed between fscks that exceed the filesystem's last checked criteria. ==Manually Forcing a Forced Fsck== To force a check on the next boot, simply create the file '/etc/forcefsck' and reboot: :<code>touch /etc/forcefsck</code> ==Bypassing A Forced Fsck== <b>METHOD 1: Increase the Mount Count/Last-checked time span-</b><br> The only way to bypass a Forced Fsck is to boot the machine from another boot medium (e.g. a boot CD) and use <code>tune2fs</code> to increase the Maximum Mount Count or the Last-checked Time span. To increase the Maximum Mount Count: <code>tune2fs -c <i>new_mount_count filesystem</i></code><br> EXAMPLE: <code>tune2fs -c 50 /dev/hda1</code> - This will cause a fsck after 50 re-mounts. To increase the Last-checked Time span: <code>tune2fs -i <i>new_time_span filesystem</i></code><br> EXAMPLE: <code>tune2fs -i 3m /dev/hda1</code> - This will cause a fsck after 3 months. <b>GOTCHA:</b> If you are running a RAID Array, make sure you load a kernel image that supports RAID when booting! See the RAID Array tips. <b>METHOD 2: Manually run fsck-</b><br> See <i>Bypassing A Hung Forced Fsck</i> instructions below. ==Bypassing A Hung Forced Fsck== Sometimes, a forced fsck will occur and may not complete. It may hang or just keep starting over. To (down and dirty) fix this, boot the machine from a bootable disk (3.5" or CD), DO NOT mount the unchecked filesystem and manually run fsck. You may have to run any one of three modes to complete the check:<br> ::<code>fsck -f <i>filesystem</i></code> - Force checking even if the file system seems clean.<br> ::<code>fsck -c <i>filesystem</i></code> - This option causes e2fsck to run the badblocks program to find any blocks which are bad on the filesystem, and then marks them as bad by adding them to the bad block inode. If this option is specified twice, then the bad block scan will be done using a non-destructive read-write test. Be aware that this takes a long time, such as days on large disk with the the double -c set, but it does tend to fix problematic disks when it does complete.<br> ::<code>fsck -p <i>filesystem</i></code> - Automatically repair ("preen") the file system without any questions.<br> :::<b>NOTE: <code><i>filesystem</i></code> = boot partition (e.g. <code>/dev/hda1</code>)</b> <b>GOTCHA:</b> If you are running a RAID Array, make sure you load a kernel image that supports RAID when booting! See the [[RAID_Array_%28Hardware%29|RAID Array tips]]. After a successful completion of anyone of the above, your filesystem's [[Mount Count|mount count]] will be reset to zero and you should be able to boot normally again. d675eb21f50bc6b4a7061585ea369d88f51e5c77 Zip 2GB Limit 0 182 215 2009-06-23T21:55:02Z RobRistroph 23 Created page with '[[Catagory:Tips]] On some SlackWare versions, up to at least 12.0, the "unzip" command cannot unpack a file that is bigger than 2 GB. This applies to the file that is created ...' wikitext text/x-wiki [[Catagory:Tips]] On some SlackWare versions, up to at least 12.0, the "unzip" command cannot unpack a file that is bigger than 2 GB. This applies to the file that is created being 2 GB, the .zip compressed file might be less than 2 GB. When the unzip command attempts to create the greater than 2 GB file, it makes the file up until it is 2 GB, and then produces this error message (PROP_ENT.TXT is the file that is bigger than 2 GB in this case) : <pre> PROP_ENT.TXT: write error (disk full?). Continue? (y/n/^C) y </pre> This procedure will update the unzip command to fix this. It may also fix problems in creating a .zip file that is bigger than 2 GB, but I have not been able to test that. With these commands I retrieved the source package and unpacked the source trees: <pre> mkdir infozip cd infozip wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/infozip.SlackBuild wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/slack-desc wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/unzip552.tar.bz2 wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/zip232.tar.bz2 tar xjvf unzip552.tar.bz2 tar xjvf zip232.tar.bz2 </pre> I next modified the Makefiles in the two source trees to use the flags "-DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" as described here: http://www.info-zip.org/FAQ.html#limits To do that, I edited the file unzip-5.52/unix/Makefile and changed line 50 from "CF = -O -I. -DUNIX $(LOC)" to "CF = -O -I. -DUNIX $(LOC) -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64". I then editted zip-2.32/unix/Makefile and changed line 49 from "CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP)" to "CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP) -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" . The second Makefile edit might not be necessary, it should fix any problems you are having with the "zip" command (the first Makefile fixes problems with the "unzip" command). After editing those files, I re-tarred up the directories with the now fixed Makefiles, and then removed the source trees: <pre> tar cjvf unzip552.tar.bz2 unzip-5.52/ tar cjvf zip232.tar.bz2 zip-2.32/ rm -rf unzip-5.52/ zip-2.32/ </pre> I then ran the SlackBuild to make the package: <pre> chmod a+x infozip.SlackBuild ./infozip.SlackBuild </pre> At this point the slackware package will be in /tmp/infozip-5.52-i486-2.tgz. You might wish to copy it somewhere if you are going to install it on a number of computers or save it. You can install it with "installpkg /tmp/infozip-5.52-i486-2.tgz" like a normal package. If someone knows this is fixed in recent SlackWare versions, or has uploaded a precompiled package somewhere, please update this wiki. 51fe8089e0d0faa71cc35fb7aa6877e4bd105fe7 216 215 2009-06-23T21:57:08Z RobRistroph 23 wikitext text/x-wiki [[Catagory:Tips]] == Fixing the 2GB file size limit in unzip == On some SlackWare versions, up to at least 12.0, the "unzip" command cannot unpack a file that is bigger than 2 GB. This applies to the file that is created being 2 GB, the .zip compressed file might be less than 2 GB. When the unzip command attempts to create the greater than 2 GB file, it makes the file up until it is 2 GB, and then produces this error message (PROP_ENT.TXT is the file that is bigger than 2 GB in this case) : <pre> PROP_ENT.TXT: write error (disk full?). Continue? (y/n/^C) y </pre> This procedure will update the unzip command to fix this. It may also fix problems in creating a .zip file that is bigger than 2 GB, but I have not been able to test that. With these commands I retrieved the source package and unpacked the source trees: <pre> mkdir infozip cd infozip wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/infozip.SlackBuild wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/slack-desc wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/unzip552.tar.bz2 wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/zip232.tar.bz2 tar xjvf unzip552.tar.bz2 tar xjvf zip232.tar.bz2 </pre> I next modified the Makefiles in the two source trees to use the flags "-DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" as described here: http://www.info-zip.org/FAQ.html#limits To do that, I edited the file unzip-5.52/unix/Makefile and changed line 50 from "CF = -O -I. -DUNIX $(LOC)" to "CF = -O -I. -DUNIX $(LOC) -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64". I then editted zip-2.32/unix/Makefile and changed line 49 from "CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP)" to "CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP) -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" . The second Makefile edit might not be necessary, it should fix any problems you are having with the "zip" command (the first Makefile fixes problems with the "unzip" command). After editing those files, I re-tarred up the directories with the now fixed Makefiles, and then removed the source trees: <pre> tar cjvf unzip552.tar.bz2 unzip-5.52/ tar cjvf zip232.tar.bz2 zip-2.32/ rm -rf unzip-5.52/ zip-2.32/ </pre> I then ran the SlackBuild to make the package: <pre> chmod a+x infozip.SlackBuild ./infozip.SlackBuild </pre> At this point the slackware package will be in /tmp/infozip-5.52-i486-2.tgz. You might wish to copy it somewhere if you are going to install it on a number of computers or save it. You can install it with "installpkg /tmp/infozip-5.52-i486-2.tgz" like a normal package. If someone knows this is fixed in recent SlackWare versions, or has uploaded a precompiled package somewhere, please update this wiki. 82e611ee0851b8c6d2d8be6d4aaafd52b178e35b 217 216 2009-06-24T05:37:35Z RobRistroph 23 /* Fixing the 2GB file size limit in unzip */ wikitext text/x-wiki [[Catagory:Tips]] == Fixing the 2GB file size limit in unzip == On some SlackWare versions, up to at least 12.0, the "unzip" command cannot unpack a file that is bigger than 2 GB. This applies to the file that is created being 2 GB, the .zip compressed file might be less than 2 GB. When the unzip command attempts to create the greater than 2 GB file, it makes the file up until it is 2 GB, and then produces this error message (PROP_ENT.TXT is the file that is bigger than 2 GB in this case) : <pre> PROP_ENT.TXT: write error (disk full?). Continue? (y/n/^C) y </pre> This procedure will update the unzip command to fix this. It may also fix problems in creating a .zip file that is bigger than 2 GB, but I have not been able to test that. With these commands I retrieved the source package and unpacked the source trees: <pre> mkdir infozip cd infozip wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/infozip.SlackBuild wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/slack-desc wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/unzip552.tar.bz2 wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/zip232.tar.bz2 tar xjvf unzip552.tar.bz2 tar xjvf zip232.tar.bz2 </pre> I next modified the Makefiles in the two source trees to use the flags "-DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" as described here: http://www.info-zip.org/FAQ.html#limits To do that, I edited the file unzip-5.52/unix/Makefile and changed line 776 from "<nowiki>CF="-O3 -Wall -I. -DASM_CRC $(LOC)"</nowiki>" to "<nowiki>CF="-O3 -Wall -I. -DASM_CRC $(LOC) -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"</nowiki>". I then editted zip-2.32/unix/Makefile and changed line 49 from "CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP)" to "CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP) -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" . The second Makefile edit might not be necessary, it should fix any problems you are having with the "zip" command (the first Makefile fixes problems with the "unzip" command). After editing those files, I re-tarred up the directories with the now fixed Makefiles, and then removed the source trees: <pre> tar cjvf unzip552.tar.bz2 unzip-5.52/ tar cjvf zip232.tar.bz2 zip-2.32/ rm -rf unzip-5.52/ zip-2.32/ </pre> I then ran the SlackBuild to make the package: <pre> chmod a+x infozip.SlackBuild ./infozip.SlackBuild </pre> At this point the slackware package will be in /tmp/infozip-5.52-i486-2.tgz. You might wish to copy it somewhere if you are going to install it on a number of computers or save it. You can install it with "installpkg /tmp/infozip-5.52-i486-2.tgz" like a normal package. If someone knows this is fixed in recent SlackWare versions, or has uploaded a precompiled package somewhere, please update this wiki. ac065e580cdb4d0f72e8c9bfa6a133161530c47b 218 217 2009-06-24T05:39:32Z RobRistroph 23 wikitext text/x-wiki [[Category:Tips]] == Fixing the 2GB file size limit in unzip == On some SlackWare versions, up to at least 12.0, the "unzip" command cannot unpack a file that is bigger than 2 GB. This applies to the file that is created being 2 GB, the .zip compressed file might be less than 2 GB. When the unzip command attempts to create the greater than 2 GB file, it makes the file up until it is 2 GB, and then produces this error message (PROP_ENT.TXT is the file that is bigger than 2 GB in this case) : <pre> PROP_ENT.TXT: write error (disk full?). Continue? (y/n/^C) y </pre> This procedure will update the unzip command to fix this. It may also fix problems in creating a .zip file that is bigger than 2 GB, but I have not been able to test that. With these commands I retrieved the source package and unpacked the source trees: <pre> mkdir infozip cd infozip wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/infozip.SlackBuild wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/slack-desc wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/unzip552.tar.bz2 wget ftp://slackware.cs.utah.edu/pub/slackware/slackware-12.0/source/a/infozip/zip232.tar.bz2 tar xjvf unzip552.tar.bz2 tar xjvf zip232.tar.bz2 </pre> I next modified the Makefiles in the two source trees to use the flags "-DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" as described here: http://www.info-zip.org/FAQ.html#limits To do that, I edited the file unzip-5.52/unix/Makefile and changed line 776 from "<nowiki>CF="-O3 -Wall -I. -DASM_CRC $(LOC)"</nowiki>" to "<nowiki>CF="-O3 -Wall -I. -DASM_CRC $(LOC) -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"</nowiki>". I then editted zip-2.32/unix/Makefile and changed line 49 from "CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP)" to "CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP) -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" . The second Makefile edit might not be necessary, it should fix any problems you are having with the "zip" command (the first Makefile fixes problems with the "unzip" command). After editing those files, I re-tarred up the directories with the now fixed Makefiles, and then removed the source trees: <pre> tar cjvf unzip552.tar.bz2 unzip-5.52/ tar cjvf zip232.tar.bz2 zip-2.32/ rm -rf unzip-5.52/ zip-2.32/ </pre> I then ran the SlackBuild to make the package: <pre> chmod a+x infozip.SlackBuild ./infozip.SlackBuild </pre> At this point the slackware package will be in /tmp/infozip-5.52-i486-2.tgz. You might wish to copy it somewhere if you are going to install it on a number of computers or save it. You can install it with "installpkg /tmp/infozip-5.52-i486-2.tgz" like a normal package. If someone knows this is fixed in recent SlackWare versions, or has uploaded a precompiled package somewhere, please update this wiki. ed4ca597fd364e6f681c977e7794f636710e499b Dependency Discovery 0 183 219 2009-07-08T13:12:27Z Gabim 27 Created page with '[[Category:Information]] [[Category:Tutorials]] == Introduction == "Slackware users typically prefer their method of manual dependency resolution, citing the level of system c...' wikitext text/x-wiki [[Category:Information]] [[Category:Tutorials]] == Introduction == "Slackware users typically prefer their method of manual dependency resolution, citing the level of system control it grants them." - as the [http://wiki.archlinux.org/index.php/Arch_Compared_To_Other_Distros#Arch_vs_Slackware ArchWiki] says. This total control over the system is one of the main strength of the Slackware distribution. If the administrator of the system knows every package on the system and ensures their every dependencies, then the system is stable, well usable. If the administrator installs a new, (until now) unknown application, then he/she needs to discover its dependencies via the attached README or documentations, or from starting the application (if something is not installed on the system, then the application won't start). == Dependency resolution at package installation == The dependency resolution can be performed at package installation, if we use a third party package manager, see [[Third_Party_Package_Managers]]. This is very easy, but we should use that third party package manager and maybe we don't want to do it just for a simple package installation. We would like a more Slackware like solution. == Dependency discovery as a separate task == We can discover the dependencies of our system in separate task using the '<code>ldd</code>' command. This is not third party application, it is the part of our system. We can scan the binaries in our PATH: #!/bin/bash ECHO=/usr/bin/echo SED=/usr/bin/sed FILE=/usr/bin/file CUT=/usr/bin/cut LDD=/usr/bin/ldd GREP=/usr/bin/grep AWK=/usr/bin/awk for p in `$ECHO $PATH | $SED 's/:/ /g'` do for f in $p/* do if [ 'ELF' == `$FILE -b $f | $CUT -d' ' -f1` ]; then if $LDD $f | $GREP -q 'not found'; then $ECHO "$f" $LDD $f | $GREP 'not found' | $AWK '{print "Not found:", $1}' fi fi done done Or, we can print the missing package names instead of the missing library names, so we have to install only the given packages mentioned by this script (I used the concatenated MANIFEST file of '<code>slackpkg</code>' on Slackware64, this file list is more friendlier for scripting): #!/bin/bash # This is the concatenated MANIFEST file of slackpkg on Slackware64 MANIFEST=/var/lib/slackpkg/slackware64-filelist.gz # Do not trust in any command in PATH, shell builtins, etc. ECHO=/usr/bin/echo PRINTF=/usr/bin/printf CUT=/usr/bin/cut SORT=/usr/bin/sort GREP=/usr/bin/grep ZGREP=/usr/bin/zgrep SED=/usr/bin/sed AWK=/usr/bin/awk FILE=/usr/bin/file LDD=/usr/bin/ldd NULL=/dev/null # Check all directories in PATH for directory in `$ECHO $PATH | $SED 's/:/ /g'` do # Check all binaries in PATH directories for binary in $directory/* do # If it is true ELF binary if [ 'ELF' == `$FILE -b $binary | $CUT -d' ' -f1` ]; then # Show the progress by printing of actual filename on standard error $PRINTF "%-70s\r" $binary >&2 # Check the missing shared library dependencies $LDD $binary 2>$NULL | $GREP 'not found' | $AWK '{print $1}' | while read missing_lib do # Print the package name of the missing library $ZGREP $missing_lib $MANIFEST | $AWK '{print $1}' done fi done # Clear the progress info $PRINTF "%-80s\r" "" >&2 # Ignore the duplicated package names done | $SORT -u If we would like to scan the binaries of the PATH and the shared libraries of our system, then we need a deeper directory discovery: #!/bin/bash # This is the concatenated MANIFEST file of slackpkg on Slackware64 MANIFEST=/var/lib/slackpkg/slackware64-filelist.gz # Do not trust in any command in PATH, shell builtins, etc. SYSPATH=$PATH PATH=/bin:/usr/bin:/usr/sbin ECHO=/usr/bin/echo PRINTF=/usr/bin/printf # Check all directories in PATH and ld.so.conf # If it is true ELF binary find `$ECHO $SYSPATH | sed 's/:/ /g'` \ `sed 's/\(\/.*\/.*\)\/.*/\1/' /etc/ld.so.conf | sort -u` \ -perm -100 -a -type f \ -exec sh -c 'filename="{}"; /usr/bin/echo -n "." >&2; \ [ "ELF" = `file -b $filename | cut -d" " -f1` ] && \ ldd $filename 2>/dev/null | fgrep "not found" \ | cut -d" " -f1' \; | while read missing_lib do # Print the missing library and its package name $ECHO $missing_lib ": `zgrep $missing_lib $MANIFEST | cut -d" " -f1`" done | sort -u This small script will browse huge amount of directories and will scan a lot of ELF binaries, so it can run for a long time. There are more effective ways of the dependency discovery, this is only a very simple solution for a natural system administrator need. It demonstrates that a Slackware user does not need a package manager with dependency resolution, but even so can have a stable, well configured system. 48d9d81b7225e7b3a975215a8f953513c4dd0476 220 219 2009-07-08T13:32:56Z Gabim 27 wikitext text/x-wiki [[Category:Tips]] == Introduction == "Slackware users typically prefer their method of manual dependency resolution, citing the level of system control it grants them." - as the [http://wiki.archlinux.org/index.php/Arch_Compared_To_Other_Distros#Arch_vs_Slackware ArchWiki] says. This total control over the system is one of the main strength of the Slackware distribution. If the administrator of the system knows every package on the system and ensures their every dependencies, then the system is stable, well usable. If the administrator installs a new, (until now) unknown application, then he/she needs to discover its dependencies via the attached README or documentations, or from starting the application (if something is not installed on the system, then the application won't start). == Dependency resolution at package installation == The dependency resolution can be performed at package installation, if we use a third party package manager, see [[Third_Party_Package_Managers]]. This is very easy, but we should use that third party package manager and maybe we don't want to do it just for a simple package installation. We would like a more Slackware like solution. == Dependency discovery as a separate task == We can discover the dependencies of our system in separate task using the '<code>ldd</code>' command. This is not third party application, it is the part of our system. We can scan the binaries in our PATH: #!/bin/bash ECHO=/usr/bin/echo SED=/usr/bin/sed FILE=/usr/bin/file CUT=/usr/bin/cut LDD=/usr/bin/ldd GREP=/usr/bin/grep AWK=/usr/bin/awk for p in `$ECHO $PATH | $SED 's/:/ /g'` do for f in $p/* do if [ 'ELF' == `$FILE -b $f | $CUT -d' ' -f1` ]; then if $LDD $f | $GREP -q 'not found'; then $ECHO "$f" $LDD $f | $GREP 'not found' | $AWK '{print "Not found:", $1}' fi fi done done Or, we can print the missing package names instead of the missing library names, so we have to install only the given packages mentioned by this script (I used the concatenated MANIFEST file of '<code>slackpkg</code>' on Slackware64, this file list is more friendlier for scripting): #!/bin/bash # This is the concatenated MANIFEST file of slackpkg on Slackware64 MANIFEST=/var/lib/slackpkg/slackware64-filelist.gz # Do not trust in any command in PATH, shell builtins, etc. ECHO=/usr/bin/echo PRINTF=/usr/bin/printf CUT=/usr/bin/cut SORT=/usr/bin/sort GREP=/usr/bin/grep ZGREP=/usr/bin/zgrep SED=/usr/bin/sed AWK=/usr/bin/awk FILE=/usr/bin/file LDD=/usr/bin/ldd NULL=/dev/null # Check all directories in PATH for directory in `$ECHO $PATH | $SED 's/:/ /g'` do # Check all binaries in PATH directories for binary in $directory/* do # If it is true ELF binary if [ 'ELF' == `$FILE -b $binary | $CUT -d' ' -f1` ]; then # Show the progress by printing of actual filename on standard error $PRINTF "%-70s\r" $binary >&2 # Check the missing shared library dependencies $LDD $binary 2>$NULL | $GREP 'not found' | $AWK '{print $1}' | while read missing_lib do # Print the package name of the missing library $ZGREP $missing_lib $MANIFEST | $AWK '{print $1}' done fi done # Clear the progress info $PRINTF "%-80s\r" "" >&2 # Ignore the duplicated package names done | $SORT -u If we would like to scan the binaries of the PATH and the shared libraries of our system, then we need a deeper directory discovery: #!/bin/bash # This is the concatenated MANIFEST file of slackpkg on Slackware64 MANIFEST=/var/lib/slackpkg/slackware64-filelist.gz # Do not trust in any command in PATH, shell builtins, etc. SYSPATH=$PATH PATH=/bin:/usr/bin:/usr/sbin ECHO=/usr/bin/echo PRINTF=/usr/bin/printf # Check all directories in PATH and ld.so.conf # If it is true ELF binary find `$ECHO $SYSPATH | sed 's/:/ /g'` \ `sed 's/\(\/.*\/.*\)\/.*/\1/' /etc/ld.so.conf | sort -u` \ -perm -100 -a -type f \ -exec sh -c 'filename="{}"; /usr/bin/echo -n "." >&2; \ [ "ELF" = `file -b $filename | cut -d" " -f1` ] && \ ldd $filename 2>/dev/null | fgrep "not found" \ | cut -d" " -f1' \; | while read missing_lib do # Print the missing library and its package name $ECHO $missing_lib ": `zgrep $missing_lib $MANIFEST | cut -d" " -f1`" done | sort -u This small script will browse huge amount of directories and will scan a lot of ELF binaries, so it can run for a long time. There are more effective ways of the dependency discovery, this is only a very simple solution for a natural system administrator need. It demonstrates that a Slackware user does not need a package manager with dependency resolution, but even so can have a stable, well configured system. 1093f8c82682b83ffa0425112d7b300d2eb6c91e Links 0 3 221 54 2009-07-08T13:57:13Z Gabim 27 /* Slackware Links */ wikitext text/x-wiki [[Category:Information]] ==Slackware Links== * http://www.slackware.com - the home of Slackware * http://www.slackwaregallery.org - our ugly mugs :) * http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ - Slackware FAQ by [[User:juhl|juhl]] (Jesper Juhl) * http://slackware.wordpress.com - Slackware Blog by [[User:Tyler|Tyler]] * http://www.slackbook.org - updated version of the slackware book * http://userlocal.com/ - A focal point for the online Slackware Linux community * http://www.slackware.com/getslack - Extensive listing of Slackware mirrors * http://www.slackbasics.org/ - "Slackware Linux Basics" by Daniel de Kok * http://www.linuxquestions.org/questions/slackware-14/ - Slackware forum * http://www.kde-look.org/content/show.php?content=23384 - Slack-Track - a superkaramba theme to track the slackware-current changelog on your desktop, created by [[User:omal|omal]] * http://www.slacklife.com.br - Slackware Brazillian Community - by [[User:Redhate|redhate]] * http://slackware.linux.or.id - Indonesian Slackware Community - by [[User:Willysr|Willysr]] * http://open-eslack.org/ - Spanish Slackware community * http://sbopkg.org - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository * http://slackbot.sourceforge.net - Buildsystem and buildtools for Slackware ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==Free packages== * [http://slackware.com/~alien/ http://slackware.com/~alien/] Eric Hameleers' packages * [http://rlworkman.net/pkgs/ http://rlworkman.net/pkgs/] rworkman's packages * http://www.linuxpackages.net/ * [http://www.slacky.eu/repository/slackware-11.0/ Slacky.eu] Italian Slackware site * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware * [http://scxd.info/en/ Slackware Current eXtended Desktop] Packages for Slackware Current ==.SlackBuild Repositories== * http://slackbuilds.org - The SlackBuilds.org Project * http://slackbuilds.net - The French SlackBuilds Repository * http://www.slackware.com/~alien/slackbuilds/ - Eric "Alien" Hameleer's SlackBuilds * http://slackbuild.strangeworlds.co.uk - cathectic's SlackBuilds * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. * http://scxd.info/pub/slackbuilds/ - Slackware Current eXtended Desktop's SlackBuilds ==Live CD's based on Slackware== * [http://www.remote-exploit.org/ BackTrack] The result of the merging of two Innovative Penetration Testing live Linux distributions: Whax and Auditor * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://alien.slackbook.org/ Alien Bob's Wiki] * http://open-eslack.org/wiki/ - Wiki of the Slackware spanish community * http://slackware.linux.or.id/wiki/ - Indonesian Slackware Wiki ==RSS Feeds== * http://dev.slackware.it/rss/ - RSS feeds for stable Slackware release and -current ChangeLog * http://slackbuilds.org/mirror/rss/ - ChangeLog RSS feeds for 8.1 through -current bbf5e74621054e565d0aaefe3bc44bff7cf31ed2 242 221 2009-08-24T14:20:43Z Aaarnt 37 /* Slackware Links */ wikitext text/x-wiki [[Category:Information]] ==Slackware Links== * http://www.slackware.com - the home of Slackware * http://www.slackwaregallery.org - our ugly mugs :) * http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ - Slackware FAQ by [[User:juhl|juhl]] (Jesper Juhl) * http://slackware.wordpress.com - Slackware Blog by [[User:Tyler|Tyler]] * http://www.slackbook.org - updated version of the slackware book * http://userlocal.com/ - A focal point for the online Slackware Linux community * http://www.slackware.com/getslack - Extensive listing of Slackware mirrors * http://www.slackbasics.org/ - "Slackware Linux Basics" by Daniel de Kok * http://www.linuxquestions.org/questions/slackware-14/ - Slackware forum * http://www.kde-look.org/content/show.php?content=23384 - Slack-Track - a superkaramba theme to track the slackware-current changelog on your desktop, created by [[User:omal|omal]] * http://www.slacklife.com.br - Slackware Brazillian Community - by [[User:Redhate|redhate]] * http://slackware.linux.or.id - Indonesian Slackware Community - by [[User:Willysr|Willysr]] * http://open-eslack.org/ - Spanish Slackware community * http://jtgzmanager.sf.net/ - A new frontend to pkgtools built with Qt4 C++ libs - by Alexandre Arnt * http://sbopkg.org - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository * http://slackbot.sourceforge.net - Buildsystem and buildtools for Slackware ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==Free packages== * [http://slackware.com/~alien/ http://slackware.com/~alien/] Eric Hameleers' packages * [http://rlworkman.net/pkgs/ http://rlworkman.net/pkgs/] rworkman's packages * http://www.linuxpackages.net/ * [http://www.slacky.eu/repository/slackware-11.0/ Slacky.eu] Italian Slackware site * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware * [http://scxd.info/en/ Slackware Current eXtended Desktop] Packages for Slackware Current ==.SlackBuild Repositories== * http://slackbuilds.org - The SlackBuilds.org Project * http://slackbuilds.net - The French SlackBuilds Repository * http://www.slackware.com/~alien/slackbuilds/ - Eric "Alien" Hameleer's SlackBuilds * http://slackbuild.strangeworlds.co.uk - cathectic's SlackBuilds * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. * http://scxd.info/pub/slackbuilds/ - Slackware Current eXtended Desktop's SlackBuilds ==Live CD's based on Slackware== * [http://www.remote-exploit.org/ BackTrack] The result of the merging of two Innovative Penetration Testing live Linux distributions: Whax and Auditor * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://alien.slackbook.org/ Alien Bob's Wiki] * http://open-eslack.org/wiki/ - Wiki of the Slackware spanish community * http://slackware.linux.or.id/wiki/ - Indonesian Slackware Wiki ==RSS Feeds== * http://dev.slackware.it/rss/ - RSS feeds for stable Slackware release and -current ChangeLog * http://slackbuilds.org/mirror/rss/ - ChangeLog RSS feeds for 8.1 through -current e7088e87c55e225dddf23c5856d08d921b5d21e1 Mutt 0 117 222 140 2009-07-11T20:24:23Z Dwr 28 wikitext text/x-wiki [[Category:Tutorials]] = Mutt = Mutt is a text-based mail client renowned for its powerful features and the fact that it is almost totally customizable. This article will cover the installation and configuration of mutt in order to use it as your daily email client. Please note that I use GMail as my primary email address, so the examples are designed for GMail users. Not much differs though other than the fact that GMail uses SSL. == Installation == Slackware comes with a package for mutt v1.4. If you did a full install, you already have it installed. If not, it can be located on the 'n' series on your Slackware install CD or favourite mirror. This tutorial also uses getmail, procmail and msmtp. procmail and getmail are available as Slackware packages, and can be installed in the same manner... If you have the CD, follow these steps as root to install it: mount /mnt/cdrom installpkg /mnt/cdrom/slackware/n/mutt-1.4.2.1i-i486-2.tgz installpkg /mnt/cdrom/slackware/n/getmail-4.4.4-noarch-1.tgz installpkg /mnt/cdrom/slackware/n/procmail-3.22-i486-1.tgz If you would rather install it from a mirror: wget http://www.slackware.at/data/slackware-current/slackware/n/mutt-1.4.2.1i-i486-2.tgz wget http://www.slackware.at/data/slackware-current/slackware/n/getmail-4.4.4-noarch-1.tgz wget http://www.slackware.at/data/slackware-current/slackware/n/procmail-3.22-i486-1.tgz installpkg mutt-1.4.2.1i-i486-2.tgz getmail-4.4.4-noarch-1.tgz procmail-3.22-i486-1.tgz Be sure to replace 'slackware-current' with the actual version of Slackware you are using. msmtp is not part of Slackware, and will need to be installed separately. It can be downloaded from [http://msmtp.sourceforge.net/ here]. If you need information on building Slackware packages, click [[Building_A_Package]] for an excellent tutorial. == Configuration == === Mutt === First, let start with mutt, and a very simple ''~/.muttrc'': # Name set realname='Slackware User' # Where we store our emails set folder=~/mail set mbox=+mbox set spoolfile=+inbox set record=+sent set sort=threads # sort by emails by thread ;-) set postponed=+drafts set mbox_type=Maildir mailboxes +inbox # my favourite editor is 'joe' set editor=joe ignore * # this means "ignore all headers by default" # I still want to see some basic details unignore date from subject to cc # Mutt options set edit_headers=yes set hdrs # Allows us to create our own headers my_hdr From: Slackware User <user@slackware.com> my_hdr X-Mailer: `mutt -v| head -n 1` So far, it's simple, and cannot do much. We can almost read emails stored in ~/mail, compose and save drafts. In order for us to read emails, first, we need to create our mail folders. We are using the Maildir format, so we need to create them using: mkdir -p ~/mail/inbox/{,cur,tmp,new} mkdir -p ~/mail/sent/{,cur,tmp,new} mkdir -p ~/mail/drafts/{,cur,tmp,new} Now, when we have an email in ~/mail/inbox, we will be able to read it. Postponed messages will also be saved in ~/mail/drafts. But want to be able to send emails too, right? That's where msmtp comes into play. For this part, we will assume that msmtp is installed. msmtp is basically a SMTP client that will be called by mutt when sending an email. So we need to have added to the mutt config like this: set sendmail="/usr/bin/msmtp" Now, that's useless by itself. We need to setup msmtp to send emails... Open up ~/.msmtprc with your favourite editor. This is a copy of mine, setup to use GMail's smtp server: account default host smtp.gmail.com port 587 protocol smtp auth on from username@gmail.com user username@gmail.com password mypassword tls on tls_starttls on So, after going through this and identifying what we need for our SMTP server, we are ready to send emails... Let's test it: Launch mutt by running: mutt -y Running mutt without '-y' will ignore our mailboxes statement, so we won't see any emails... You can see in mutt the key shortcuts at the top of the screen: 'm' for composing a new message. After we save the message, we see a new shortcut at the top: 'y' to send the message. We now have mutt that can read emails from ~/mail/inbox, and send emails!!! The next step is to get the emails in ~/mail, and that's getmail's job. === Getmail === Getmail is a Python application that's included with Slackware. Similar to fetchmail, many people prefer it, saying it's easier to configure. Just like mutt, getmail is in the 'n' series, and should already be installed if you chose to do a full install. If not, just check out the mutt section above to install what's needed for this tutorial. Once we have it all installed, let's create a basic getmail configuration. This configuration sits in ''~/.getmail/getmailrc'': [retriever] type = SimplePOP3SSLRetriever server = pop.gmail.com username = username@gmail.com port = 995 password = password [destination] type = Maildir path = ~/mail/inbox If you use a standard POP3 account that doesn't use SSL, use something like: [retriever] type = SimplePOP3Retriever server = pop.isp.net username = username port = 110 password = password [destination] type = Maildir path = ~/mail/inbox As simple as that. Now, it will connect to your email account, and download all your emails to ~/mail/inbox. Please note that if you want to fetch mail for multiple accounts, unlike fetchmail, getmail works with a single account per config file. So if you have two email accounts, you can have each account configured in their own config file like ''~/.getmail/getmailrc'' and ''~/.getmail/getmailrc-isp'' If you want automatic check, just add the following lines to your crontab by running ''crontab -e'' for each one of your email accounts: /5 * * * * /usr/bin/getmail /30 * * * * /usr/bin/getmail -r ~/.getmail/getmailrc-isp === Procmail === Procmail is an advanced mail filtering solution. More to come == Todo == The rest... 34f6607c7aabe3c606afaa3442e2addede802376 Synaptics Touchpad 0 184 227 2009-07-30T05:29:00Z Hiptobecubic 30 IPage Created. wikitext text/x-wiki =Small description of how to change your Synaptics touchpad using HAL instead of xorg.conf.= In this example, I'll disable twofinger scrolling and enable the vertical scrolling on the right side of the touchpad as well as the tap-to-click feature: # Copy <tt>/usr/share/hal/fdi/policy/10osvendor/11-x11-synaptics.fdi</tt> to <tt>/etc/hal/fdi/policy</tt><br/> # Now open a terminal and check out the man page for synaptics. "man synaptics". This is beautifully documented description of every option you're looking for as well as many you probably had no idea about.<br/>Search for the option that you wish to change and read about the appropriate setting to get the behavior you want.<br/> # Open the 11-x11-synaptics.fdi file that you've copied to /etc/hal/fdi/policy. There will be a large commented section full of examples which we will model our options after. All options are passed to the synaptics driver using the:<br/><tt><merge key="input.x11_options.OPTIONNAME" type="string">OPTIONVALUE</merge></tt><br/>construct.<br/> #So let's add the vertical scrolling option with the line:<br/><tt><merge key="input.x11_options.VertEdgeScroll" type="string">true</merge></tt><br/> #And the tap-to-click feature:<br/><tt><merge key="input.x11_options.TabButton1" type="string">1</merge></tt><br/> #Now we disable the two-finger scrollers:<br/><tt><merge key="input.x11_options.VertTwoFingerScroll" type="string">false</merge></tt><br/><tt><merge key="input.x11_options.HorizTwoFingerScroll" type="string">false</merge></tt><br/> <br/>Note that even though the man page says that different options take type 'boolean' 'integer' 'float' etc, in the policy file everything is type string'. Simply use the appropriate type as the value. TapButton1 takes an integer where VertEdgeScroll takes a boolean, for example. #After this file has been edited. Close X and restart hal with <tt>sh /etc/rc.d/rc.hald restart</tt>. Now restart X and enjoy your new touchpad features. 7014b9ef1f310c3000c632ea4dbc7b4edc451fdd The Regulars 0 4 229 20 2009-08-11T03:08:14Z Dchmelik 32 /* Others */ wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:cpunches|cpunches]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|dchmelik]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please post a message on my [[User_talk:FredEmmott|user talk]] page if you think you'd be a suitable admin. c6c6329cf0b9ea5f484d22f9054717a9b5b54e12 230 229 2009-08-11T03:24:57Z Erik 1 Rewording wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:cpunches|cpunches]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|dchmelik]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. d02fe849995d712438b2bbd4fba7e980ae701653 245 230 2009-08-31T14:32:03Z Zordrak 40 /* Others */ wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:cpunches|cpunches]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|dchmelik]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. d0b3b5754861cff710472279bcd504cb34ae6a05 FreeNX 0 185 231 2009-08-13T17:00:35Z Pwc101 33 Created page with 'Getting FreeNX working on Slackware (12.2 as of writing). == Build it == Get Eric Hameleers' build script: :<code>wget -np -r http://connie.slackware.com/~alien/slackbuilds/fr...' wikitext text/x-wiki Getting FreeNX working on Slackware (12.2 as of writing). == Build it == Get Eric Hameleers' build script: :<code>wget -np -r http://connie.slackware.com/~alien/slackbuilds/freenx/build/</code> :<code>cd connie.slackware.com/\~alien/slackbuilds/freenx/build/</code> Build nx and freenx: :<code>./nx.SlackBuild && ./freenx.SlackBuild --cleanup</code> Install the resultant packages: :<code>installpkg /tmp/{nx-3.3.0-i486-1alien,freenx-0.7.3-i486-2alien}.tgz</code> The installer runs the initial configuration (including adding a new user "nx" to the system). == Configure it == The main config file is /etc/nxserver/node.conf. The comments are helpful, so read them. Of interest to me was specifying the port that the system's sshd listens on. If you run your sshd on a non-standard port (i.e. not 22), then uncomment the line: #SSHD_PORT=22 and replace 22 with whatever you port number is. If you're a bit paranoid with your security settings in /etc/ssh/sshd_config (like I am), make sure you add the user nx to AllowUsers, otherwise the client you choose will fail to connect to your ssh daemon. If you've made changes in /etc/ssh/sshd_config, then restart sshd. This is the command I use when I'm logged in remotely and I need to restart sshd: :<code>/etc/rc.d/rc.sshd stop; sleep 5; /etc/rc.d/rc.sshd start</code> == Run it == Check to see if the server is running (it was after my installation, but your mileage may vary): :<code>nxserver --status</code> If you see: root@darkstar:~# nxserver --status NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.3.0) NX> 110 NX Server is running NX> 999 Bye you're good to go. Otherwise, run: :<code>nxserver --restart</code> == Connect to it == http://en.opensuse.org/FreeNX_Server_HOWTO lists a number of clients able to connect to a (free)nx server. Since my main interest was in accessing my Linux box at home from my Windows box at work, I used the NoMachine client for Windows. 87a91a215d77011a533350b7d5f920c639ffe8dd 232 231 2009-08-13T17:01:31Z Pwc101 33 moved [[Freenx]] to [[FreeNX]]:&#32;Added correct name. wikitext text/x-wiki Getting FreeNX working on Slackware (12.2 as of writing). == Build it == Get Eric Hameleers' build script: :<code>wget -np -r http://connie.slackware.com/~alien/slackbuilds/freenx/build/</code> :<code>cd connie.slackware.com/\~alien/slackbuilds/freenx/build/</code> Build nx and freenx: :<code>./nx.SlackBuild && ./freenx.SlackBuild --cleanup</code> Install the resultant packages: :<code>installpkg /tmp/{nx-3.3.0-i486-1alien,freenx-0.7.3-i486-2alien}.tgz</code> The installer runs the initial configuration (including adding a new user "nx" to the system). == Configure it == The main config file is /etc/nxserver/node.conf. The comments are helpful, so read them. Of interest to me was specifying the port that the system's sshd listens on. If you run your sshd on a non-standard port (i.e. not 22), then uncomment the line: #SSHD_PORT=22 and replace 22 with whatever you port number is. If you're a bit paranoid with your security settings in /etc/ssh/sshd_config (like I am), make sure you add the user nx to AllowUsers, otherwise the client you choose will fail to connect to your ssh daemon. If you've made changes in /etc/ssh/sshd_config, then restart sshd. This is the command I use when I'm logged in remotely and I need to restart sshd: :<code>/etc/rc.d/rc.sshd stop; sleep 5; /etc/rc.d/rc.sshd start</code> == Run it == Check to see if the server is running (it was after my installation, but your mileage may vary): :<code>nxserver --status</code> If you see: root@darkstar:~# nxserver --status NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.3.0) NX> 110 NX Server is running NX> 999 Bye you're good to go. Otherwise, run: :<code>nxserver --restart</code> == Connect to it == http://en.opensuse.org/FreeNX_Server_HOWTO lists a number of clients able to connect to a (free)nx server. Since my main interest was in accessing my Linux box at home from my Windows box at work, I used the NoMachine client for Windows. 87a91a215d77011a533350b7d5f920c639ffe8dd 234 232 2009-08-13T17:04:23Z Pwc101 33 /* Configure it */ wikitext text/x-wiki Getting FreeNX working on Slackware (12.2 as of writing). == Build it == Get Eric Hameleers' build script: :<code>wget -np -r http://connie.slackware.com/~alien/slackbuilds/freenx/build/</code> :<code>cd connie.slackware.com/\~alien/slackbuilds/freenx/build/</code> Build nx and freenx: :<code>./nx.SlackBuild && ./freenx.SlackBuild --cleanup</code> Install the resultant packages: :<code>installpkg /tmp/{nx-3.3.0-i486-1alien,freenx-0.7.3-i486-2alien}.tgz</code> The installer runs the initial configuration (including adding a new user "nx" to the system). == Configure it == The main config file is /etc/nxserver/node.conf. The comments are helpful, so read them. Of interest to me was specifying the port that the system's sshd listens on. If you run your sshd on a non-standard port (i.e. not 22), then uncomment the line: #SSHD_PORT=22 and replace 22 with whatever your port number is. If you're a bit paranoid with your security settings in /etc/ssh/sshd_config (like I am), make sure you add the user nx to AllowUsers, otherwise the client you choose will fail to connect to your ssh daemon. If you've made changes in /etc/ssh/sshd_config, then restart sshd. This is the command I use when I'm logged in remotely and I need to restart sshd: :<code>/etc/rc.d/rc.sshd stop; sleep 5; /etc/rc.d/rc.sshd start</code> == Run it == Check to see if the server is running (it was after my installation, but your mileage may vary): :<code>nxserver --status</code> If you see: root@darkstar:~# nxserver --status NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.3.0) NX> 110 NX Server is running NX> 999 Bye you're good to go. Otherwise, run: :<code>nxserver --restart</code> == Connect to it == http://en.opensuse.org/FreeNX_Server_HOWTO lists a number of clients able to connect to a (free)nx server. Since my main interest was in accessing my Linux box at home from my Windows box at work, I used the NoMachine client for Windows. ce2da7f65127ac33ffe11f6a575e804cf126e873 235 234 2009-08-13T19:44:57Z Pwc101 33 /* Connect to it */ wikitext text/x-wiki Getting FreeNX working on Slackware (12.2 as of writing). == Build it == Get Eric Hameleers' build script: :<code>wget -np -r http://connie.slackware.com/~alien/slackbuilds/freenx/build/</code> :<code>cd connie.slackware.com/\~alien/slackbuilds/freenx/build/</code> Build nx and freenx: :<code>./nx.SlackBuild && ./freenx.SlackBuild --cleanup</code> Install the resultant packages: :<code>installpkg /tmp/{nx-3.3.0-i486-1alien,freenx-0.7.3-i486-2alien}.tgz</code> The installer runs the initial configuration (including adding a new user "nx" to the system). == Configure it == The main config file is /etc/nxserver/node.conf. The comments are helpful, so read them. Of interest to me was specifying the port that the system's sshd listens on. If you run your sshd on a non-standard port (i.e. not 22), then uncomment the line: #SSHD_PORT=22 and replace 22 with whatever your port number is. If you're a bit paranoid with your security settings in /etc/ssh/sshd_config (like I am), make sure you add the user nx to AllowUsers, otherwise the client you choose will fail to connect to your ssh daemon. If you've made changes in /etc/ssh/sshd_config, then restart sshd. This is the command I use when I'm logged in remotely and I need to restart sshd: :<code>/etc/rc.d/rc.sshd stop; sleep 5; /etc/rc.d/rc.sshd start</code> == Run it == Check to see if the server is running (it was after my installation, but your mileage may vary): :<code>nxserver --status</code> If you see: root@darkstar:~# nxserver --status NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.3.0) NX> 110 NX Server is running NX> 999 Bye you're good to go. Otherwise, run: :<code>nxserver --restart</code> == Connect to it == http://en.opensuse.org/FreeNX_Server_HOWTO lists a number of clients able to connect to a (free)nx server. Since my main interest was in accessing my Linux box at home from my Windows box at work, I used the NoMachine client for Windows. The NoMachine Linux client works just as well. Simply download the archive (http://64.34.161.181/download/3.3.0/Linux/nxclient-3.3.0-6.i386.tar.gz), unpack it and run bin/nxclient. When prompted, enter the IP or hostname of the machine you wish to connect to, the port through which you would SSH into it and which DE you want to run (KDE, Gnome etc.). Obviously Slackware doesn't ship with Gnome, but I've successfully tested it with KDE. I have yet to get XFCE to work. 8e08a815be6d96cf6c2e5cbdd5cc4555dcc545fd 236 235 2009-08-13T20:40:02Z Pwc101 33 wikitext text/x-wiki Getting FreeNX working on Slackware (-current as of writing (13/08/2009)). == Build it == Get Eric Hameleers' build script: :<code>wget -np -r http://connie.slackware.com/~alien/slackbuilds/freenx/build/</code> :<code>cd connie.slackware.com/\~alien/slackbuilds/freenx/build/</code> Build nx and freenx: :<code>./nx.SlackBuild && ./freenx.SlackBuild --cleanup</code> Install the resultant packages: :<code>installpkg /tmp/{nx-3.3.0-i486-1alien,freenx-0.7.3-i486-2alien}.tgz</code> The installer runs the initial configuration (including adding a new user "nx" to the system). == Configure it == The main config file is /etc/nxserver/node.conf. The comments are helpful, so read them. Of interest to me was specifying the port that the system's sshd listens on. If you run your sshd on a non-standard port (i.e. not 22), then uncomment the line: #SSHD_PORT=22 and replace 22 with whatever your port number is. If you're a bit paranoid with your security settings in /etc/ssh/sshd_config (like I am), make sure you add the user nx to AllowUsers, otherwise the client you choose will fail to connect to your ssh daemon. If you've made changes in /etc/ssh/sshd_config, then restart sshd. This is the command I use when I'm logged in remotely and I need to restart sshd: :<code>/etc/rc.d/rc.sshd stop; sleep 5; /etc/rc.d/rc.sshd start</code> == Run it == Check to see if the server is running (it was after my installation, but your mileage may vary): :<code>nxserver --status</code> If you see: root@darkstar:~# nxserver --status NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.3.0) NX> 110 NX Server is running NX> 999 Bye you're good to go. Otherwise, run: :<code>nxserver --restart</code> == Connect to it == http://en.opensuse.org/FreeNX_Server_HOWTO lists a number of clients able to connect to a (free)nx server. Since my main interest was in accessing my Linux box at home from my Windows box at work, I used the NoMachine client for Windows. The NoMachine Linux client works just as well. Simply download the archive (http://64.34.161.181/download/3.3.0/Linux/nxclient-3.3.0-6.i386.tar.gz), unpack it and run bin/nxclient. When prompted, enter the IP or hostname of the machine you wish to connect to, the port through which you would SSH into it and which DE you want to run (KDE, Gnome etc.). Obviously Slackware doesn't ship with Gnome, but I've successfully tested it with KDE. I have yet to get XFCE to work. 07d87e00b4db3aecc7f183b8d8482a5184ecf859 237 236 2009-08-13T20:40:24Z Pwc101 33 wikitext text/x-wiki Getting FreeNX working on Slackware -current as of writing (13/08/2009). == Build it == Get Eric Hameleers' build script: :<code>wget -np -r http://connie.slackware.com/~alien/slackbuilds/freenx/build/</code> :<code>cd connie.slackware.com/\~alien/slackbuilds/freenx/build/</code> Build nx and freenx: :<code>./nx.SlackBuild && ./freenx.SlackBuild --cleanup</code> Install the resultant packages: :<code>installpkg /tmp/{nx-3.3.0-i486-1alien,freenx-0.7.3-i486-2alien}.tgz</code> The installer runs the initial configuration (including adding a new user "nx" to the system). == Configure it == The main config file is /etc/nxserver/node.conf. The comments are helpful, so read them. Of interest to me was specifying the port that the system's sshd listens on. If you run your sshd on a non-standard port (i.e. not 22), then uncomment the line: #SSHD_PORT=22 and replace 22 with whatever your port number is. If you're a bit paranoid with your security settings in /etc/ssh/sshd_config (like I am), make sure you add the user nx to AllowUsers, otherwise the client you choose will fail to connect to your ssh daemon. If you've made changes in /etc/ssh/sshd_config, then restart sshd. This is the command I use when I'm logged in remotely and I need to restart sshd: :<code>/etc/rc.d/rc.sshd stop; sleep 5; /etc/rc.d/rc.sshd start</code> == Run it == Check to see if the server is running (it was after my installation, but your mileage may vary): :<code>nxserver --status</code> If you see: root@darkstar:~# nxserver --status NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.3.0) NX> 110 NX Server is running NX> 999 Bye you're good to go. Otherwise, run: :<code>nxserver --restart</code> == Connect to it == http://en.opensuse.org/FreeNX_Server_HOWTO lists a number of clients able to connect to a (free)nx server. Since my main interest was in accessing my Linux box at home from my Windows box at work, I used the NoMachine client for Windows. The NoMachine Linux client works just as well. Simply download the archive (http://64.34.161.181/download/3.3.0/Linux/nxclient-3.3.0-6.i386.tar.gz), unpack it and run bin/nxclient. When prompted, enter the IP or hostname of the machine you wish to connect to, the port through which you would SSH into it and which DE you want to run (KDE, Gnome etc.). Obviously Slackware doesn't ship with Gnome, but I've successfully tested it with KDE. I have yet to get XFCE to work. 30baf7bfd50a4991eb3e95fb49adab8542bf3931 240 237 2009-08-17T12:00:10Z Pwc101 33 /* Connect to it */ Added 64bit client download location wikitext text/x-wiki Getting FreeNX working on Slackware -current as of writing (13/08/2009). == Build it == Get Eric Hameleers' build script: :<code>wget -np -r http://connie.slackware.com/~alien/slackbuilds/freenx/build/</code> :<code>cd connie.slackware.com/\~alien/slackbuilds/freenx/build/</code> Build nx and freenx: :<code>./nx.SlackBuild && ./freenx.SlackBuild --cleanup</code> Install the resultant packages: :<code>installpkg /tmp/{nx-3.3.0-i486-1alien,freenx-0.7.3-i486-2alien}.tgz</code> The installer runs the initial configuration (including adding a new user "nx" to the system). == Configure it == The main config file is /etc/nxserver/node.conf. The comments are helpful, so read them. Of interest to me was specifying the port that the system's sshd listens on. If you run your sshd on a non-standard port (i.e. not 22), then uncomment the line: #SSHD_PORT=22 and replace 22 with whatever your port number is. If you're a bit paranoid with your security settings in /etc/ssh/sshd_config (like I am), make sure you add the user nx to AllowUsers, otherwise the client you choose will fail to connect to your ssh daemon. If you've made changes in /etc/ssh/sshd_config, then restart sshd. This is the command I use when I'm logged in remotely and I need to restart sshd: :<code>/etc/rc.d/rc.sshd stop; sleep 5; /etc/rc.d/rc.sshd start</code> == Run it == Check to see if the server is running (it was after my installation, but your mileage may vary): :<code>nxserver --status</code> If you see: root@darkstar:~# nxserver --status NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.3.0) NX> 110 NX Server is running NX> 999 Bye you're good to go. Otherwise, run: :<code>nxserver --restart</code> == Connect to it == http://en.opensuse.org/FreeNX_Server_HOWTO lists a number of clients able to connect to a (free)nx server. Since my main interest was in accessing my Linux box at home from my Windows box at work, I used the NoMachine client for Windows. The NoMachine Linux client works just as well. Simply download the archive (http://64.34.161.181/download/3.3.0/Linux/nxclient-3.3.0-6.i386.tar.gz or http://64.34.161.181/download/3.3.0/Linux/nxclient-3.3.0-6.x86_64.tar.gz, depending on your architecture), unpack it and run bin/nxclient. When prompted, enter the IP or hostname of the machine you wish to connect to, the port through which you would SSH into it and which DE you want to run (KDE, Gnome etc.). Obviously Slackware doesn't ship with Gnome, but I've successfully tested it with KDE. I have yet to get XFCE to work. 523a2610431eafc8dda53115bf6a37c0a854e9b8 241 240 2009-08-17T12:48:21Z Pwc101 33 /* Connect to it */ wikitext text/x-wiki Getting FreeNX working on Slackware -current as of writing (13/08/2009). == Build it == Get Eric Hameleers' build script: :<code>wget -np -r http://connie.slackware.com/~alien/slackbuilds/freenx/build/</code> :<code>cd connie.slackware.com/\~alien/slackbuilds/freenx/build/</code> Build nx and freenx: :<code>./nx.SlackBuild && ./freenx.SlackBuild --cleanup</code> Install the resultant packages: :<code>installpkg /tmp/{nx-3.3.0-i486-1alien,freenx-0.7.3-i486-2alien}.tgz</code> The installer runs the initial configuration (including adding a new user "nx" to the system). == Configure it == The main config file is /etc/nxserver/node.conf. The comments are helpful, so read them. Of interest to me was specifying the port that the system's sshd listens on. If you run your sshd on a non-standard port (i.e. not 22), then uncomment the line: #SSHD_PORT=22 and replace 22 with whatever your port number is. If you're a bit paranoid with your security settings in /etc/ssh/sshd_config (like I am), make sure you add the user nx to AllowUsers, otherwise the client you choose will fail to connect to your ssh daemon. If you've made changes in /etc/ssh/sshd_config, then restart sshd. This is the command I use when I'm logged in remotely and I need to restart sshd: :<code>/etc/rc.d/rc.sshd stop; sleep 5; /etc/rc.d/rc.sshd start</code> == Run it == Check to see if the server is running (it was after my installation, but your mileage may vary): :<code>nxserver --status</code> If you see: root@darkstar:~# nxserver --status NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.3.0) NX> 110 NX Server is running NX> 999 Bye you're good to go. Otherwise, run: :<code>nxserver --restart</code> == Connect to it == http://en.opensuse.org/FreeNX_Server_HOWTO lists a number of clients able to connect to a (free)nx server. Since my main interest was in accessing my Linux box at home from my Windows box at work, I used the NoMachine client for Windows. The NoMachine Linux client works just as well. Simply download the archive (http://64.34.161.181/download/3.3.0/Linux/nxclient-3.3.0-6.i386.tar.gz or http://64.34.161.181/download/3.3.0/Linux/nxclient-3.3.0-6.x86_64.tar.gz, depending on your architecture), unpack it and run NX/bin/nxclient. When prompted, enter the IP or hostname of the machine you wish to connect to, the port through which you would SSH into it and which DE you want to run (KDE, Gnome etc.). Obviously Slackware doesn't ship with Gnome, but I've successfully tested it with KDE. I have yet to get XFCE to work. 957056c1d39df5c62f475dd2599e00187649d05e Freenx 0 186 233 2009-08-13T17:01:32Z Pwc101 33 moved [[Freenx]] to [[FreeNX]]:&#32;Added correct name. wikitext text/x-wiki #REDIRECT [[FreeNX]] 34dddc51dccd5bae601d37233a09512faf0d919c SysRq 0 168 238 196 2009-08-14T04:47:03Z NickC 35 SysRq list into different order; corrected SysRq+I definition error; added mnemonics. wikitext text/x-wiki [[Category:Tips]] --[[User:Drijen|Drijen]] 15:06, 22 September 2007 (EDT) ==Recovering from a System Lock== Sometimes a process can go out to lunch, or the system will simply stop responding to user input. This could be from a process waiting for resources or a zombie, but in any case there is no reason to have to reach for that reset button! ==The Magic SysRq== The SysRq can be used as a means to save your work, sync the file system(s) and reboot the computer in a clean manner. If you don't know where the SysRq key is, look for the "Prt Scr" (Print Screen) button on your keyboard. SysRq is generally assigned to the same keypress. ===Enabling the SysRq Function=== To enable the SysRq functionality, you must have a 2.6.15 or higher kernel, and it must be compiled directly in. Not as a Module! To check that you have it enabled you may run this command: :<pre>cat /boot/config |grep CONFIG_MAGIC_SYSRQ</pre> OR :<pre>zcat /proc/config.gz |grep SYSRQ</pre> if you have /proc/.config support compiled in. (All base slack kernels do) which should return: :<pre>CONFIG_MAGIC_SYSRQ=y</pre> If you find that you need to compile it in, the option can be found under the heading ''Kernel Hacking'' on your make <(x)(menu)config> screen. Once you are satisfied that you have the SysRq funtion correctly compiled, ensure that it has not been disabled at boot: :<pre>cat /proc/sys/kernel/sysrq</pre> If the response is <tt>0</tt> : :<pre>echo 1 > /proc/sys/kernel/sysrq</pre> ===Recovering from a Lock Up using SysRq=== If your system has gone out to lunch, you can now use the Magic SysRq key to save your work and reboot. The basic commands are as follows: <tt>Alt+SysRq+R</tt> :Attempts to remove keyboard from Raw mode <tt>Alt+SysRq+E</tt> :Terminate request sent to all processes (SIGTERM / kill -15) <tt>Alt+SysRq+I</tt> :Kills all processes (SIGKILL / kill -9) <tt>Alt+SysRq+S</tt> :Syncs all disks <tt>Alt+SysRq+U</tt> :Force unmount and remount of all filesystems readonly <tt>Alt+SysRq+B</tt> :Reboots (INIT 6) and roughly in that order. You should wait several seconds between each keystroke to let the system complete your request before you issue a new one. There are several mnemonics to help you remember the key sequence: <tt>Raising Elephants Is So Utterly Boring</tt> <tt>Reboot Even If System Utterly Broken</tt> <tt>BUSIER, spelt backwards</tt> An alternative method is to: :<pre>Alt+SysRq+R CTRL+ALT+DEL</pre> This command will move the keyboard out of raw mode, and attempt to issue a <tt>SHUTDOWN NOW</tt> command. However, this will not work under some configurations, or if tty1 is defunct. ==Futher Information== Further instructions and other options can be found at: Wikipedia article on MagicSysRq [http://en.wikipedia.org/wiki/Magic_SysRq_key] <pre>/usr/src/<linux-version>/Documentation/sysrq.txt</pre> e15e11d4ae885652e4d3d7fe154180d78653322e User:Aaarnt 2 187 239 2009-08-15T17:07:04Z Aaarnt 37 Created page with 'My name is Alexandre Albuquerque Arnt. Brazilian. Took my BS in Computer Science in 1999. I develop software and happen to be a Slackware user since 2003 (or would it be 2002, we...' wikitext text/x-wiki My name is Alexandre Albuquerque Arnt. Brazilian. Took my BS in Computer Science in 1999. I develop software and happen to be a Slackware user since 2003 (or would it be 2002, well it doesn't matter). I use to run the stable version, while at times with a couple of current packages. Now using version 12.2 with KDE 4.2 and Xfce 4.6.1, as well as Linux kernel 2.6.30.4. I have a project called [http://jtgzmanager.sf.net QTGZManager] - a frontend to ''pkgtools'' written from scratch with the help of Qt4 C++ libs. Why Slackware? Because it's always been unbreakable to me. a4d78f2e9491a138740545ef726d20556ed6ad4e Binary Numbers 0 188 243 2009-08-31T13:39:49Z Rworkman 13 Initial import from webarchive - how to do exponents? wikitext text/x-wiki Based on Sandman1's tutorial, with heavy edits and additions by rworkman. You probably remember from learning numbers in elementary/primary school how you have the 'ones' place and the 'tens' place and the 'hundreds' place and so on... Let's take the number 4,728 for an example: The digit in the 'ones' place is 8 The digit in the 'tens' place is 2 The digit in the 'hundreds' place is 7 The digit in the 'thousands' place is 4 The ones/tens/hundreds/etcetera come from the fact that in base 10, the digits of a number are laid out like this: 10^0 = 1 -----> 'ones' place 10^1 = 10 ----> 'tens' place 10^2 = 100 ---> 'hundreds' place 10^3 = 1000 --> 'thousands' place 10^4 = 10000 -> 'ten-thousands' place and so on... So, in the number given above (4,728), we have: 8 'ones' -------> 8 x 1 = 8 2 'tens' -------> 2 x 10 = 20 7 'hundreds' ---> 7 x 100 = 700 4 'thousands' --> 4 x 1000 = 4000 Add up these totals: 8 + 20 + 700 + 4000 = 4728 The Binary Number system works the same way, and is a pretty easy thing to learn, but may be confusing at first. The first thing you need to memorize is 2 raised to the powers, for instance: 2^0 2^1 2^2 2^3 2^4 2^5 2^6 2^7 2^8 1 2 4 8 16 32 64 128 256 Instead of a 'ones' place, a 'tens' place, a 'hundreds' place, and so on like in base 10, there is a 'ones' place (2^0), and 'twos' place (2^1), a 'fours' place (2^2), an 'eights' place (2^3), and so on... Now we first want to be able to take a binary number and turn it into decimal format or base 10. So the first example: 1 1 1 1 * * * * 8 4 2 1 ^ ^ ^ ^ 8 + 4 + 2 + 1 = 15 Now from the example above you see how the 8 is on the left and the 1 is on the right. This will always be that order. You see above that you multiply the 1's with the actual digit it's located in. Now this is all hard to explain so I am going to show you another example: 1 0 0 0 0 * * * * * 16 8 4 2 1 ^ ^ ^ ^ ^ 16 +0 + 0 + 0 + 0 = 16 Now from the example above you see how it is 16 because all of the other placements are 0's and everything multiplied by zero is zero. Now converting from decimal to binary is a bit trickier, here is a simple example: 20 is the number we will be converting. We first need to find the highest value of the binary numbers above so we can subtract from it. 32 is to high because it is a bigger than 20. So we will use 16. We put a 1 in the 16 place and subtract from 20: 20 - 16 = 4 Now the next power is the 2^3 and that is 8. Since 8 is bigger than 4 we can put a zero. So we now are at 22 which is 4. Well, 4 is not bigger than 4 because it is the same number, so we subtract 4 and put a 1 there. 4 - 4 = 0 Since we have nothing left we just fill the rest of the placements with zeros: 10100 Now you can double check the work and find out that it is 20. Now I will show one more example, this time I will convert 25 to binary. For this example I will start by putting a 1 in the 2^4's place and subtract: 25 - 16 = 9 Now we have 9, so we look at the next power and see if it can go into 9. Which the next number is 8 and we can so we put a 1 in the 2^3's place. Now we subtract again: 9 - 8 = 1 Now we have 1 left over, now we want to put this in 20's place. So we skip over the 2^2 and 2^1. The reason why we skip this is because 1 cannot go into 4 and 2 equally. Now we have this binary number: 11001 This leads to a discussion about ipv4 addressing. An ipv4 address consists of 32 bits. 8 bits = 1 byte ; therefore, an ipv4 address is 4 bytes long. For example, 192.168.10.100 is an ipv4 address. Each byte of the address is separated by a dot (.) - in other words, the first byte (or eight bits) of the address is 192, the next is 168, the next is 10, the last is 100. You're probably wondering where the "eight bits" comes into play, right? :-) In binary, 192 = 11000000 and 168=10101000 and 10 = 00001010 and 100 = 01100100 Work it out for yourself (based on the information above) if you don't believe me. You've probably seen the CIDR notation before - maybe an address block was written like this: 192.168.10.1/24 What that tells you is that only the first 24 bits of the address are important. That one's easy, as 24 bits equals 3 bytes; therefore, only the first three octets are important. In other words, 192.168.10.1/24 would match any ip address from 192.168.10.1 through 192.186.10.255. That same pattern applies for a netmask of /8, /16, or /32. 192.0.0.0/8 would match any ip address that begins with 192. 192.168.0.0/16 would match any ip address that begins with 192.168. 192.168.10.100/32 will match *only* .100 -- this netmask means that *all* 32 bits are important; they must all match (as opposed to only 8 or 16 or 24 or whatever other number matching). So what if the netmask doesn't work out to a nice and easy byte boundary? Well... let's look at our original ip address again. 192.168.10.100 = 11000000.10101000.00001010.01100100 Suppose you're given 192.168.10.100/29 and asked to calculate a valid range of ip addresses. This tells you that the first 29 bits are important, but the others can change and still match the netmask. The first 29 bits are: 11000000.10101000.00001010.01100*** The *** represents the three bits that can change. For those three bits, here are your options (I'm leaving a space between the 29th and 30th bit): 11000000.10101000.00001010.01100 000 = 192.168.10.96 11000000.10101000.00001010.01100 001 = 192.168.10.97 11000000.10101000.00001010.01100 010 = 192.168.10.98 11000000.10101000.00001010.01100 011 = 192.168.10.99 11000000.10101000.00001010.01100 100 = 192.168.10.100 11000000.10101000.00001010.01100 101 = 192.168.10.101 11000000.10101000.00001010.01100 110 = 192.168.10.102 11000000.10101000.00001010.01100 111 = 192.168.10.103 Typically, this would be denoted as 192.168.10.96/29 The next /29 block would be 192.168.10.104/29, and then 192.168.10.112/29, and so on. Hopefully that helped a bit :) --rworkman 06d0fb92aa2e0bd42c9ce9d3966031fccab6bd51 244 243 2009-08-31T13:40:47Z Rworkman 13 Fixed some formatting wikitext text/x-wiki Based on Sandman1's tutorial, with heavy edits and additions by rworkman. You probably remember from learning numbers in elementary/primary school how you have the 'ones' place and the 'tens' place and the 'hundreds' place and so on... Let's take the number 4,728 for an example: The digit in the 'ones' place is 8 The digit in the 'tens' place is 2 The digit in the 'hundreds' place is 7 The digit in the 'thousands' place is 4 The ones/tens/hundreds/etcetera come from the fact that in base 10, the digits of a number are laid out like this: 10^0 = 1 -----> 'ones' place 10^1 = 10 ----> 'tens' place 10^2 = 100 ---> 'hundreds' place 10^3 = 1000 --> 'thousands' place 10^4 = 10000 -> 'ten-thousands' place and so on... So, in the number given above (4,728), we have: 8 'ones' -------> 8 x 1 = 8 2 'tens' -------> 2 x 10 = 20 7 'hundreds' ---> 7 x 100 = 700 4 'thousands' --> 4 x 1000 = 4000 Add up these totals: 8 + 20 + 700 + 4000 = 4728 The Binary Number system works the same way, and is a pretty easy thing to learn, but may be confusing at first. The first thing you need to memorize is 2 raised to the powers, for instance: 2^0 2^1 2^2 2^3 2^4 2^5 2^6 2^7 2^8 1 2 4 8 16 32 64 128 256 Instead of a 'ones' place, a 'tens' place, a 'hundreds' place, and so on like in base 10, there is a 'ones' place (2^0), and 'twos' place (2^1), a 'fours' place (2^2), an 'eights' place (2^3), and so on... Now we first want to be able to take a binary number and turn it into decimal format or base 10. So the first example: 1 1 1 1 * * * * 8 4 2 1 ^ ^ ^ ^ 8 + 4 + 2 + 1 = 15 Now from the example above you see how the 8 is on the left and the 1 is on the right. This will always be that order. You see above that you multiply the 1's with the actual digit it's located in. Now this is all hard to explain so I am going to show you another example: 1 0 0 0 0 * * * * * 16 8 4 2 1 ^ ^ ^ ^ ^ 16 +0 + 0 + 0 + 0 = 16 Now from the example above you see how it is 16 because all of the other placements are 0's and everything multiplied by zero is zero. Now converting from decimal to binary is a bit trickier, here is a simple example: 20 is the number we will be converting. We first need to find the highest value of the binary numbers above so we can subtract from it. 32 is to high because it is a bigger than 20. So we will use 16. We put a 1 in the 16 place and subtract from 20: 20 - 16 = 4 Now the next power is the 2^3 and that is 8. Since 8 is bigger than 4 we can put a zero. So we now are at 22 which is 4. Well, 4 is not bigger than 4 because it is the same number, so we subtract 4 and put a 1 there. 4 - 4 = 0 Since we have nothing left we just fill the rest of the placements with zeros: 10100 Now you can double check the work and find out that it is 20. Now I will show one more example, this time I will convert 25 to binary. For this example I will start by putting a 1 in the 2^4's place and subtract: 25 - 16 = 9 Now we have 9, so we look at the next power and see if it can go into 9. Which the next number is 8 and we can so we put a 1 in the 2^3's place. Now we subtract again: 9 - 8 = 1 Now we have 1 left over, now we want to put this in 20's place. So we skip over the 2^2 and 2^1. The reason why we skip this is because 1 cannot go into 4 and 2 equally. Now we have this binary number: 11001 This leads to a discussion about ipv4 addressing. An ipv4 address consists of 32 bits. 8 bits = 1 byte ; therefore, an ipv4 address is 4 bytes long. For example, 192.168.10.100 is an ipv4 address. Each byte of the address is separated by a dot (.) - in other words, the first byte (or eight bits) of the address is 192, the next is 168, the next is 10, the last is 100. You're probably wondering where the "eight bits" comes into play, right? :-) In binary, 192 = 11000000 and 168=10101000 and 10 = 00001010 and 100 = 01100100 Work it out for yourself (based on the information above) if you don't believe me. You've probably seen the CIDR notation before - maybe an address block was written like this: 192.168.10.1/24 What that tells you is that only the first 24 bits of the address are important. That one's easy, as 24 bits equals 3 bytes; therefore, only the first three octets are important. In other words, 192.168.10.1/24 would match any ip address from 192.168.10.1 through 192.186.10.255. That same pattern applies for a netmask of /8, /16, or /32. 192.0.0.0/8 would match any ip address that begins with 192. 192.168.0.0/16 would match any ip address that begins with 192.168. 192.168.10.100/32 will match *only* .100 -- this netmask means that *all* 32 bits are important; they must all match (as opposed to only 8 or 16 or 24 or whatever other number matching). So what if the netmask doesn't work out to a nice and easy byte boundary? Well... let's look at our original ip address again. 192.168.10.100 = 11000000.10101000.00001010.01100100 Suppose you're given 192.168.10.100/29 and asked to calculate a valid range of ip addresses. This tells you that the first 29 bits are important, but the others can change and still match the netmask. The first 29 bits are: 11000000.10101000.00001010.01100*** The *** represents the three bits that can change. For those three bits, here are your options (I'm leaving a space between the 29th and 30th bit): 11000000.10101000.00001010.01100 000 = 192.168.10.96 11000000.10101000.00001010.01100 001 = 192.168.10.97 11000000.10101000.00001010.01100 010 = 192.168.10.98 11000000.10101000.00001010.01100 011 = 192.168.10.99 11000000.10101000.00001010.01100 100 = 192.168.10.100 11000000.10101000.00001010.01100 101 = 192.168.10.101 11000000.10101000.00001010.01100 110 = 192.168.10.102 11000000.10101000.00001010.01100 111 = 192.168.10.103 Typically, this would be denoted as 192.168.10.96/29 The next /29 block would be 192.168.10.104/29, and then 192.168.10.112/29, and so on. Hopefully that helped a bit :) --rworkman 9db0783b2a3cda22b772557d3550b3151e6d3a5c User:Zordrak 2 189 246 2009-08-31T14:33:28Z Zordrak 40 Created page with 'I’m a UK-based Systems Administrator, a Slackware user and a F/OSS contributor.' wikitext text/x-wiki I’m a UK-based Systems Administrator, a Slackware user and a F/OSS contributor. 6052466138fd3601548e7581cbe4c246966e7c9c Kdebluetooth4 0 190 247 2009-09-02T20:56:55Z Lynchmv 39 How to get kdebluetooth4 to build on Slackware 13.0 wikitext text/x-wiki Out of the box, Slackware 13.0 will not compile kdebluetooth4, and the SlackBuild package of 1.0_beta8 will not build due to it not liking QT4. After some digging around, I found a patch that allowed me to build kdebluetooth4. The patch can be found here: [http://bugsfiles.kde.org/attachment.cgi?id=30865 KDE Bugfiles] Save it as kdebase-workspace-4.2.4.patch To apply this patch, download the kdebase-workspace-4.2.4.tar.bz2 package [http://mirrors.isc.org/pub/kde/stable/4.2.4/src/kdebase-workspace-4.2.4.tar.bz2 isc.org mirror] Extract the contents then apply the patch tar vxf kdebase-workspace-4.2.4.tar.bz2 cd kdebase-workspace-4.2.4 patch -p0 < ../kdebase-workspace-4.2.4.patch Tar everything back up tar cvvf kdebase-workspace-4.2.4.tar kdebase-workspace-4.2.4 bzip2 -9 kdebase-workspace-4.2.4.tar Create a working folder and copy the slackbuild from the 13.0 dvd mkdir /tmp/kdebase-workspace cd /tmp/kdebase-workspace cp -r /path/to/dvd/source/kde/kdebase-workspace/* . Edit line 47 of kdebase-workspace.SlackBuild then build the package tar xvf $CWD/kdebase-workspace-$VERSION.tar.?z* || exit 1 ./kdebase-workspace.SlackBuild This may or may not take some time, depending on your hardware, but you already knew that. After it is done building your new package, upgrade the old package with your new package upgradepkg kdebase-workspace-4.2.4-i486-1%kdebase-workspace-4.2.4.txz Now, you should have a patched version of kdebase-workspace installed and be able to install kdebluetooth4. I'll have to finish that part of this article when I get home, as it's 5:00... 6919d491a1f9bc0d358dc61e6af52edd6ce339a1 248 247 2009-09-03T01:13:37Z Lynchmv 39 wikitext text/x-wiki == This Does Not Work Yet == Out of the box, Slackware 13.0 will not compile kdebluetooth4, and the SlackBuild package of 1.0_beta8 will not build due to it not liking QT4. After some digging around, I found a patch that allowed me to build kdebluetooth4. The patch can be found here: [http://bugsfiles.kde.org/attachment.cgi?id=30865 KDE Bugfiles] Save it as kdebase-workspace-4.2.4.patch To apply this patch, download the kdebase-workspace-4.2.4.tar.bz2 package [http://mirrors.isc.org/pub/kde/stable/4.2.4/src/kdebase-workspace-4.2.4.tar.bz2 isc.org mirror] Extract the contents then apply the patch tar vxf kdebase-workspace-4.2.4.tar.bz2 cd kdebase-workspace-4.2.4 patch -p0 < ../kdebase-workspace-4.2.4.patch Tar everything back up tar cvvf kdebase-workspace-4.2.4.tar kdebase-workspace-4.2.4 bzip2 -9 kdebase-workspace-4.2.4.tar Create a working folder and copy the slackbuild from the 13.0 dvd mkdir /tmp/kdebase-workspace cd /tmp/kdebase-workspace cp -r /path/to/dvd/source/kde/kdebase-workspace/* . Edit line 47 of kdebase-workspace.SlackBuild then build the package tar xvf $CWD/kdebase-workspace-$VERSION.tar.?z* || exit 1 ./kdebase-workspace.SlackBuild This may or may not take some time, depending on your hardware, but you already knew that. After it is done building your new package, upgrade the old package with your new package upgradepkg kdebase-workspace-4.2.4-i486-1%kdebase-workspace-4.2.4.txz Now, you should have a patched version of kdebase-workspace installed and be able to install kdebluetooth4. I'll have to finish that part of this article when I get home, as it's 5:00... ...and now that I'm home, I see that my newly compiled kbluetooth4 Slackware package still doesn't work after instllation...grr...maybe this process will spawn an idea of someone much smarter than I on how to fix this... 586c539c5c55ca9faf0b5f96eabda15b3f831949 Slack-desc 0 17 249 24 2009-09-07T06:50:00Z Sahko 43 remove comment about space after : wikitext text/x-wiki =Overview= A proper slack-desc file should be written as follows: # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. |-----handy-ruler------------------------------------------------------| appname: Summary of application name and function (one line only) appname: <this line is generally left blank> appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname: The "appname" string must *exactly* match the application name portion of the Slackware package (for example, a package titled "gaim-1.5-i486-1.tgz" must have a slack-desc file with the <appname> string of "gaim: " rather than "Gaim: " or "GAIM: " or something else. The "handy ruler" is meant to stop you at 79 characters, because the standard console is 80x25 and if you go beyond this the words will wrap. =See Also= man makepkg man pkgtool [[Category:Tutorials]] 56d4b251bb87bbc38a2285df2e118e5d5c6d035d 250 249 2009-09-07T06:56:29Z Sahko 43 Undo revision 249 by [[Special:Contributions/Sahko|Sahko]] ([[User talk:Sahko|Talk]]) wikitext text/x-wiki =Overview= A proper slack-desc file should be written as follows: # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| appname: Summary of application name and function (one line only) appname: <this line is generally left blank> appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname: The "appname" string must *exactly* match the application name portion of the Slackware package (for example, a package titled "gaim-1.5-i486-1.tgz" must have a slack-desc file with the <appname> string of "gaim: " rather than "Gaim: " or "GAIM: " or something else. The "handy ruler" is meant to stop you at 79 characters, because the standard console is 80x25 and if you go beyond this the words will wrap. =See Also= man makepkg man pkgtool [[Category:Tutorials]] c24c887449d4942b75d125ca6278c76190d4c962 251 250 2009-09-07T06:59:54Z Sahko 43 wikitext text/x-wiki =Overview= A proper slack-desc file should be written as follows: # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| appname: Summary of application name and function (one line only) appname: <this line is generally left blank> appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname: The "appname" string must *exactly* match the application name portion of the Slackware package (for example, a package titled "gaim-1.5-i486-1.tgz" must have a slack-desc file with the <appname> string of "gaim: " rather than "Gaim: " or "GAIM: " or something else. The "handy ruler" is meant to stop you at 79 characters, because the standard console is 80x25 and if you go beyond this the words will wrap. The space after the : is needed only when there is text after the : =See Also= man makepkg man pkgtool [[Category:Tutorials]] 367ff913c08f6237c70dcce32a463d1410f75dd9 252 251 2009-09-07T07:02:15Z Sahko 43 wikitext text/x-wiki =Overview= A proper slack-desc file should be written as follows: # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| appname: Summary of application name and function (one line only) appname: <this line is generally left blank> appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname: The "appname" string must *exactly* match the application name portion of the Slackware package (for example, a package titled "gaim-1.5-i486-1.tgz" must have a slack-desc file with the <appname> string of "gaim: " rather than "Gaim: " or "GAIM: " or something else. The "handy ruler" is meant to stop you at 79 characters, because the standard console is 80x25 and if you go beyond this the words will wrap. The space after the : is needed only when there is text after the : In the above example lines 2,9 & 11 should not have a space after the : =See Also= man makepkg man pkgtool [[Category:Tutorials]] 2d14b63f32078586bd2efb2e120560322cce3e28 Talk:SSH Keys 1 191 253 2009-09-07T18:41:48Z Erik 1 Created page with 'Is rsa better? Should a bitsize (-b) be specified? ~~~~' wikitext text/x-wiki Is rsa better? Should a bitsize (-b) be specified? [[User:Erik|Erik]] 18:41, 7 September 2009 (UTC) 1af7572b05240d2e56d09e600eb7adffedc2e22f Recompile php with mcrypt 0 139 254 165 2009-10-05T16:55:09Z Trashbird1240 18 removed note about editing slackbuild wikitext text/x-wiki [[Category:Tutorials]] PhpMyAdmin (available at [http://www.SlackBuilds.org/ SlackBuilds.org]) works well when you compile PHP with the mcrypt extension. After installing PhpMyAdmin, you may see a warning that it cannot find the mcrypt extension. Unfortunately the official Slackware package does not include this extension. Recompiling PHP is necessary, as is enabling the mcrypt.so extension in /etc/httpd/php.ini. The first step is a little tricky, since compiling PHP requires a little trick: you must compile alpine during the PHP build. It is fairly simple once you have things in place, but this tripped me up when I first tried to recompile PHP. == Install mcrypt and libmcrypt == mcrypt is available from [http://www.SlackBuilds.org SlackBuilds.org]. First build and install mcrypt and libmcrypt before compiling PHP. == Recompile PHP == Go to a Slackware mirror and download Pat's Slackbuild directory for php from the source/n directory. I used <code># wget --mirror <mirror>/n/php</code> to download the whole directory. You will also need to download the alpine/ directory into the parent of the newly-created php/. In other words, you should have a parent directory with both php and alpine. For example, mine is ~/SlackBuilds/n, where I have two subdirectories: one for alpine/ and one for php/. An alternative to wget is to use a file manager capable of ftp with drag and drop, such as Nautilus. ''' Be sure to chmod +x both the alpine and php SlackBuilds before attempting to build.''' If you don't, things may go for quite a while depending on the speed of the machine you're building on before you get an error (and you ''will'' get an error). The official PHP SlackBuild includes a configure flag for mcrypt, so there is no need to edit the SlackBuild. You may want to specify a BUILD variable on the command line, so the package does not appear to be official (it is ''not'' official): <code># BUILD=3_<your initials> sudo ./php.SlackBuild</code> === Upgrade PHP === Install the new package with upgradepkg. Keep in mind that you will need to repeat this process whenever there is a security alert for php. In that case, download the new source, update the VERSION variable, recompile and upgrade. For this reason, I've kept ~/SlackBuilds/n the way it is with alpine and php subdirectories. == Configure PHP == Configuring PHP to use mcrypt is easy: add the line <code>extension=mcrypt.so</code> to /etc/httpd/php.ini and then restart apache. Now when you log in to PhpMyAdmin, you should no longer see the warning about mcrypt. ac181c7e0d3ea43b696be19446f8fc0abda8f6d4 Bootsplash (old) 0 55 255 76 2009-10-06T13:30:13Z Fuli 47 moved [[Bootsplash]] to [[Bootsplash (new)]]:&#32;It had to be done some changes in the adding the splash to the initrd.gz section. wikitext text/x-wiki [[Category:Tutorials]] == Prerequisites == * kernel source * a bootsplash patch for your kernel version [http://www.stadtwald21.de/mcbeister/bootsplash/index.html] bootsplash patch. * A bootsplash theme [http://kde-look.org/index.php?xcontentmode=61 kde-look themes] * Bootsplash utilites [http://www.yzzerdd.net/slackware/files/bootsplash/bootsplash-3.1.tar.bz2 download] == Setup == Start by patching and building a new kernel. Assuming Stock kernel configuration/source. And all your downloads are in /home/username/Downloads. <sub> cd /usr/src/linux patch -p1</home/username/Downloads/bootsplash*.diff rm .config zcat /proc/config.gz > .config make menuconfig</sub> *Note: If you insist on using the generic kernel. And are currently using it. Check to see if the .config in your /usr/src/linux directory matches /proc/config.gz <sub> zdiff /proc/config.gz /usr/src/linux/.config </sub> If they match, skip the "rm .config && zcat ..." part above You'll also want to converge your initrd.gz and bootsplash's initrd. More on that below. Edit these 2 options: <sub> Device Drivers ---> Graphics support ---> Logo configuration ---> [ ] Bootup logo Bootsplash configuration ---> [*] Bootup splash screen</sub> * If you aren't using a stock kernel configuration, or on another distro check these settings whileyou are still in the kernel configuration dialog: <sub><nowiki> Device Drivers ---> Block devices ---> <*> RAM disk support Graphics support ---> <*> Support for frame buffer devices</nowiki></sub> Now to make the patched kernel and install it <sub> make ; cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-bootsplash</sub> For slamd64, thats: <sub> make ; cp /usr/src/linux/arch/x86_64/boot/bzImage /boot/vmlinuz-bootsplash</sub> On to making a new bootsplash initrd. Compile and install the splash utility. <sub> cd /home/username/Downloads tar xf bootsplash-3.0.7.tar.bz2 cd bootsplash-3.0.7/Utilities/ make splash cp splash /usr/bin/ </sub> And use it to build your new initrd. Untar the theme file you downloaded, and check to see if it has a config directory and an image/s directory. Look in the config directory for an appropriately sized config file (usually bootsplash-1024x768.cfg). Edit this file, changing the directory it looks for images in (jpeg= option and silentjpeg= option) to point to the correct directory of the images for that theme. Example: /home/username/Downloads/bootsplashtheme/images/foo-bar.jpg Finish by making the initrd with splash: <sub> splash -s -f /home/username/Downloads/bootsplashtheme/config/bootsplash-1024x768.cfg >> /boot/initrd.splash </sub> For generic kernel users, you'll have to converge your stock initrd.gz and the bootsplash initrds. <sub>mkinitrd cp /boot/initrd.splash /boot/initrd-tree/ </sub> After putting the initrd-splash into the mkinitrd's initrd-tree you'll need to run mkinitrd again with some computer specific options. Example: <sub>mkinitrd -c -m reiserfs</sub> Remember to do this every time you make a new initrd.splash. Now edit /etc/lilo.conf with your favorite editor, adding the new kernel and bootsplash options. Sample: <sub> boot = /dev/hda message = /boot/boot_message.txt prompt timeout = 300 change-rules reset vga = 791 image = /boot/vmlinuz root = /dev/hda1 label = Linux read-only image = /boot/vmlinuz-bootsplash root = /dev/hda1 label = Bootsplash initrd=/boot/initrd.splash append="splash=silent" </sub> Substitue "initrd=/boot/initrd.gz" if you had to run mkinitrd for a generic kernel, then run lilo to update and you're set. <sub>root@slackware:~# lilo Added Linux Added Bootsplash </sub> Now you can Reboot to test everything. If boot fails for some reason. You still have your stock kernel and entry in lilo to boot into without worries. == Progressbar - rc.progress == Theres no set way to do this, you just need init to update /proc/splash correctly. The way I do it (with help from LinuxQuestiosn forums): create a new file in /etc/rc.d/ named rc.progress <sub> cd /etc/rc.d/ ; touch rc.progress </sub> edit it, and add this script: <sub><nowiki> #!/bin/sh # #rc.progress This file has a common subroutine used to update a # bootsplash progress bar. # # Count the number of times the progress bar is likely to gbe increased numu=$((`cat /etc/rc.d/rc.* | grep -c "^progressup"`)); numd=$((`cat /etc/rc.d/rc.* | grep -c "^progressdown"`)); function progressup(){ progress=$((`cat /var/run/progressbar`)); progress=$(($progress+1)); echo $progress > /var/run/progressbar echo "show $(( 65523 * $progress / $numu ))" > /proc/splash } function progressdown(){ progress=$((`cat /var/run/progressbar`)); progress=$(($progress-1)); echo $progress > /var/run/progressbar echo "show $(( 65523 * $progress / $numd ))" > /proc/splash } </nowiki></sub> Now *CAREFULLY* edit /etc/rc.d/rc.S at the top add the line (a new line by itself) <sub> . /etc/rc.d/rc.progress </sub> The . tells your system to include the functionality described in /etc/rc.d/rc.progress. Now scroll through and add "progressup" (the defined trigger in rc.progress) on a new line at the end of every subroutine where you want the progressbar to incriment up. Example section of my rc.S: <sub><nowiki> #!/bin/sh # # /etc/rc.d/rc.S: System initialization script. # # Mostly written by: Patrick J. Volkerding, <volkerdi@slackware.com> # . /etc/rc.d/rc.progress PATH=/sbin:/usr/sbin:/bin:/usr/bin # Mount /proc right away: </nowiki></sub> Don't add progressup till after your partition is mounted read/write it'll be at the end of a long segment of echo .. echo.. echo like this. <sub><nowiki> echo -n "Press ENTER to continue. " read junk; fi # Done checking root filesystem progressup </nowiki></sub> Do the same for /etc/rc.d/rc.6 adding progressdown instead of progressup. After you've finished that, you need to delete your temporary progressbar output cache. Since rc.local is run last during startup, it's best to accomplish this here. Edit rc.local: <sub><nowiki> #!/bin/sh # # /etc/rc.d/rc.local: Local system initialization script. # # Put any local startup commands in here. Also, if you have # anything that needs to be run at shutdown time you can # make an /etc/rc.d/rc.local_shutdown script and put those # commands in there. rm -fr /var/run/progressbar </nowiki></sub> == Progressbar - rc.bootsplash == An alternate script can also be used if you should have problems implementing the rc.progress script. In my case the prior script was not able to delete its progressbar file, and adding progressdown entries to rc.6 resulted in odd behaviors even during bootup when rc.6 should not of been a factor. Create a new file in /etc/rc.d/ named rc.bootsplash <sub> cd /etc/rc.d/ ; touch rc.bootsplash </sub> edit it, and add this script: <sub><nowiki> #! /bin/sh # # /etc/rc.d/rc.bootsplash: bootsplash functions. # This file does nothing if run, and is called by other rc. # files in order to make the progress bar and animations works. function progressbar() { if [ $# != 1 ] then echo "Usage: progressbar {progress}" exit 1 fi if [ -a /proc/splash ] ; then echo "show $(( 65534 * $1 / 100 ))" > /proc/splash fi } # function animate() { if [ $# = 0 ] then echo "Usage: animate {hook}" exit 1 fi splash "$*" } </nowiki></sub> Now *CAREFULLY* edit /etc/rc.d/rc.S at the top add the line (a new line by itself) <sub> . /etc/rc.d/rc.bootsplash </sub> Now scroll through and add "progressbar X" (where X is a number representing the percent to incriment to) on a new line at the end of every subroutine where you want the progressbar to incriment up. 0 is not a valid incriment. Only 1 - 100 are valid. Example rc.S <sub><nowiki> # Scan for new volume groups: /sbin/vgscan --mknodes --ignorelockingfailure 2> /dev/null if [ $? = 0 ]; then # Make volume groups available to the kernel. # This should also make logical volumes available. /sbin/vgchange -ay --ignorelockingfailure fi fi progressbar 5 # Open any volumes created by cryptsetup: if [ -f /etc/crypttab -a -x /sbin/cryptsetup.static ]; then # First, check for device-mapper support. if ! grep -wq device-mapper /proc/devices ; then # If device-mapper exists as a module, try to load it. # Try to load a device-mapper kernel module: /sbin/modprobe -q dm-mod fi cat /etc/crypttab | grep -v "^#" | grep -v "^$" | while read line; do LUKS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f1 -d' ') DEV=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f2 -d' ') PASS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f3 -d' ') OPTS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f4 -d' ') LUKSOPTS="" if echo $OPTS | grep -wq ro ; then LUKSOPTS="${LUKSOPTS} --readonly" ; fi # NOTE: we only support LUKS formatted volumes (except for swap)! if /sbin/cryptsetup.static isLuks $DEV 2>/dev/null ; then echo "Unlocking LUKS crypt volume '${LUKS}' on device '$DEV':" if [ -n "${PASS}" ]; then if [ -f ${PASS} ]; then /sbin/cryptsetup.static ${LUKSOPTS} --key-file=${PASS} luksOpen $DEV $LUKS elif [ "${PASS}" != "none" ]; then echo "${PASS}" | /sbin/cryptsetup.static ${LUKSOPTS} luksOpen $DEV $LUKS fi else for i in seq 1 3 ; do /sbin/cryptsetup.static ${LUKSOPTS} luksOpen $DEV $LUKS </dev/tty0 >/dev/tty0 2>&1 [ $? -eq 0 ] && break done fi elif echo $OPTS | grep -wq swap ; then # If any of the volumes is to be used as encrypted swap, # then encrypt it using a random key and run mkswap: echo "Creating encrypted swap on device '$DEV' mapped to '${LUKS}':" /sbin/cryptsetup.static --cipher=aes --key-file=/dev/urandom --key-size=256 create $LUKS $DEV mkswap /dev/mapper/$LUKS fi done fi # Enable swapping: /sbin/swapon -a progressbar 10 </nowiki></sub> Continue adding "progressbar X" entries in both rc.S and rc.M Do the same for rc.6 but instead incrimenting down 'X'. Example rc.6 <sub><nowiki> #! /bin/sh # # rc.6 This file is executed by init when it goes into runlevel # 0 (halt) or runlevel 6 (reboot). It kills all processes, # unmounts file systems and then either halts or reboots. # # Version: @(#)/etc/rc.d/rc.6 2.47 Sat Jan 13 13:37:26 PST 2001 # # Author: Miquel van Smoorenburg <miquels@drinkel.nl.mugnet.org> # Modified by: Patrick J. Volkerding, <volkerdi@slackware.com> # . /etc/rc.d/rc.bootsplash # Set the path. PATH=/sbin:/etc:/bin:/usr/bin progressbar 100 # If there are SystemV init scripts for this runlevel, run them. if [ -x /etc/rc.d/rc.sysvinit ]; then . /etc/rc.d/rc.sysvinit fi progressbar 90 # Set linefeed mode to avoid staircase effect. /bin/stty onlcr echo "Running shutdown script $0:" # Find out how we were called. case "$0" in *0) command="halt" ;; *6) command=reboot ;; *) echo "$0: call me as \"rc.0\" or \"rc.6\" please!" exit 1 ;; esac # Save the system time to the hardware clock using hwclock --systohc. if [ -x /sbin/hwclock ]; then # Check for a broken motherboard RTC clock (where ioports for rtc are # unknown) to prevent hwclock causing a hang: if ! grep -q -w rtc /proc/ioports ; then CLOCK_OPT="--directisa" fi if grep -q "^UTC" /etc/hardwareclock 2> /dev/null ; then echo "Saving system time to the hardware clock (UTC)." /sbin/hwclock $CLOCK_OPT --utc --systohc else echo "Saving system time to the hardware clock (localtime)." /sbin/hwclock $CLOCK_OPT --localtime --systohc fi fi progressbar 80 </nowiki></sub> 6d57a57211dc8013b3497e5c44ab1d5c10ddc57c 257 255 2009-10-06T13:34:00Z Fuli 47 moved [[Bootsplash (new)]] to [[Bootsplash (old)]]:&#32;It had to be done some changes in the adding the splash to the initrd.gz section. wikitext text/x-wiki [[Category:Tutorials]] == Prerequisites == * kernel source * a bootsplash patch for your kernel version [http://www.stadtwald21.de/mcbeister/bootsplash/index.html] bootsplash patch. * A bootsplash theme [http://kde-look.org/index.php?xcontentmode=61 kde-look themes] * Bootsplash utilites [http://www.yzzerdd.net/slackware/files/bootsplash/bootsplash-3.1.tar.bz2 download] == Setup == Start by patching and building a new kernel. Assuming Stock kernel configuration/source. And all your downloads are in /home/username/Downloads. <sub> cd /usr/src/linux patch -p1</home/username/Downloads/bootsplash*.diff rm .config zcat /proc/config.gz > .config make menuconfig</sub> *Note: If you insist on using the generic kernel. And are currently using it. Check to see if the .config in your /usr/src/linux directory matches /proc/config.gz <sub> zdiff /proc/config.gz /usr/src/linux/.config </sub> If they match, skip the "rm .config && zcat ..." part above You'll also want to converge your initrd.gz and bootsplash's initrd. More on that below. Edit these 2 options: <sub> Device Drivers ---> Graphics support ---> Logo configuration ---> [ ] Bootup logo Bootsplash configuration ---> [*] Bootup splash screen</sub> * If you aren't using a stock kernel configuration, or on another distro check these settings whileyou are still in the kernel configuration dialog: <sub><nowiki> Device Drivers ---> Block devices ---> <*> RAM disk support Graphics support ---> <*> Support for frame buffer devices</nowiki></sub> Now to make the patched kernel and install it <sub> make ; cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-bootsplash</sub> For slamd64, thats: <sub> make ; cp /usr/src/linux/arch/x86_64/boot/bzImage /boot/vmlinuz-bootsplash</sub> On to making a new bootsplash initrd. Compile and install the splash utility. <sub> cd /home/username/Downloads tar xf bootsplash-3.0.7.tar.bz2 cd bootsplash-3.0.7/Utilities/ make splash cp splash /usr/bin/ </sub> And use it to build your new initrd. Untar the theme file you downloaded, and check to see if it has a config directory and an image/s directory. Look in the config directory for an appropriately sized config file (usually bootsplash-1024x768.cfg). Edit this file, changing the directory it looks for images in (jpeg= option and silentjpeg= option) to point to the correct directory of the images for that theme. Example: /home/username/Downloads/bootsplashtheme/images/foo-bar.jpg Finish by making the initrd with splash: <sub> splash -s -f /home/username/Downloads/bootsplashtheme/config/bootsplash-1024x768.cfg >> /boot/initrd.splash </sub> For generic kernel users, you'll have to converge your stock initrd.gz and the bootsplash initrds. <sub>mkinitrd cp /boot/initrd.splash /boot/initrd-tree/ </sub> After putting the initrd-splash into the mkinitrd's initrd-tree you'll need to run mkinitrd again with some computer specific options. Example: <sub>mkinitrd -c -m reiserfs</sub> Remember to do this every time you make a new initrd.splash. Now edit /etc/lilo.conf with your favorite editor, adding the new kernel and bootsplash options. Sample: <sub> boot = /dev/hda message = /boot/boot_message.txt prompt timeout = 300 change-rules reset vga = 791 image = /boot/vmlinuz root = /dev/hda1 label = Linux read-only image = /boot/vmlinuz-bootsplash root = /dev/hda1 label = Bootsplash initrd=/boot/initrd.splash append="splash=silent" </sub> Substitue "initrd=/boot/initrd.gz" if you had to run mkinitrd for a generic kernel, then run lilo to update and you're set. <sub>root@slackware:~# lilo Added Linux Added Bootsplash </sub> Now you can Reboot to test everything. If boot fails for some reason. You still have your stock kernel and entry in lilo to boot into without worries. == Progressbar - rc.progress == Theres no set way to do this, you just need init to update /proc/splash correctly. The way I do it (with help from LinuxQuestiosn forums): create a new file in /etc/rc.d/ named rc.progress <sub> cd /etc/rc.d/ ; touch rc.progress </sub> edit it, and add this script: <sub><nowiki> #!/bin/sh # #rc.progress This file has a common subroutine used to update a # bootsplash progress bar. # # Count the number of times the progress bar is likely to gbe increased numu=$((`cat /etc/rc.d/rc.* | grep -c "^progressup"`)); numd=$((`cat /etc/rc.d/rc.* | grep -c "^progressdown"`)); function progressup(){ progress=$((`cat /var/run/progressbar`)); progress=$(($progress+1)); echo $progress > /var/run/progressbar echo "show $(( 65523 * $progress / $numu ))" > /proc/splash } function progressdown(){ progress=$((`cat /var/run/progressbar`)); progress=$(($progress-1)); echo $progress > /var/run/progressbar echo "show $(( 65523 * $progress / $numd ))" > /proc/splash } </nowiki></sub> Now *CAREFULLY* edit /etc/rc.d/rc.S at the top add the line (a new line by itself) <sub> . /etc/rc.d/rc.progress </sub> The . tells your system to include the functionality described in /etc/rc.d/rc.progress. Now scroll through and add "progressup" (the defined trigger in rc.progress) on a new line at the end of every subroutine where you want the progressbar to incriment up. Example section of my rc.S: <sub><nowiki> #!/bin/sh # # /etc/rc.d/rc.S: System initialization script. # # Mostly written by: Patrick J. Volkerding, <volkerdi@slackware.com> # . /etc/rc.d/rc.progress PATH=/sbin:/usr/sbin:/bin:/usr/bin # Mount /proc right away: </nowiki></sub> Don't add progressup till after your partition is mounted read/write it'll be at the end of a long segment of echo .. echo.. echo like this. <sub><nowiki> echo -n "Press ENTER to continue. " read junk; fi # Done checking root filesystem progressup </nowiki></sub> Do the same for /etc/rc.d/rc.6 adding progressdown instead of progressup. After you've finished that, you need to delete your temporary progressbar output cache. Since rc.local is run last during startup, it's best to accomplish this here. Edit rc.local: <sub><nowiki> #!/bin/sh # # /etc/rc.d/rc.local: Local system initialization script. # # Put any local startup commands in here. Also, if you have # anything that needs to be run at shutdown time you can # make an /etc/rc.d/rc.local_shutdown script and put those # commands in there. rm -fr /var/run/progressbar </nowiki></sub> == Progressbar - rc.bootsplash == An alternate script can also be used if you should have problems implementing the rc.progress script. In my case the prior script was not able to delete its progressbar file, and adding progressdown entries to rc.6 resulted in odd behaviors even during bootup when rc.6 should not of been a factor. Create a new file in /etc/rc.d/ named rc.bootsplash <sub> cd /etc/rc.d/ ; touch rc.bootsplash </sub> edit it, and add this script: <sub><nowiki> #! /bin/sh # # /etc/rc.d/rc.bootsplash: bootsplash functions. # This file does nothing if run, and is called by other rc. # files in order to make the progress bar and animations works. function progressbar() { if [ $# != 1 ] then echo "Usage: progressbar {progress}" exit 1 fi if [ -a /proc/splash ] ; then echo "show $(( 65534 * $1 / 100 ))" > /proc/splash fi } # function animate() { if [ $# = 0 ] then echo "Usage: animate {hook}" exit 1 fi splash "$*" } </nowiki></sub> Now *CAREFULLY* edit /etc/rc.d/rc.S at the top add the line (a new line by itself) <sub> . /etc/rc.d/rc.bootsplash </sub> Now scroll through and add "progressbar X" (where X is a number representing the percent to incriment to) on a new line at the end of every subroutine where you want the progressbar to incriment up. 0 is not a valid incriment. Only 1 - 100 are valid. Example rc.S <sub><nowiki> # Scan for new volume groups: /sbin/vgscan --mknodes --ignorelockingfailure 2> /dev/null if [ $? = 0 ]; then # Make volume groups available to the kernel. # This should also make logical volumes available. /sbin/vgchange -ay --ignorelockingfailure fi fi progressbar 5 # Open any volumes created by cryptsetup: if [ -f /etc/crypttab -a -x /sbin/cryptsetup.static ]; then # First, check for device-mapper support. if ! grep -wq device-mapper /proc/devices ; then # If device-mapper exists as a module, try to load it. # Try to load a device-mapper kernel module: /sbin/modprobe -q dm-mod fi cat /etc/crypttab | grep -v "^#" | grep -v "^$" | while read line; do LUKS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f1 -d' ') DEV=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f2 -d' ') PASS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f3 -d' ') OPTS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f4 -d' ') LUKSOPTS="" if echo $OPTS | grep -wq ro ; then LUKSOPTS="${LUKSOPTS} --readonly" ; fi # NOTE: we only support LUKS formatted volumes (except for swap)! if /sbin/cryptsetup.static isLuks $DEV 2>/dev/null ; then echo "Unlocking LUKS crypt volume '${LUKS}' on device '$DEV':" if [ -n "${PASS}" ]; then if [ -f ${PASS} ]; then /sbin/cryptsetup.static ${LUKSOPTS} --key-file=${PASS} luksOpen $DEV $LUKS elif [ "${PASS}" != "none" ]; then echo "${PASS}" | /sbin/cryptsetup.static ${LUKSOPTS} luksOpen $DEV $LUKS fi else for i in seq 1 3 ; do /sbin/cryptsetup.static ${LUKSOPTS} luksOpen $DEV $LUKS </dev/tty0 >/dev/tty0 2>&1 [ $? -eq 0 ] && break done fi elif echo $OPTS | grep -wq swap ; then # If any of the volumes is to be used as encrypted swap, # then encrypt it using a random key and run mkswap: echo "Creating encrypted swap on device '$DEV' mapped to '${LUKS}':" /sbin/cryptsetup.static --cipher=aes --key-file=/dev/urandom --key-size=256 create $LUKS $DEV mkswap /dev/mapper/$LUKS fi done fi # Enable swapping: /sbin/swapon -a progressbar 10 </nowiki></sub> Continue adding "progressbar X" entries in both rc.S and rc.M Do the same for rc.6 but instead incrimenting down 'X'. Example rc.6 <sub><nowiki> #! /bin/sh # # rc.6 This file is executed by init when it goes into runlevel # 0 (halt) or runlevel 6 (reboot). It kills all processes, # unmounts file systems and then either halts or reboots. # # Version: @(#)/etc/rc.d/rc.6 2.47 Sat Jan 13 13:37:26 PST 2001 # # Author: Miquel van Smoorenburg <miquels@drinkel.nl.mugnet.org> # Modified by: Patrick J. Volkerding, <volkerdi@slackware.com> # . /etc/rc.d/rc.bootsplash # Set the path. PATH=/sbin:/etc:/bin:/usr/bin progressbar 100 # If there are SystemV init scripts for this runlevel, run them. if [ -x /etc/rc.d/rc.sysvinit ]; then . /etc/rc.d/rc.sysvinit fi progressbar 90 # Set linefeed mode to avoid staircase effect. /bin/stty onlcr echo "Running shutdown script $0:" # Find out how we were called. case "$0" in *0) command="halt" ;; *6) command=reboot ;; *) echo "$0: call me as \"rc.0\" or \"rc.6\" please!" exit 1 ;; esac # Save the system time to the hardware clock using hwclock --systohc. if [ -x /sbin/hwclock ]; then # Check for a broken motherboard RTC clock (where ioports for rtc are # unknown) to prevent hwclock causing a hang: if ! grep -q -w rtc /proc/ioports ; then CLOCK_OPT="--directisa" fi if grep -q "^UTC" /etc/hardwareclock 2> /dev/null ; then echo "Saving system time to the hardware clock (UTC)." /sbin/hwclock $CLOCK_OPT --utc --systohc else echo "Saving system time to the hardware clock (localtime)." /sbin/hwclock $CLOCK_OPT --localtime --systohc fi fi progressbar 80 </nowiki></sub> 6d57a57211dc8013b3497e5c44ab1d5c10ddc57c Bootsplash 0 192 256 2009-10-06T13:30:13Z Fuli 47 moved [[Bootsplash]] to [[Bootsplash (new)]]:&#32;It had to be done some changes in the adding the splash to the initrd.gz section. wikitext text/x-wiki #REDIRECT [[Bootsplash (new)]] 5c8cb522f164c3d2eed340a067e0327a274bad5e 259 256 2009-10-06T13:37:54Z Fuli 47 it was just a small change to correct the splash adding to initrd.gz info. wikitext text/x-wiki [[Category:Tutorials]] == Prerequisites == * kernel source * a bootsplash patch for your kernel version [http://www.stadtwald21.de/mcbeister/bootsplash/index.html] bootsplash patch. * A bootsplash theme [http://kde-look.org/index.php?xcontentmode=61 kde-look themes] * Bootsplash utilites [http://www.yzzerdd.net/slackware/files/bootsplash/bootsplash-3.1.tar.bz2 download] == Setup == Start by patching and building a new kernel. Assuming Stock kernel configuration/source. And all your downloads are in /home/username/Downloads. <sub> cd /usr/src/linux patch -p1</home/username/Downloads/bootsplash*.diff rm .config zcat /proc/config.gz > .config make menuconfig</sub> *Note: If you insist on using the generic kernel. And are currently using it. Check to see if the .config in your /usr/src/linux directory matches /proc/config.gz <sub> zdiff /proc/config.gz /usr/src/linux/.config </sub> If they match, skip the "rm .config && zcat ..." part above You'll also want to converge your initrd.gz and bootsplash's initrd. More on that below. Edit these 2 options: <sub> Device Drivers ---> Graphics support ---> Logo configuration ---> [ ] Bootup logo Bootsplash configuration ---> [*] Bootup splash screen</sub> * If you aren't using a stock kernel configuration, or on another distro check these settings whileyou are still in the kernel configuration dialog: <sub><nowiki> Device Drivers ---> Block devices ---> <*> RAM disk support Graphics support ---> <*> Support for frame buffer devices</nowiki></sub> Now to make the patched kernel and install it <sub> make ; cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-bootsplash</sub> For slamd64, thats: <sub> make ; cp /usr/src/linux/arch/x86_64/boot/bzImage /boot/vmlinuz-bootsplash</sub> On to making a new bootsplash initrd. Compile and install the splash utility. <sub> cd /home/username/Downloads tar xf bootsplash-3.0.7.tar.bz2 cd bootsplash-3.0.7/Utilities/ make splash cp splash /usr/bin/ </sub> And use it to build your new initrd. Untar the theme file you downloaded, and check to see if it has a config directory and an image/s directory. Look in the config directory for an appropriately sized config file (usually bootsplash-1024x768.cfg). Edit this file, changing the directory it looks for images in (jpeg= option and silentjpeg= option) to point to the correct directory of the images for that theme. Example: /home/username/Downloads/bootsplashtheme/images/foo-bar.jpg Finish by making the initrd with splash: <sub> splash -s -f /home/username/Downloads/bootsplashtheme/config/bootsplash-1024x768.cfg >> /boot/initrd.splash </sub> For generic kernel users, you'll have to converge your stock initrd.gz and the bootsplash initrds. For example: <sub>mkinitrd -c -m reiserfs</sub> <sub> cp /boot/initrd.splash /boot/initrd-tree/bootsplash </sub> After putting the initrd-splash into the mkinitrd's initrd-tree you'll need to run mkinitrd again. Remember to do this every time you make a new initrd.splash. Now edit /etc/lilo.conf with your favorite editor, adding the new kernel and bootsplash options. Sample: <sub> boot = /dev/hda message = /boot/boot_message.txt prompt timeout = 300 change-rules reset vga = 791 image = /boot/vmlinuz root = /dev/hda1 label = Linux read-only image = /boot/vmlinuz-bootsplash root = /dev/hda1 label = Bootsplash initrd=/boot/initrd.splash append="splash=silent" </sub> Substitue "initrd=/boot/initrd.gz" if you had to run mkinitrd for a generic kernel, then run lilo to update and you're set. <sub>root@slackware:~# lilo Added Linux Added Bootsplash </sub> Now you can Reboot to test everything. If boot fails for some reason. You still have your stock kernel and entry in lilo to boot into without worries. == Progressbar - rc.progress == Theres no set way to do this, you just need init to update /proc/splash correctly. The way I do it (with help from LinuxQuestiosn forums): create a new file in /etc/rc.d/ named rc.progress <sub> cd /etc/rc.d/ ; touch rc.progress </sub> edit it, and add this script: <sub><nowiki> #!/bin/sh # #rc.progress This file has a common subroutine used to update a # bootsplash progress bar. # # Count the number of times the progress bar is likely to gbe increased numu=$((`cat /etc/rc.d/rc.* | grep -c "^progressup"`)); numd=$((`cat /etc/rc.d/rc.* | grep -c "^progressdown"`)); function progressup(){ progress=$((`cat /var/run/progressbar`)); progress=$(($progress+1)); echo $progress > /var/run/progressbar echo "show $(( 65523 * $progress / $numu ))" > /proc/splash } function progressdown(){ progress=$((`cat /var/run/progressbar`)); progress=$(($progress-1)); echo $progress > /var/run/progressbar echo "show $(( 65523 * $progress / $numd ))" > /proc/splash } </nowiki></sub> Now *CAREFULLY* edit /etc/rc.d/rc.S at the top add the line (a new line by itself) <sub> . /etc/rc.d/rc.progress </sub> The . tells your system to include the functionality described in /etc/rc.d/rc.progress. Now scroll through and add "progressup" (the defined trigger in rc.progress) on a new line at the end of every subroutine where you want the progressbar to incriment up. Example section of my rc.S: <sub><nowiki> #!/bin/sh # # /etc/rc.d/rc.S: System initialization script. # # Mostly written by: Patrick J. Volkerding, <volkerdi@slackware.com> # . /etc/rc.d/rc.progress PATH=/sbin:/usr/sbin:/bin:/usr/bin # Mount /proc right away: </nowiki></sub> Don't add progressup till after your partition is mounted read/write it'll be at the end of a long segment of echo .. echo.. echo like this. <sub><nowiki> echo -n "Press ENTER to continue. " read junk; fi # Done checking root filesystem progressup </nowiki></sub> Do the same for /etc/rc.d/rc.6 adding progressdown instead of progressup. After you've finished that, you need to delete your temporary progressbar output cache. Since rc.local is run last during startup, it's best to accomplish this here. Edit rc.local: <sub><nowiki> #!/bin/sh # # /etc/rc.d/rc.local: Local system initialization script. # # Put any local startup commands in here. Also, if you have # anything that needs to be run at shutdown time you can # make an /etc/rc.d/rc.local_shutdown script and put those # commands in there. rm -fr /var/run/progressbar </nowiki></sub> == Progressbar - rc.bootsplash == An alternate script can also be used if you should have problems implementing the rc.progress script. In my case the prior script was not able to delete its progressbar file, and adding progressdown entries to rc.6 resulted in odd behaviors even during bootup when rc.6 should not of been a factor. Create a new file in /etc/rc.d/ named rc.bootsplash <sub> cd /etc/rc.d/ ; touch rc.bootsplash </sub> edit it, and add this script: <sub><nowiki> #! /bin/sh # # /etc/rc.d/rc.bootsplash: bootsplash functions. # This file does nothing if run, and is called by other rc. # files in order to make the progress bar and animations works. function progressbar() { if [ $# != 1 ] then echo "Usage: progressbar {progress}" exit 1 fi if [ -a /proc/splash ] ; then echo "show $(( 65534 * $1 / 100 ))" > /proc/splash fi } # function animate() { if [ $# = 0 ] then echo "Usage: animate {hook}" exit 1 fi splash "$*" } </nowiki></sub> Now *CAREFULLY* edit /etc/rc.d/rc.S at the top add the line (a new line by itself) <sub> . /etc/rc.d/rc.bootsplash </sub> Now scroll through and add "progressbar X" (where X is a number representing the percent to incriment to) on a new line at the end of every subroutine where you want the progressbar to incriment up. 0 is not a valid incriment. Only 1 - 100 are valid. Example rc.S <sub><nowiki> # Scan for new volume groups: /sbin/vgscan --mknodes --ignorelockingfailure 2> /dev/null if [ $? = 0 ]; then # Make volume groups available to the kernel. # This should also make logical volumes available. /sbin/vgchange -ay --ignorelockingfailure fi fi progressbar 5 # Open any volumes created by cryptsetup: if [ -f /etc/crypttab -a -x /sbin/cryptsetup.static ]; then # First, check for device-mapper support. if ! grep -wq device-mapper /proc/devices ; then # If device-mapper exists as a module, try to load it. # Try to load a device-mapper kernel module: /sbin/modprobe -q dm-mod fi cat /etc/crypttab | grep -v "^#" | grep -v "^$" | while read line; do LUKS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f1 -d' ') DEV=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f2 -d' ') PASS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f3 -d' ') OPTS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f4 -d' ') LUKSOPTS="" if echo $OPTS | grep -wq ro ; then LUKSOPTS="${LUKSOPTS} --readonly" ; fi # NOTE: we only support LUKS formatted volumes (except for swap)! if /sbin/cryptsetup.static isLuks $DEV 2>/dev/null ; then echo "Unlocking LUKS crypt volume '${LUKS}' on device '$DEV':" if [ -n "${PASS}" ]; then if [ -f ${PASS} ]; then /sbin/cryptsetup.static ${LUKSOPTS} --key-file=${PASS} luksOpen $DEV $LUKS elif [ "${PASS}" != "none" ]; then echo "${PASS}" | /sbin/cryptsetup.static ${LUKSOPTS} luksOpen $DEV $LUKS fi else for i in seq 1 3 ; do /sbin/cryptsetup.static ${LUKSOPTS} luksOpen $DEV $LUKS </dev/tty0 >/dev/tty0 2>&1 [ $? -eq 0 ] && break done fi elif echo $OPTS | grep -wq swap ; then # If any of the volumes is to be used as encrypted swap, # then encrypt it using a random key and run mkswap: echo "Creating encrypted swap on device '$DEV' mapped to '${LUKS}':" /sbin/cryptsetup.static --cipher=aes --key-file=/dev/urandom --key-size=256 create $LUKS $DEV mkswap /dev/mapper/$LUKS fi done fi # Enable swapping: /sbin/swapon -a progressbar 10 </nowiki></sub> Continue adding "progressbar X" entries in both rc.S and rc.M Do the same for rc.6 but instead incrimenting down 'X'. Example rc.6 <sub><nowiki> #! /bin/sh # # rc.6 This file is executed by init when it goes into runlevel # 0 (halt) or runlevel 6 (reboot). It kills all processes, # unmounts file systems and then either halts or reboots. # # Version: @(#)/etc/rc.d/rc.6 2.47 Sat Jan 13 13:37:26 PST 2001 # # Author: Miquel van Smoorenburg <miquels@drinkel.nl.mugnet.org> # Modified by: Patrick J. Volkerding, <volkerdi@slackware.com> # . /etc/rc.d/rc.bootsplash # Set the path. PATH=/sbin:/etc:/bin:/usr/bin progressbar 100 # If there are SystemV init scripts for this runlevel, run them. if [ -x /etc/rc.d/rc.sysvinit ]; then . /etc/rc.d/rc.sysvinit fi progressbar 90 # Set linefeed mode to avoid staircase effect. /bin/stty onlcr echo "Running shutdown script $0:" # Find out how we were called. case "$0" in *0) command="halt" ;; *6) command=reboot ;; *) echo "$0: call me as \"rc.0\" or \"rc.6\" please!" exit 1 ;; esac # Save the system time to the hardware clock using hwclock --systohc. if [ -x /sbin/hwclock ]; then # Check for a broken motherboard RTC clock (where ioports for rtc are # unknown) to prevent hwclock causing a hang: if ! grep -q -w rtc /proc/ioports ; then CLOCK_OPT="--directisa" fi if grep -q "^UTC" /etc/hardwareclock 2> /dev/null ; then echo "Saving system time to the hardware clock (UTC)." /sbin/hwclock $CLOCK_OPT --utc --systohc else echo "Saving system time to the hardware clock (localtime)." /sbin/hwclock $CLOCK_OPT --localtime --systohc fi fi progressbar 80 </nowiki></sub> 36488c030ff4c0a5b90539c6bda058f21ffeb37e Bootsplash (new) 0 193 258 2009-10-06T13:34:00Z Fuli 47 moved [[Bootsplash (new)]] to [[Bootsplash (old)]]:&#32;It had to be done some changes in the adding the splash to the initrd.gz section. wikitext text/x-wiki #REDIRECT [[Bootsplash (old)]] be06724b14e543d85a2a288c2e7308c86d5a3adb User:Slakmagik 2 195 261 2009-10-11T04:55:19Z Slakmagik 49 Created page with 'Dedicated [http://slackware.com/ Slackware] user.<br/> Maintainer of a few [http://slackbuilds.org/ SlackBuilds].<br/> Member of the [http://www.sbopkg.org/ sbopkg] project. Can...' wikitext text/x-wiki Dedicated [http://slackware.com/ Slackware] user.<br/> Maintainer of a few [http://slackbuilds.org/ SlackBuilds].<br/> Member of the [http://www.sbopkg.org/ sbopkg] project. Can often be found in ##slackware, #slackbuilds, and #sbopkg on freenode as 'slakmagik'. 031144f64c82a27f1fd22fc7caa865f37cd26266 User:Erik 2 2 262 4 2009-10-18T13:01:17Z Erik 1 wikitext text/x-wiki Real Name: Erik Hanson<br> Web: [http://slackbuilds.org/~erik/ http://slackbuilds.org/~erik/]<br> EMail: [mailto:erik@slackbuilds.org erik@slackbuilds.org]<br> IRC: erik @ [irc://frop.taphouse.org/ Taphouse Cabal] and [irc://chat.freenode.net The Freenode Network]<br> bc3e84a0de1b3a214bc06162bddf8b1cf074875b 301 262 2010-02-25T00:53:12Z Erik 1 wikitext text/x-wiki Name: [mailto:erik@slackbuilds.org Erik Hanson]<br> Web: [http://slackbuilds.org/~erik/ http://slackbuilds.org/~erik/]<br> IRC: erik @ [irc://frop.taphouse.org/ Taphouse Cabal] and [irc://chat.freenode.net The Freenode Network]<br> 51cb2648a05bed1d6cb560e82ced7cb09c0c61ac Main Page 0 1 263 209 2009-11-03T06:06:25Z Rworkman 13 Noted registration lapse wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 6b3b81a3a9d0d4d69d7c37ee6df9263adf3cfe14 3ware 3DM2 0 34 264 55 2009-11-23T04:40:43Z Merge-delete 261 typographical fixes wikitext text/x-wiki [[Category:Tutorials]] ==3DM2== 3DM2 is 3ware's web-based interface for controlling and status checks for their RAID cards. It contains a small web server that allows configuration and maintenance to the RAID array and provides status reports. It has an email notification feature that reports RAID problems and glitches. ==Installing 3DM2 On A Slackware Box== (written from a 3DM2 V9.3.0.7 and Slackware 11 perspective) 1) Gunzip and un-tar the 3DM2 archive. 2) As root, run <code>install.3dm install</code> to install. ::This script does four things- :::a) It complains that you aren't running RedHat or Suse and therefore will not automatically install the 3DM2 init scripts in the <code>/etc/rc.d</code> directory. You have to manually do this, this is explained later in this instruction. :::b) It makes a <code>/tmp/3ware</code> directory and decompresses the 3DM2 files there. :::c) It copies the <code>3dm2</code> binary to <code>/usr/sbin</code>. :::d) It makes a <code>/etc/3dm2</code> directory. ::''NOTE: the <code>/tmp/3ware</code> directory is NOT removed after install. It is not necessary to keep but, you may want to keep the <code>install.3dm2</code> binary in case you ever want to uninstall 3DM2.'' 3) Edit <code>/etc/rc.d/rc.local</code> and add the following line: ::<code>/usr/sbin/3dm2</code> 4) ''If you are running a restrictive firewall'', open port 888. 5) Start 3DM2 by: <code>3dm2</code> 6) Using a web browser, browse to your RAID machine, port 888. ::'''If your web-browser is on the same box as your RAID array'''- click here:[https://localhost:888 http'''s'''://localhost:888] ::'''If your web-browser is NOT on the same box as your RAID array'''- ::::a) Edit your <code>/etc/3dm2/3dm2.conf</code> file and change the <code>RemoteAccess 0</code> to <code>RemoteAccess 1</code> ::::b) Browse to your machine using HTTPS and port 888- ::::::EXAMPLE: <code> https://192.186.1.2:888</code> ::::::::or <code>https://server.mydomain.net:888</code> 7) Once the web interface loads up, log in as ADMINISTRATOR (default password is "3ware") and complete the configuration. 8) To activate the help files, you'll need to copy them to the correct location. ::::a) View your /etc/3dm2/3dm2.conf file. ::::b) Make a note of the Help entry. 9) Go to /tmp/3ware/. 10) Untar the file 3dm-help.tgz. A directory corresponding to your language with all the help files in it will be created. For this example (English), the directory was called en. 11) Copy the en directory into the location you made a note of in 8b above. Copy the whole directory, not just the files inside the directory. 12) Now when you are logged in to the 3dm2 application inside a browser and you click on help, you will get the help screens. -------------------------------------------------------------------------------------------- (written from a 3DM2-Linux-9.3.0.4 and Slackware '''12.0''' perspective) Using the 3DM2-Linux-9.3.0.4 seems to be ideal for slackware. I have it running on Slackware 10.2 Slackware 11.0 (2.4 and 2.6 kernels) Slackware 12.0 (Defult 2.6 kernel) with the following cards: 7006-2 Series 8006-2LP Serise 9500S Series The directions I found to work best are as follows. 1a) Download 3DM2-Linux-9.3.0.4.tgz from: http://www.3ware.com/support/download.asp 2a) Please select your 3ware product. = $YOUR_CARD_MODEL 3a) Please Select Item = *LEAVE BLANK* 4a) Latest = 9.3.0.4 5a) Please select the item to download = 3DMD2 Management Utility 6a) Then select Linux as your OS, select 3DM2-Linux-9.3.0.4.tgz to download, read the EULA, and download somewhere reachable by your Linux OS. For the sake of instructions, we'll say /usr/src/3ware. 01) cd /usr/src/3ware 02) tar xfvz 3DM2-Linux-9.3.0.4.tgz 03) run: ./install -i This extracts files to: /tmp/3ware ...moves the appropriate binary to: /usr/sbin/3dm2 ...and creates the directory: /etc/3dm2 Now we need to create another directory. For the sake of instructions, we'll say /3ware/. 04) mkdir /3ware 05) run: cp -rf /tmp/3ware/* /3ware/ 06) run: cp /usr/src/3ware/3dm-lnx.tgz /3ware/ 07) run: cd /3ware 08) run: ./install To the following questions, answer the defaults: Was RPM used to install the Escalade driver and/or 3dm?? (Y/N) [N] Please enter the location of the help documentation. [/usr/local/doc/3dm] Now you will get what appears to be an error. "3dm binary missing. Installation stopping." Don't worry, the binary file is already in place. If you notice though, the /etc/3dm2 directory is empty. 09) run: /usr/sbin/3dm2 This will populate that directory with the default config file, that you may edit to your satisfaction. If you leave the config file as is, you should be able to connect to your server from the local host at https://localhost:888 (*https* is very important). In order to connect from another PC, edit /etc/3dmd2/3dmd2.conf line RemoteAccess 0 to RemoteAccess 1 1b) run: killall 3dm2 2b) run: /usr/sbin/3dm2 The default password for both "USER" and "ADMINISTRATOR" = "3ware" 2a600d54d73bc13545f828cbe811be01f65a3393 OpenVPN(EN) 0 197 266 2009-12-01T17:18:06Z Seekret 59 This is just an English version of the existing OpenVPN page. wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] As a user-space VPN daemon, OpenVPN is compatible with with SSL/TLS, RSA Certificates and X509 PKI, NAT, DHCP, and TUN/TAP virtual devices. OpenVPN is not compatible with IPSec, IKE, PPTP, or L2TP. __TOC__ == Installation == Download source from [http://openvpn.net openvpn.net] Download verison 2.0 install Lzo <pre> tar zxvf lzo-1.08.tar.gz cd lzo-1-08.tar.gz ./configure --prefix=/usr make ; make install-strip </pre> install OpenVPN <pre> tar zxvf openvpn-2.0.tar.gz cd openvpn-2.0 ./configure --prefix=/usr \ --sysconfdir=/etc/openvpn \ --enable-pthread \ --enable-iproute2 \ --with-ssl \ --with-lzo-header=/usr/include \ --with-lzo-lib=/usr/lib \ --with-ifconfig \ --with-route \ --with-mem-check=dmalloc make ; make install-strip </pre> == Configuration == ==Configuring Certificates== Save all certificates in '''''/etc/openvpn/certs''''' <pre> This is a small RSA key management package, based on the openssl command line tool, that can be found in the easy-rsa subdirectory of the OpenVPN distribution. These are reference notes. For step by step instructions, see the HOWTO: http://openvpn.net/howto.html INSTALL 1. Edit vars. 2. Set KEY_CONFIG to point to the openssl.cnf file included in this distribution. 3. Set KEY_DIR to point to a directory which will contain all keys, certificates, etc. This directory need not exist, and if it does, it will be deleted with rm -rf, so BE CAREFUL how you set KEY_DIR. 4. (Optional) Edit other fields in vars per your site data. You may want to increase KEY_SIZE to 2048 if you are paranoid and don't mind slower key processing, but certainly 1024 is fine for testing purposes. KEY_SIZE must be compatible across both peers participating in a secure SSL/TLS connection. 5 . vars 6. ./clean-all 7. As you create certificates, keys, and certificate signing requests, understand that only .key files should be kept confidential. .crt and .csr files can be sent over insecure channels such as plaintext email. 8. You should never need to copy a .key file between computers. Normally each computer will have its own certificate/key pair. BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY 1. ./build-ca 2. ca.crt and ca.key will be built in your KEY_DIR directory BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) 1. ./build-inter inter 2. inter.crt and inter.key will be built in your KEY_DIR directory and signed with your root certificate. BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). 1. ./build-dh BUILD A CERTIFICATE SIGNING REQUEST (If you want to sign your certificate with a root certificate controlled by another individual or organization, or residing on a different machine). 1. Get ca.crt (the root certificate) from your certificate authority. Though this transfer can be over an insecure channel, to prevent man-in-the-middle attacks you must confirm that ca.crt was not tampered with. Large CAs solve this problem by hardwiring their root certificates into popular web browsers. A simple way to verify a root CA is to call the issuer on the telephone and confirm that the md5sum or sha1sum signatures on the ca.crt files match (such as with the command: "md5sum ca.crt"). 2. Choose a name for your certificate such as your computer name. In our example we will use "mycert". 3. ./build-req mycert 4. You can ignore most of the fields, but set "Common Name" to something unique such as your computer's host name. Leave all password fields blank, unless you want your private key to be protected by password. Using a password is not required -- it will make your key more secure but also more inconvenient to use, because you will need to supply your password anytime the key is used. NOTE: if you are using a password, use ./build-req-pass instead of ./build-req 5. Your key will be written to $KEY_DIR/mycert.key 6. Your certificate signing request will be written to to $KEY_DIR/mycert.csr 7. Email mycert.csr to the individual or organization which controls the root certificate. This can be done over an insecure channel. 8. After the .csr file is signed by the root certificate authority, you will receive a file mycert.crt (your certificate). Place mycert.crt in your KEY_DIR directory. 9. The combined files of mycert.crt, mycert.key, and ca.crt can now be used to secure one end of an SSL/TLS connection. SIGN A CERTIFICATE SIGNING REQUEST 1. ./sign-req mycert 2. mycert.crt will be built in your KEY_DIR directory using mycert.csr and your root CA file as input. BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY -- this script generates and signs a certificate in one step, but it requires that the generated certificate and private key files be copied to the destination host over a secure channel. 1. ./build-key mycert (no password protection) 2. OR ./build-key-pass mycert (with password protection) 3. OR ./build-key-pkcs12 mycert (PKCS #12 format) 4. OR ./build-key-server mycert (with nsCertType=server) 5. mycert.crt and mycert.key will be built in your KEY_DIR directory, and mycert.crt will be signed by your root CA. If ./build-key-pkcs12 was used a mycert.p12 file will also be created including the private key, certificate and the ca certificate. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. (4) Sign server certificates with one CA and client certificates with a different CA. The client config "ca" directive should reference the server-signing CA while the server config "ca" directive should reference the client-signing CA. NOTES Show certificate fields: openssl x509 -in cert.crt -text </pre> <pre> # cd easy-rsa # vi vars . vars ./clean-all ## BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY ./build.ca ## BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) ./build-inter inter ## BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). ./build.dh ## BUILD A CERTIFICATE SIGNING REQUEST ## (If you want to sign your certificate with a root certificate controlled by another individual ## or organization, or residing on a different machine) ./build-req mycert ## SIGN A CERTIFICATE SIGNING REQUEST ./sign-req mycert ## BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY ./build-key mycert (no password protection) OR ./build-key-pass mycert (with password protection) OR ./build-key-pkcs12 mycert (PKCS #12 format) OR ./build-key-server mycert (with nsCertType=server) </pre> ==Configuring the Server== Edit the server.conf file with vi '''''vi /etc/openvpn/server.conf''''' <pre> ## Mode Server mode server ## Local Host Name/IP Server ;local 127.0.0.1 ## Protocol ;proto tcp proto udp ## Port ; port 1194 ## Device Interface ;dev tap dev tun ## TAP-Win32 adapter name ;dev-node MyTap ## SSL/TLS ## root certificate (ca) ## certificate (cert) ## private key (key) ca /etc/openvpn/certs/ca.crt cert /etc/openvpn/certs/server.crt key /etc/openvpn/certs/server.key ## Diffie hellman parameters dh dh1024.pem ## VPN subnet server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt ##ethernet bridging ;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100 ## dhcpcaveats ;push "route 192.168.10.0 255.255.255.0" ;push "route 192.168.20.0 255.255.255.0" ;client-config-dir ccd ;route 192.168.40.128 255.255.255.248 ;client-config-dir ccd ;route 10.9.0.0 255.255.255.252 ;learn-address ./script ## dhcpcaveats ;push "redirect-gateway" ;push "dhcp-option DNS 10.8.0.1" ;push "dhcp-option WINS 10.8.0.1" ## ;client-to-client ## same "COMMON NAME" certificate/key ;duplicate-cn ## Status Connection keepalive 10 120 ## tls-auth key ;tls-auth ta.key 0 ## Cryptographic cipher ;cipher BF-CBC # Blowfish (default) ;cipher AES-128-CBC # AES ;cipher DES-EDE3-CBC # Triple-DES ## Link Compresion comp-lzo ## Max Client Connections ;max-clients 100 ## daemon privileges (non windows saja) user nobody group nobody persist-key persist-tun ## Openvpn Log ;log /var/log/openvpn/openvpn.log ;log-append /var/log/openvpn/openvpn.log ## Output Log status /var/log/openvpn/openvpn-status.log ## Log Verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## Repeating Messages ;mute 20 ## Pid File writepid /var/run/openvpn.pid </pre> '''Routing''' <pre> echo 1 > /proc/sys/net/ipv4/ip_forward route add -net 10.0.1.0 netmask 255.255.255.0 gw 10.4.0.2 </pre> '''Firewall''' <pre> iptables -A INPUT -p udp -s 1.2.3.4 --dport 1194 -j ACCEPT OR iptables -A INPUT -p udp --dport 1194 -j ACCEPT ## Tun Device iptables -A INPUT -i tun+ -j ACCEPT iptables -A FORWARD -i tun+ -j ACCEPT ## Tap Device iptables -A INPUT -i tap+ -j ACCEPT iptables -A FORWARD -i tap+ -j ACCEPT </pre> ==Configuring the Client== Edit the client.conf file with vi '''''vi /etc/openvpn/client.conf''''' <pre> ## Config client ## Device Interface ;dev tap dev tun ## Tap adapter name (Win only) ;dev-node MyTap ## Conectivity ;proto tcp proto udp ## Server [hostname/ip] [port] remote my-server-1 1194 ;remote my-server-2 1194 ## load-balancing ;remote-random ## resolve host name OpenVPN server resolv-retry infinite # local port nobind ## privileges (non windows saja) user nobody group nobody ## preserve persist-key persist-tun ## HTTP proxy ;http-proxy-retry ;http-proxy [proxy server] [proxy port] ## duplicate packet warnings ;mute-replay-warnings ## SSL/TLS parms /etc/openvpn/certs/ca ca.crt /etc/openvpn/certs/cert client.crt /etc/openvpn/certs/key client.key ## nsCertType key ;ns-cert-type server ## tls-auth key ;tls-auth /etc/openvpn/certs/ta.key 1 ## Cryptographic cipher ;cipher x ## Link compression comp-lzo ## verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## repeating messages ;mute 20 </pre> '''Routing''' <pre> route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.4.0.1 </pre> ==Example== '''Example 1:''' A simple tunnel without security<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9 </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 2:''' A tunnel with static-key security (i.e. using a pre-shared secret)<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --verb 5 --secret key </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --verb 5 --secret key </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 3:''' A tunnel with full TLS-based security <br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --tls-client --ca tmp-ca.crt --cert client.crt --key client.key \ --reneg-sec 60 --verb 5 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --tls-server --ca tmp-ca.crt --cert server.crt --key server.key \ --reneg-sec 60 --verb 5 --dh dh1024.pem </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 == External Links == * http://dmalloc.com/ * http://valgrind.org/ * http://www.oberhumer.com/opensource/lzo/ * http://openvpn.net/ * http://openvpn.net/howto.html * http://openvpn.net/1xhowto.html (Old-v1.06) * http://openvpn.net/man.html 8d0505df62558c99ad0a3a49399000dc0bb8bd3e 267 266 2009-12-01T17:18:48Z Seekret 59 /* Configuring the Server */ wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] As a user-space VPN daemon, OpenVPN is compatible with with SSL/TLS, RSA Certificates and X509 PKI, NAT, DHCP, and TUN/TAP virtual devices. OpenVPN is not compatible with IPSec, IKE, PPTP, or L2TP. __TOC__ == Installation == Download source from [http://openvpn.net openvpn.net] Download verison 2.0 install Lzo <pre> tar zxvf lzo-1.08.tar.gz cd lzo-1-08.tar.gz ./configure --prefix=/usr make ; make install-strip </pre> install OpenVPN <pre> tar zxvf openvpn-2.0.tar.gz cd openvpn-2.0 ./configure --prefix=/usr \ --sysconfdir=/etc/openvpn \ --enable-pthread \ --enable-iproute2 \ --with-ssl \ --with-lzo-header=/usr/include \ --with-lzo-lib=/usr/lib \ --with-ifconfig \ --with-route \ --with-mem-check=dmalloc make ; make install-strip </pre> == Configuration == ==Configuring Certificates== Save all certificates in '''''/etc/openvpn/certs''''' <pre> This is a small RSA key management package, based on the openssl command line tool, that can be found in the easy-rsa subdirectory of the OpenVPN distribution. These are reference notes. For step by step instructions, see the HOWTO: http://openvpn.net/howto.html INSTALL 1. Edit vars. 2. Set KEY_CONFIG to point to the openssl.cnf file included in this distribution. 3. Set KEY_DIR to point to a directory which will contain all keys, certificates, etc. This directory need not exist, and if it does, it will be deleted with rm -rf, so BE CAREFUL how you set KEY_DIR. 4. (Optional) Edit other fields in vars per your site data. You may want to increase KEY_SIZE to 2048 if you are paranoid and don't mind slower key processing, but certainly 1024 is fine for testing purposes. KEY_SIZE must be compatible across both peers participating in a secure SSL/TLS connection. 5 . vars 6. ./clean-all 7. As you create certificates, keys, and certificate signing requests, understand that only .key files should be kept confidential. .crt and .csr files can be sent over insecure channels such as plaintext email. 8. You should never need to copy a .key file between computers. Normally each computer will have its own certificate/key pair. BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY 1. ./build-ca 2. ca.crt and ca.key will be built in your KEY_DIR directory BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) 1. ./build-inter inter 2. inter.crt and inter.key will be built in your KEY_DIR directory and signed with your root certificate. BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). 1. ./build-dh BUILD A CERTIFICATE SIGNING REQUEST (If you want to sign your certificate with a root certificate controlled by another individual or organization, or residing on a different machine). 1. Get ca.crt (the root certificate) from your certificate authority. Though this transfer can be over an insecure channel, to prevent man-in-the-middle attacks you must confirm that ca.crt was not tampered with. Large CAs solve this problem by hardwiring their root certificates into popular web browsers. A simple way to verify a root CA is to call the issuer on the telephone and confirm that the md5sum or sha1sum signatures on the ca.crt files match (such as with the command: "md5sum ca.crt"). 2. Choose a name for your certificate such as your computer name. In our example we will use "mycert". 3. ./build-req mycert 4. You can ignore most of the fields, but set "Common Name" to something unique such as your computer's host name. Leave all password fields blank, unless you want your private key to be protected by password. Using a password is not required -- it will make your key more secure but also more inconvenient to use, because you will need to supply your password anytime the key is used. NOTE: if you are using a password, use ./build-req-pass instead of ./build-req 5. Your key will be written to $KEY_DIR/mycert.key 6. Your certificate signing request will be written to to $KEY_DIR/mycert.csr 7. Email mycert.csr to the individual or organization which controls the root certificate. This can be done over an insecure channel. 8. After the .csr file is signed by the root certificate authority, you will receive a file mycert.crt (your certificate). Place mycert.crt in your KEY_DIR directory. 9. The combined files of mycert.crt, mycert.key, and ca.crt can now be used to secure one end of an SSL/TLS connection. SIGN A CERTIFICATE SIGNING REQUEST 1. ./sign-req mycert 2. mycert.crt will be built in your KEY_DIR directory using mycert.csr and your root CA file as input. BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY -- this script generates and signs a certificate in one step, but it requires that the generated certificate and private key files be copied to the destination host over a secure channel. 1. ./build-key mycert (no password protection) 2. OR ./build-key-pass mycert (with password protection) 3. OR ./build-key-pkcs12 mycert (PKCS #12 format) 4. OR ./build-key-server mycert (with nsCertType=server) 5. mycert.crt and mycert.key will be built in your KEY_DIR directory, and mycert.crt will be signed by your root CA. If ./build-key-pkcs12 was used a mycert.p12 file will also be created including the private key, certificate and the ca certificate. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. (4) Sign server certificates with one CA and client certificates with a different CA. The client config "ca" directive should reference the server-signing CA while the server config "ca" directive should reference the client-signing CA. NOTES Show certificate fields: openssl x509 -in cert.crt -text </pre> <pre> # cd easy-rsa # vi vars . vars ./clean-all ## BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY ./build.ca ## BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) ./build-inter inter ## BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). ./build.dh ## BUILD A CERTIFICATE SIGNING REQUEST ## (If you want to sign your certificate with a root certificate controlled by another individual ## or organization, or residing on a different machine) ./build-req mycert ## SIGN A CERTIFICATE SIGNING REQUEST ./sign-req mycert ## BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY ./build-key mycert (no password protection) OR ./build-key-pass mycert (with password protection) OR ./build-key-pkcs12 mycert (PKCS #12 format) OR ./build-key-server mycert (with nsCertType=server) </pre> ==Configuring the Server== Edit the server.conf file: '''''vi /etc/openvpn/server.conf''''' <pre> ## Mode Server mode server ## Local Host Name/IP Server ;local 127.0.0.1 ## Protocol ;proto tcp proto udp ## Port ; port 1194 ## Device Interface ;dev tap dev tun ## TAP-Win32 adapter name ;dev-node MyTap ## SSL/TLS ## root certificate (ca) ## certificate (cert) ## private key (key) ca /etc/openvpn/certs/ca.crt cert /etc/openvpn/certs/server.crt key /etc/openvpn/certs/server.key ## Diffie hellman parameters dh dh1024.pem ## VPN subnet server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt ##ethernet bridging ;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100 ## dhcpcaveats ;push "route 192.168.10.0 255.255.255.0" ;push "route 192.168.20.0 255.255.255.0" ;client-config-dir ccd ;route 192.168.40.128 255.255.255.248 ;client-config-dir ccd ;route 10.9.0.0 255.255.255.252 ;learn-address ./script ## dhcpcaveats ;push "redirect-gateway" ;push "dhcp-option DNS 10.8.0.1" ;push "dhcp-option WINS 10.8.0.1" ## ;client-to-client ## same "COMMON NAME" certificate/key ;duplicate-cn ## Status Connection keepalive 10 120 ## tls-auth key ;tls-auth ta.key 0 ## Cryptographic cipher ;cipher BF-CBC # Blowfish (default) ;cipher AES-128-CBC # AES ;cipher DES-EDE3-CBC # Triple-DES ## Link Compresion comp-lzo ## Max Client Connections ;max-clients 100 ## daemon privileges (non windows saja) user nobody group nobody persist-key persist-tun ## Openvpn Log ;log /var/log/openvpn/openvpn.log ;log-append /var/log/openvpn/openvpn.log ## Output Log status /var/log/openvpn/openvpn-status.log ## Log Verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## Repeating Messages ;mute 20 ## Pid File writepid /var/run/openvpn.pid </pre> '''Routing''' <pre> echo 1 > /proc/sys/net/ipv4/ip_forward route add -net 10.0.1.0 netmask 255.255.255.0 gw 10.4.0.2 </pre> '''Firewall''' <pre> iptables -A INPUT -p udp -s 1.2.3.4 --dport 1194 -j ACCEPT OR iptables -A INPUT -p udp --dport 1194 -j ACCEPT ## Tun Device iptables -A INPUT -i tun+ -j ACCEPT iptables -A FORWARD -i tun+ -j ACCEPT ## Tap Device iptables -A INPUT -i tap+ -j ACCEPT iptables -A FORWARD -i tap+ -j ACCEPT </pre> ==Configuring the Client== Edit the client.conf file with vi '''''vi /etc/openvpn/client.conf''''' <pre> ## Config client ## Device Interface ;dev tap dev tun ## Tap adapter name (Win only) ;dev-node MyTap ## Conectivity ;proto tcp proto udp ## Server [hostname/ip] [port] remote my-server-1 1194 ;remote my-server-2 1194 ## load-balancing ;remote-random ## resolve host name OpenVPN server resolv-retry infinite # local port nobind ## privileges (non windows saja) user nobody group nobody ## preserve persist-key persist-tun ## HTTP proxy ;http-proxy-retry ;http-proxy [proxy server] [proxy port] ## duplicate packet warnings ;mute-replay-warnings ## SSL/TLS parms /etc/openvpn/certs/ca ca.crt /etc/openvpn/certs/cert client.crt /etc/openvpn/certs/key client.key ## nsCertType key ;ns-cert-type server ## tls-auth key ;tls-auth /etc/openvpn/certs/ta.key 1 ## Cryptographic cipher ;cipher x ## Link compression comp-lzo ## verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## repeating messages ;mute 20 </pre> '''Routing''' <pre> route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.4.0.1 </pre> ==Example== '''Example 1:''' A simple tunnel without security<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9 </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 2:''' A tunnel with static-key security (i.e. using a pre-shared secret)<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --verb 5 --secret key </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --verb 5 --secret key </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 3:''' A tunnel with full TLS-based security <br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --tls-client --ca tmp-ca.crt --cert client.crt --key client.key \ --reneg-sec 60 --verb 5 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --tls-server --ca tmp-ca.crt --cert server.crt --key server.key \ --reneg-sec 60 --verb 5 --dh dh1024.pem </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 == External Links == * http://dmalloc.com/ * http://valgrind.org/ * http://www.oberhumer.com/opensource/lzo/ * http://openvpn.net/ * http://openvpn.net/howto.html * http://openvpn.net/1xhowto.html (Old-v1.06) * http://openvpn.net/man.html 7b9043410e28cfdc391434c89d54809e144ccff4 268 267 2009-12-01T17:19:13Z Seekret 59 /* Configuring the Client */ wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] As a user-space VPN daemon, OpenVPN is compatible with with SSL/TLS, RSA Certificates and X509 PKI, NAT, DHCP, and TUN/TAP virtual devices. OpenVPN is not compatible with IPSec, IKE, PPTP, or L2TP. __TOC__ == Installation == Download source from [http://openvpn.net openvpn.net] Download verison 2.0 install Lzo <pre> tar zxvf lzo-1.08.tar.gz cd lzo-1-08.tar.gz ./configure --prefix=/usr make ; make install-strip </pre> install OpenVPN <pre> tar zxvf openvpn-2.0.tar.gz cd openvpn-2.0 ./configure --prefix=/usr \ --sysconfdir=/etc/openvpn \ --enable-pthread \ --enable-iproute2 \ --with-ssl \ --with-lzo-header=/usr/include \ --with-lzo-lib=/usr/lib \ --with-ifconfig \ --with-route \ --with-mem-check=dmalloc make ; make install-strip </pre> == Configuration == ==Configuring Certificates== Save all certificates in '''''/etc/openvpn/certs''''' <pre> This is a small RSA key management package, based on the openssl command line tool, that can be found in the easy-rsa subdirectory of the OpenVPN distribution. These are reference notes. For step by step instructions, see the HOWTO: http://openvpn.net/howto.html INSTALL 1. Edit vars. 2. Set KEY_CONFIG to point to the openssl.cnf file included in this distribution. 3. Set KEY_DIR to point to a directory which will contain all keys, certificates, etc. This directory need not exist, and if it does, it will be deleted with rm -rf, so BE CAREFUL how you set KEY_DIR. 4. (Optional) Edit other fields in vars per your site data. You may want to increase KEY_SIZE to 2048 if you are paranoid and don't mind slower key processing, but certainly 1024 is fine for testing purposes. KEY_SIZE must be compatible across both peers participating in a secure SSL/TLS connection. 5 . vars 6. ./clean-all 7. As you create certificates, keys, and certificate signing requests, understand that only .key files should be kept confidential. .crt and .csr files can be sent over insecure channels such as plaintext email. 8. You should never need to copy a .key file between computers. Normally each computer will have its own certificate/key pair. BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY 1. ./build-ca 2. ca.crt and ca.key will be built in your KEY_DIR directory BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) 1. ./build-inter inter 2. inter.crt and inter.key will be built in your KEY_DIR directory and signed with your root certificate. BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). 1. ./build-dh BUILD A CERTIFICATE SIGNING REQUEST (If you want to sign your certificate with a root certificate controlled by another individual or organization, or residing on a different machine). 1. Get ca.crt (the root certificate) from your certificate authority. Though this transfer can be over an insecure channel, to prevent man-in-the-middle attacks you must confirm that ca.crt was not tampered with. Large CAs solve this problem by hardwiring their root certificates into popular web browsers. A simple way to verify a root CA is to call the issuer on the telephone and confirm that the md5sum or sha1sum signatures on the ca.crt files match (such as with the command: "md5sum ca.crt"). 2. Choose a name for your certificate such as your computer name. In our example we will use "mycert". 3. ./build-req mycert 4. You can ignore most of the fields, but set "Common Name" to something unique such as your computer's host name. Leave all password fields blank, unless you want your private key to be protected by password. Using a password is not required -- it will make your key more secure but also more inconvenient to use, because you will need to supply your password anytime the key is used. NOTE: if you are using a password, use ./build-req-pass instead of ./build-req 5. Your key will be written to $KEY_DIR/mycert.key 6. Your certificate signing request will be written to to $KEY_DIR/mycert.csr 7. Email mycert.csr to the individual or organization which controls the root certificate. This can be done over an insecure channel. 8. After the .csr file is signed by the root certificate authority, you will receive a file mycert.crt (your certificate). Place mycert.crt in your KEY_DIR directory. 9. The combined files of mycert.crt, mycert.key, and ca.crt can now be used to secure one end of an SSL/TLS connection. SIGN A CERTIFICATE SIGNING REQUEST 1. ./sign-req mycert 2. mycert.crt will be built in your KEY_DIR directory using mycert.csr and your root CA file as input. BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY -- this script generates and signs a certificate in one step, but it requires that the generated certificate and private key files be copied to the destination host over a secure channel. 1. ./build-key mycert (no password protection) 2. OR ./build-key-pass mycert (with password protection) 3. OR ./build-key-pkcs12 mycert (PKCS #12 format) 4. OR ./build-key-server mycert (with nsCertType=server) 5. mycert.crt and mycert.key will be built in your KEY_DIR directory, and mycert.crt will be signed by your root CA. If ./build-key-pkcs12 was used a mycert.p12 file will also be created including the private key, certificate and the ca certificate. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. (4) Sign server certificates with one CA and client certificates with a different CA. The client config "ca" directive should reference the server-signing CA while the server config "ca" directive should reference the client-signing CA. NOTES Show certificate fields: openssl x509 -in cert.crt -text </pre> <pre> # cd easy-rsa # vi vars . vars ./clean-all ## BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY ./build.ca ## BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) ./build-inter inter ## BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). ./build.dh ## BUILD A CERTIFICATE SIGNING REQUEST ## (If you want to sign your certificate with a root certificate controlled by another individual ## or organization, or residing on a different machine) ./build-req mycert ## SIGN A CERTIFICATE SIGNING REQUEST ./sign-req mycert ## BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY ./build-key mycert (no password protection) OR ./build-key-pass mycert (with password protection) OR ./build-key-pkcs12 mycert (PKCS #12 format) OR ./build-key-server mycert (with nsCertType=server) </pre> ==Configuring the Server== Edit the server.conf file: '''''vi /etc/openvpn/server.conf''''' <pre> ## Mode Server mode server ## Local Host Name/IP Server ;local 127.0.0.1 ## Protocol ;proto tcp proto udp ## Port ; port 1194 ## Device Interface ;dev tap dev tun ## TAP-Win32 adapter name ;dev-node MyTap ## SSL/TLS ## root certificate (ca) ## certificate (cert) ## private key (key) ca /etc/openvpn/certs/ca.crt cert /etc/openvpn/certs/server.crt key /etc/openvpn/certs/server.key ## Diffie hellman parameters dh dh1024.pem ## VPN subnet server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt ##ethernet bridging ;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100 ## dhcpcaveats ;push "route 192.168.10.0 255.255.255.0" ;push "route 192.168.20.0 255.255.255.0" ;client-config-dir ccd ;route 192.168.40.128 255.255.255.248 ;client-config-dir ccd ;route 10.9.0.0 255.255.255.252 ;learn-address ./script ## dhcpcaveats ;push "redirect-gateway" ;push "dhcp-option DNS 10.8.0.1" ;push "dhcp-option WINS 10.8.0.1" ## ;client-to-client ## same "COMMON NAME" certificate/key ;duplicate-cn ## Status Connection keepalive 10 120 ## tls-auth key ;tls-auth ta.key 0 ## Cryptographic cipher ;cipher BF-CBC # Blowfish (default) ;cipher AES-128-CBC # AES ;cipher DES-EDE3-CBC # Triple-DES ## Link Compresion comp-lzo ## Max Client Connections ;max-clients 100 ## daemon privileges (non windows saja) user nobody group nobody persist-key persist-tun ## Openvpn Log ;log /var/log/openvpn/openvpn.log ;log-append /var/log/openvpn/openvpn.log ## Output Log status /var/log/openvpn/openvpn-status.log ## Log Verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## Repeating Messages ;mute 20 ## Pid File writepid /var/run/openvpn.pid </pre> '''Routing''' <pre> echo 1 > /proc/sys/net/ipv4/ip_forward route add -net 10.0.1.0 netmask 255.255.255.0 gw 10.4.0.2 </pre> '''Firewall''' <pre> iptables -A INPUT -p udp -s 1.2.3.4 --dport 1194 -j ACCEPT OR iptables -A INPUT -p udp --dport 1194 -j ACCEPT ## Tun Device iptables -A INPUT -i tun+ -j ACCEPT iptables -A FORWARD -i tun+ -j ACCEPT ## Tap Device iptables -A INPUT -i tap+ -j ACCEPT iptables -A FORWARD -i tap+ -j ACCEPT </pre> ==Configuring the Client== Edit the client.conf file: '''''vi /etc/openvpn/client.conf''''' <pre> ## Config client ## Device Interface ;dev tap dev tun ## Tap adapter name (Win only) ;dev-node MyTap ## Conectivity ;proto tcp proto udp ## Server [hostname/ip] [port] remote my-server-1 1194 ;remote my-server-2 1194 ## load-balancing ;remote-random ## resolve host name OpenVPN server resolv-retry infinite # local port nobind ## privileges (non windows saja) user nobody group nobody ## preserve persist-key persist-tun ## HTTP proxy ;http-proxy-retry ;http-proxy [proxy server] [proxy port] ## duplicate packet warnings ;mute-replay-warnings ## SSL/TLS parms /etc/openvpn/certs/ca ca.crt /etc/openvpn/certs/cert client.crt /etc/openvpn/certs/key client.key ## nsCertType key ;ns-cert-type server ## tls-auth key ;tls-auth /etc/openvpn/certs/ta.key 1 ## Cryptographic cipher ;cipher x ## Link compression comp-lzo ## verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## repeating messages ;mute 20 </pre> '''Routing''' <pre> route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.4.0.1 </pre> ==Example== '''Example 1:''' A simple tunnel without security<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9 </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 2:''' A tunnel with static-key security (i.e. using a pre-shared secret)<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --verb 5 --secret key </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --verb 5 --secret key </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 3:''' A tunnel with full TLS-based security <br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --tls-client --ca tmp-ca.crt --cert client.crt --key client.key \ --reneg-sec 60 --verb 5 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --tls-server --ca tmp-ca.crt --cert server.crt --key server.key \ --reneg-sec 60 --verb 5 --dh dh1024.pem </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 == External Links == * http://dmalloc.com/ * http://valgrind.org/ * http://www.oberhumer.com/opensource/lzo/ * http://openvpn.net/ * http://openvpn.net/howto.html * http://openvpn.net/1xhowto.html (Old-v1.06) * http://openvpn.net/man.html 52333963aecd5c87f7ae948650847baa21b86ca2 Talk:OpenVPN(EN) 1 198 269 2009-12-01T17:21:45Z Seekret 59 Created page with 'This is an English version of the existing OpenVPN file. I simply translated the instructions with Google Translate and made the translation grammatically correct.' wikitext text/x-wiki This is an English version of the existing OpenVPN file. I simply translated the instructions with Google Translate and made the translation grammatically correct. 0d092baf93eb939908209483fc2d19f9a3c5521b Writing A SlackBuild Script 0 16 273 22 2009-12-14T19:30:00Z SiegeX 64 /* Initial Setup */ wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like linuxpackages.net, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/latex2html-2002-2-1.tar.gz # 05.02.2005 Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar -xzf latex2html-2002-2-1.tar.gz || exit 1 = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ ;* http://www.slackbuilds.net/slackbuilds/ ;* http://slackbuild.strangeworlds.co.uk/ ;* http://www2.linuxpackages.net/packages/SlackBuilds/ ;* http://www.selkfoster.com.ar/downloads/slackbuilds/ ;* http://slack.sarava.org/slackbuilds/ 292b77163684b3b1836f33a1053ee77516b47303 RAID Array (Hardware) 0 137 276 163 2010-01-09T01:01:16Z Arfon 70 /* My Card Is In, Now What? */ ADDED the fact that this was with Slackware 10 wikitext text/x-wiki [[Category:Tips]] [[Category:Tutorials]] [[Category:Hardware]] ==My Card Is In, Now What?== -Written from a Slackware 10 perspective- 1) SET UP THE ARRAY- If you are using a hardware RAID card (like ones made by 3ware), on boot you must enter the card's BIOS and set up your array. This is done by hitting a hotkey (ALT-3 for 3ware cards). Read your card's instructions for details on how to configure your array. 2) BOOT WITH THE CORRECT KERNEL- After you have set up your array, boot the computer with the Slackware Install CD (CD1) like normal. <b>At the <code>boot:</code> prompt, choose a RAID supporting image (e.g. <code>raid.s</code>).</b> YOU CAN NOT USE THE DEFAULT KERNEL (bare.i) to boot into set-up, you have to use a boot kernel that supports RAID arrays. :EXAMPLE: <code>boot: raid.s</code> 3) PROCEED NORMALLY- Once you boot the RAID kernel, everything else proceeds normally except the hard-drive is (usually) <code>/dev/sda</code>. Go ahead set up your partitions (<code>fdisk /dev/sda</code>) and continue the normal Slackware install. ==FAQs== Q: What device is my RAID array?<br> A: You are most likely running RAID.S kernel so therefore it is probably <code>/dev/sda</code> Q: It's not <code>/dev/sda</code> where is it really?<br> A: I don't know. Reboot your machine and watch the messages scroll by. If you don't see the info, you don't have RAID support compiled into your kernel or as a module and you need to fix that. Q: My system has a [[forced fsck]] and it starts but after awhile, it resets and re-boots. How do I fix this?<br> A: Re-boot the system using a Slackware install CD (make sure you boot with a RAID kernel) then get to a command line prompt and manually run <code>fsck</code>. : EXAMPLE: <code>fsck -p /dev/sda1</code> Q: I'm trying to run <code>fsck</code> manually but I get an "<code>The superblock cannot be read...</code>" error. How do I fix this?<br> A: MOST LIKELY, you're not running a RAID supporting kernel. Re-boot and choose a RAID kernel like <code>raid.s</code>. Q: I'm running <code>fsck</code> manually and I am getting a "<code>error allocating inode bitmap (2)</code>". How do I fix this?<br> A: No clue. I haven't been able to find out what that means. If you do, let us know please. ==Hardware RAID Specific Help== [[3ware 3DM2]] - Help with 3ware's 3DM2 program. ==Hardware RAID Specific Help== [[3ware 3ware 8006-2LP Installation]] - Installed slackware 12.2 with the 3ware 8006-2LP card today. I chose this hardware due to the fanfare I found on the net. It is supported with RedHat and Suse (presumably because they have a preinstall driver installation dialog) Installing with slack was not as easy as was hoped. Lilo choked twice, first by installing to the MBR which the 3ware bios simply didn't see, and second after installing to the root partition, lilo complained with error 99 which is apparently a BIOS disk address mismatch of some sort. What worked was this: 1. Install the card, or receive the machine with the card already installed. 2. Double check that all your cable connections are tight. mine were loose when the chassis arrived from the vendor. I am sincerely glad I found this now rather than later. 3. Slackware 12.2 has the 3ware driver in it, so it should boot from CD and see the disk as: /dev/sda 4. fdisk /dev/sda and create some partitions, mine are as follows: /dev/sda1 50G (/ this is the root partition) set bootable /dev/sda2 2G (for /boot) /dev/sda3 2G ( for swap) toggle to type 82 /dev/sda4 (extended) /dev/sda5 25G (for /var) /dev/sda6 25G (for /home) /dev/sda7 50G (for the webserver) /dev/sda8 50G (for the database) /dev/sda9 10G (for source code) You will note seperate /boot and /home partitions. Configuring the disk this way adds some security, which we will discuss in a moment. 5. Run setup and select your packages. 6. Do the configuration dialog: Generally I believe all network enabled devices should be on UTC so I set both system and hardware clocks accordingly. ignore gpm, ignore fancy fonts, and number the network interface... Then make sure the network interface _isn't_ connected. 7. Let the lilo configurator screw up lilo by select "Guess my lilo config" or whatever. 8. exit setup, DO NOT REBOOT! 9. chroot /mnt 10. vi /etc/lilo and make it point at your root partition. My lilo.conf is as follows: lba32 # any modern drive should be able to do this. boot = /dev/sda1 append = " vt.default_utf8=0" vga = normal image = /boot/vmlinuz root = /dev/sda1 Label = Linux read-only # for fscking during bootup. 11. Note above that /dev/sda1 is the root partition, or "/" if you stick it somewhere else, change as appropriate. 12. obliterate the master boot record: (prevents lilo from getting confused for some reason): lilo -z -M /dev/sda 13. run lilo and listen to it complain: lilo 14. If you don't get any fatals errors (warnings are ok), remove the cd then: exit reboot 15. Do your little chair dance, and irritate your coworkers. 16. vi /etc/fstab and adjust the following partitions: /dev/sda2 /boot ext2 defaults,ro 1 2 /dev/sda6 /home ext2 defaults,nosuid 1 2 Leave your partitions ext3 if they are configured that way, but note the addition of "ro" to /boot and "nosuid" to /home. This makes the kernel secure from modification until the next reboot, and prevents root privileged code from being executed from /home. Generally good and fairly unintrusive security policy. Now proceed onward oh great progenitors of slack. Your next steps should probably be using "find" to locate and disable most of what has a suid bit set, and then installing and configuring tripwire or some equivilant, then making a brutal set of access controls with iptables, and _then_.... _maybe_ you can connect the box to a public network. But don't take my word for it. Good Luck! 18d884c2e5392567f61331b3aa89a0335dd94c76 277 276 2010-01-09T01:03:30Z Arfon 70 /* My Card Is In, Now What? */ TYPO fix wikitext text/x-wiki [[Category:Tips]] [[Category:Tutorials]] [[Category:Hardware]] ==My Card Is In, Now What?== -Written from a Slackware 10 perspective- 1) SET UP THE ARRAY- If you are using a hardware RAID card (like ones made by 3ware), on boot you must enter the card's BIOS and set up your array. This is done by hitting a hotkey (ALT-3 for 3ware cards). Read your card's instructions for details on how to configure your array. 2) BOOT WITH THE CORRECT KERNEL- After you have set up your array, boot the computer with the Slackware Install CD (CD1) like normal. <b>At the <code>boot:</code> prompt, choose a RAID supporting image (e.g. <code>raid.s</code>).</b> YOU CAN NOT USE THE DEFAULT KERNEL (bare.i) to boot into set-up, you have to use a boot kernel that supports RAID arrays. :EXAMPLE: <code>boot: raid.s</code> '''NOTE: I don't believe STEP 2 applies to newer versions of Slackware. (e.g Slack13)''' 3) PROCEED NORMALLY- Once you boot the RAID kernel, everything else proceeds normally except the hard-drive is (usually) <code>/dev/sda</code>. Go ahead set up your partitions (<code>fdisk /dev/sda</code>) and continue the normal Slackware install. ==FAQs== Q: What device is my RAID array?<br> A: You are most likely running RAID.S kernel so therefore it is probably <code>/dev/sda</code> Q: It's not <code>/dev/sda</code> where is it really?<br> A: I don't know. Reboot your machine and watch the messages scroll by. If you don't see the info, you don't have RAID support compiled into your kernel or as a module and you need to fix that. Q: My system has a [[forced fsck]] and it starts but after awhile, it resets and re-boots. How do I fix this?<br> A: Re-boot the system using a Slackware install CD (make sure you boot with a RAID kernel) then get to a command line prompt and manually run <code>fsck</code>. : EXAMPLE: <code>fsck -p /dev/sda1</code> Q: I'm trying to run <code>fsck</code> manually but I get an "<code>The superblock cannot be read...</code>" error. How do I fix this?<br> A: MOST LIKELY, you're not running a RAID supporting kernel. Re-boot and choose a RAID kernel like <code>raid.s</code>. Q: I'm running <code>fsck</code> manually and I am getting a "<code>error allocating inode bitmap (2)</code>". How do I fix this?<br> A: No clue. I haven't been able to find out what that means. If you do, let us know please. ==Hardware RAID Specific Help== [[3ware 3DM2]] - Help with 3ware's 3DM2 program. ==Hardware RAID Specific Help== [[3ware 3ware 8006-2LP Installation]] - Installed slackware 12.2 with the 3ware 8006-2LP card today. I chose this hardware due to the fanfare I found on the net. It is supported with RedHat and Suse (presumably because they have a preinstall driver installation dialog) Installing with slack was not as easy as was hoped. Lilo choked twice, first by installing to the MBR which the 3ware bios simply didn't see, and second after installing to the root partition, lilo complained with error 99 which is apparently a BIOS disk address mismatch of some sort. What worked was this: 1. Install the card, or receive the machine with the card already installed. 2. Double check that all your cable connections are tight. mine were loose when the chassis arrived from the vendor. I am sincerely glad I found this now rather than later. 3. Slackware 12.2 has the 3ware driver in it, so it should boot from CD and see the disk as: /dev/sda 4. fdisk /dev/sda and create some partitions, mine are as follows: /dev/sda1 50G (/ this is the root partition) set bootable /dev/sda2 2G (for /boot) /dev/sda3 2G ( for swap) toggle to type 82 /dev/sda4 (extended) /dev/sda5 25G (for /var) /dev/sda6 25G (for /home) /dev/sda7 50G (for the webserver) /dev/sda8 50G (for the database) /dev/sda9 10G (for source code) You will note seperate /boot and /home partitions. Configuring the disk this way adds some security, which we will discuss in a moment. 5. Run setup and select your packages. 6. Do the configuration dialog: Generally I believe all network enabled devices should be on UTC so I set both system and hardware clocks accordingly. ignore gpm, ignore fancy fonts, and number the network interface... Then make sure the network interface _isn't_ connected. 7. Let the lilo configurator screw up lilo by select "Guess my lilo config" or whatever. 8. exit setup, DO NOT REBOOT! 9. chroot /mnt 10. vi /etc/lilo and make it point at your root partition. My lilo.conf is as follows: lba32 # any modern drive should be able to do this. boot = /dev/sda1 append = " vt.default_utf8=0" vga = normal image = /boot/vmlinuz root = /dev/sda1 Label = Linux read-only # for fscking during bootup. 11. Note above that /dev/sda1 is the root partition, or "/" if you stick it somewhere else, change as appropriate. 12. obliterate the master boot record: (prevents lilo from getting confused for some reason): lilo -z -M /dev/sda 13. run lilo and listen to it complain: lilo 14. If you don't get any fatals errors (warnings are ok), remove the cd then: exit reboot 15. Do your little chair dance, and irritate your coworkers. 16. vi /etc/fstab and adjust the following partitions: /dev/sda2 /boot ext2 defaults,ro 1 2 /dev/sda6 /home ext2 defaults,nosuid 1 2 Leave your partitions ext3 if they are configured that way, but note the addition of "ro" to /boot and "nosuid" to /home. This makes the kernel secure from modification until the next reboot, and prevents root privileged code from being executed from /home. Generally good and fairly unintrusive security policy. Now proceed onward oh great progenitors of slack. Your next steps should probably be using "find" to locate and disable most of what has a suid bit set, and then installing and configuring tripwire or some equivilant, then making a brutal set of access controls with iptables, and _then_.... _maybe_ you can connect the box to a public network. But don't take my word for it. Good Luck! fd2215c672acfa131593022c6c30d0de3496639d Routing Tricks 0 204 278 2010-01-09T01:27:56Z Arfon 70 CREATED THIS PAGE wikitext text/x-wiki ==Weighted Routing== (aka Load Balancing, Net Balancing) '''What is Weighted Routing''' Simply put, distributing network traffic over multiple paths based on load. EXAMPLE 1: You have two DSL connections incoming and you distribute your connection traffic between them. EXAMPLE 2: You have a 1.5Mbs DSL connection and a 3MBs cable connection, therefore you set up your routing to send 1/3 of the traffic out the DSL connection and 2/3 out the cable connection. '''How do I do it?''' Niels Horn has written a slick little script to do the weighted routing for you. He has given me permission to copy it here. #!/bin/bash # # bal_local Load-balance internet connection over two local links # # Version: 1.0.0 - Fri, Sep 26, 2008 # # Author: Niels Horn <niels.horn(at symbol)gmail.com> # # # Set devices: DEV1=${1-eth0} # default eth0 DEV2=${2-ppp0} # default ppp0 # # Get IP addresses of our devices: ip1=`ifconfig $DEV1 | grep inet | awk '{ print $2 }' | awk -F: '{ print $2 }'` ip2=`ifconfig $DEV2 | grep inet | awk '{ print $2 }' | awk -F: '{ print $2 }'` # # Get default gateway for our devices: gw1=`route -n | grep $DEV1 | grep '^0.0.0.0' | awk '{ print $2 }'` gw2=`route -n | grep $DEV2 | grep '^0.0.0.0' | awk '{ print $2 }'` # echo "$DEV1: IP=$ip1 GW=$gw1" echo "$DEV2: IP=$ip2 GW=$gw2" # ### Definition of routes ### # # Check if tables exists, if not -> create them: if [ -z "`cat /etc/iproute2/rt_tables | grep '^251'`" ] ; then echo "251 rt_dev1" >> /etc/iproute2/rt_tables fi if [ -z "`cat /etc/iproute2/rt_tables | grep '^252'`" ] ; then echo "252 rt_dev2" >> /etc/iproute2/rt_tables fi # # Define routing tables: ip route add default via $gw1 table rt_dev1 ip route add default via $gw2 table rt_dev2 # # Create rules: ip rule add from $ip1 table rt_dev1 ip rule add from $ip2 table rt_dev2 # # If we already have a 'nexthop' route, delete it: if [ ! -z "`ip route show table main | grep 'nexthop'`" ] ; then ip route del default scope global fi # # Balance links based on routes: ip route add default scope global nexthop via $gw1 dev $DEV1 weight 1 nexthop via $gw2 dev $DEV2 weight 1 # # Flush cache table: ip route flush cache # # All done... To use the script, copy it to /usr/local/bin, make it executable with 'chmod +x' and call it with: Code: bal_local <dev1> <dev2> filling in <dev1> and <dev2> with your network-devices. If you call the script without any parameters, it tries to balance eth0 and ppp0 (because this works in my case ). [http://www.linuxquestions.org/questions/slackware-14/script-to-load-balance-two-isps-with-ip-route-and-ip-rules-672602 HERE IS HIS ORIGINAL POSTING] (ALSO, I copied a copy of his permission on my DISCUSSION page) 3fd8159bbe2f424a8461cec2568b5b7d949352c5 280 278 2010-01-09T01:34:53Z Arfon 70 /* Weighted Routing */ FIXED the screwed up link. And added the category wikitext text/x-wiki ==Weighted Routing== (aka Load Balancing, Net Balancing) '''What is Weighted Routing''' Simply put, distributing network traffic over multiple paths based on load. EXAMPLE 1: You have two DSL connections incoming and you distribute your connection traffic between them. EXAMPLE 2: You have a 1.5Mbs DSL connection and a 3MBs cable connection, therefore you set up your routing to send 1/3 of the traffic out the DSL connection and 2/3 out the cable connection. '''How do I do it?''' Niels Horn has written a slick little script to do the weighted routing for you. He has given me permission to copy it here. #!/bin/bash # # bal_local Load-balance internet connection over two local links # # Version: 1.0.0 - Fri, Sep 26, 2008 # # Author: Niels Horn <niels.horn(at symbol)gmail.com> # # # Set devices: DEV1=${1-eth0} # default eth0 DEV2=${2-ppp0} # default ppp0 # # Get IP addresses of our devices: ip1=`ifconfig $DEV1 | grep inet | awk '{ print $2 }' | awk -F: '{ print $2 }'` ip2=`ifconfig $DEV2 | grep inet | awk '{ print $2 }' | awk -F: '{ print $2 }'` # # Get default gateway for our devices: gw1=`route -n | grep $DEV1 | grep '^0.0.0.0' | awk '{ print $2 }'` gw2=`route -n | grep $DEV2 | grep '^0.0.0.0' | awk '{ print $2 }'` # echo "$DEV1: IP=$ip1 GW=$gw1" echo "$DEV2: IP=$ip2 GW=$gw2" # ### Definition of routes ### # # Check if tables exists, if not -> create them: if [ -z "`cat /etc/iproute2/rt_tables | grep '^251'`" ] ; then echo "251 rt_dev1" >> /etc/iproute2/rt_tables fi if [ -z "`cat /etc/iproute2/rt_tables | grep '^252'`" ] ; then echo "252 rt_dev2" >> /etc/iproute2/rt_tables fi # # Define routing tables: ip route add default via $gw1 table rt_dev1 ip route add default via $gw2 table rt_dev2 # # Create rules: ip rule add from $ip1 table rt_dev1 ip rule add from $ip2 table rt_dev2 # # If we already have a 'nexthop' route, delete it: if [ ! -z "`ip route show table main | grep 'nexthop'`" ] ; then ip route del default scope global fi # # Balance links based on routes: ip route add default scope global nexthop via $gw1 dev $DEV1 weight 1 nexthop via $gw2 dev $DEV2 weight 1 # # Flush cache table: ip route flush cache # # All done... To use the script, copy it to /usr/local/bin, make it executable with 'chmod +x' and call it with: Code: bal_local <dev1> <dev2> filling in <dev1> and <dev2> with your network-devices. If you call the script without any parameters, it tries to balance eth0 and ppp0 (because this works in my case ). [http://www.linuxquestions.org/questions/slackware-14/script-to-load-balance-two-isps-with-ip-route-and-ip-rules-672602/ HERE IS HIS ORIGINAL POSTING] (ALSO, I copied a copy of his permission on my DISCUSSION page) [[Category:Tips]] e85ee5bc100367aeefa4cebf25af7e92c81f5627 Talk:Routing Tricks 1 205 279 2010-01-09T01:29:01Z Arfon 70 Created page with 'Neils Horn's permission to repost his weighted routing info- Hi, I'm hopelessly without time these days (last days before going on vacation), so feel free to post it on slack...' wikitext text/x-wiki Neils Horn's permission to repost his weighted routing info- Hi, I'm hopelessly without time these days (last days before going on vacation), so feel free to post it on slackwiki.org for me. I would appreciate it if you could send me the link afterwards so that I can take a look :) Thanks, Niels ------------------------------------------------------------------------- 15d7010809e6d414bf7cc164619d19b0458cc8a3 User:Crudo 2 206 281 2010-01-20T01:24:57Z Crudo 71 Created page with '* Real Name: Alexandre Mulatinho * IRC Nickname: crudo, crudo|home, crudo|work :P * E-Mail: alex 'at' mulatinho.net * My Homepage: http://alex.mulatinho.net * From: Brazil I hav...' wikitext text/x-wiki * Real Name: Alexandre Mulatinho * IRC Nickname: crudo, crudo|home, crudo|work :P * E-Mail: alex 'at' mulatinho.net * My Homepage: http://alex.mulatinho.net * From: Brazil I have been using linux to about 12 years, and my first experience with Slakware was in 3.4 version, until then i use Slakware in my work, home and in all my machines :) Thanks to Slakware team! cd6e42aace5f7b2a412d9606e26c6ac654ece5cf ToshibaNB205 0 207 282 2010-01-20T02:27:02Z Crudo 71 Created page with '-NOT FINISHED- =Intro= Hello Slakers! I will talk about how to installing and use Slakware in a NB 205 from Toshiba. First of all i have to admit that i stayed really impressed...' wikitext text/x-wiki -NOT FINISHED- =Intro= Hello Slakers! I will talk about how to installing and use Slakware in a NB 205 from Toshiba. First of all i have to admit that i stayed really impressed with the design of NB205, he's fully portable and light, the screen with a 10.1" have a bad news: she only can do 1024x600 of size but not for us, slackers! ;) So before anything else, lets see some more informations about his technical specifications, down: =Technical Details = * Motherboard: Toshiba KAVAA - Chipset: Intel Callistoga-GSE i945GSE * Processor: Intel Atom N280 1.6GHz * Memory: DDR2-800/400/333/266 MHz - Comes to 1GB but you can upgrade to 2 GB. * Video: Intel GMA 950 (1280x600) * Hard Disk: 160 GB 5400 RPM SATA-II * Webcam, Bluetooth, Ether/Wifi Network gigabit, =Network Informations= If you want to use WPA/PSK: <pre>wpa_passphrase <ESSID> <Passphrase> # wpa_passphrase house littled0g > /etc/wpa_supplicant.conf.home </pre> If you see the file '/etc/wpa_supplicant.conf.home' <pre>network={ ssid="house" #psk="littled0g" psk=9dbaaf7031fd8cbc03674337ee9c724b65811b36546d2234676060b4144872b8 }</pre> 5463f63af4a51ec005181c8446cab08111180064 283 282 2010-01-20T02:31:47Z Crudo 71 /* Technical Details */ wikitext text/x-wiki -NOT FINISHED- =Intro= Hello Slakers! I will talk about how to installing and use Slakware in a NB 205 from Toshiba. First of all i have to admit that i stayed really impressed with the design of NB205, he's fully portable and light, the screen with a 10.1" have a bad news: she only can do 1024x600 of size but not for us, slackers! ;) So before anything else, lets see some more informations about his technical specifications, down: =Technical Details = * Motherboard: Toshiba KAVAA - Chipset: Intel Callistoga-GSE i945GSE * Processor: Intel Atom N280 1.6GHz * Memory: DDR2-800/400/333/266 MHz - Comes to 1GB but you can upgrade to 2 GB. * Video: Intel GMA 950 (1280x600) * Hard Disk: 160 GB 5400 RPM SATA-II * Webcam, Bluetooth, Ether/Wifi Network gigabit, PCI Devices: <pre># lspci 00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02) 00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02) 00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02) 00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02) 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2) 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02) 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02) 00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02) 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)</pre> USB Devices <pre># lsusb Bus 001 Device 002: ID 04f2:b128 Chicony Electronics Co., Ltd Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre> Hard Disk <pre># fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x91c391c3</pre> =Network Informations= If you want to use WPA/PSK: <pre>wpa_passphrase <ESSID> <Passphrase> # wpa_passphrase house littled0g > /etc/wpa_supplicant.conf.home </pre> If you see the file '/etc/wpa_supplicant.conf.home' <pre>network={ ssid="house" #psk="littled0g" psk=9dbaaf7031fd8cbc03674337ee9c724b65811b36546d2234676060b4144872b8 }</pre> 03e702cd395150eb14b42ca615ea1442f4862dc9 284 283 2010-01-20T02:46:43Z Crudo 71 wikitext text/x-wiki -NOT FINISHED- =Intro= Hello Slakers! I will talk about how to installing and use Slakware in a NB 205 from Toshiba. First of all i have to admit that i stayed really impressed with the design of NB205, he's fully portable and light, the screen with a 10.1" have a bad news: she only can do 1024x600 of size but not for us, slackers! ;) So before anything else, lets see some more informations about his technical specifications, down: =Technical Details = * Motherboard: Toshiba KAVAA - Chipset: Intel Callistoga-GSE i945GSE * Processor: Intel Atom N280 1.6GHz * Memory: DDR2-800/400/333/266 MHz - Comes to 1GB but you can upgrade to 2 GB. * Video: Intel GMA 950 (1280x600) * Hard Disk: 160 GB 5400 RPM SATA-II * Webcam, Bluetooth, Ether/Wifi Network gigabit, ==CPU== <pre># cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N280 @ 1.66GHz stepping : 2 cpu MHz : 1000.000 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm lahf_lm bogomips : 3325.16 clflush size : 64 power management:</pre> ==PCI Devices== <pre># lspci 00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02) 00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02) 00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02) 00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02) 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2) 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02) 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02) 00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02) 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)</pre> ==USB Devices== <pre># lsusb Bus 001 Device 002: ID 04f2:b128 Chicony Electronics Co., Ltd Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre> ==Hard Disk== <pre># fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x91c391c3</pre> =Network Informations= * 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) * 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02) With those cards the netbook can give a improve in network performance and will grow like a little monster in your network, with a wifi module called 'ath9k' and network module called 'r8169' they can do great things :) ==Bluetooth== ==Ethernet== ==Wifi== If you want to use WPA/PSK: <pre>wpa_passphrase <ESSID> <Passphrase> # wpa_passphrase house littled0g > /etc/wpa_supplicant.conf.home </pre> If you see the file '/etc/wpa_supplicant.conf.home' <pre>network={ ssid="house" #psk="littled0g" psk=9dbaaf7031fd8cbc03674337ee9c724b65811b36546d2234676060b4144872b8 }</pre> =Tests of Performance= =My Opinion About the Slakware in this Netbook= 657989bda2c9efec444373d55bc936616996c942 285 284 2010-01-20T02:48:06Z Crudo 71 wikitext text/x-wiki -NOT FINISHED- =Intro= Hello Slakers! I will talk about how to installing and use Slakware in a NB 205 from Toshiba. First of all i have to admit that i stayed really impressed with the design of NB205, he's fully portable and light, the screen with a 10.1" have a bad news: she only can do 1024x600 of size but not for us, slackers! ;) So before anything else, lets see some more informations about his technical specifications, down: =Technical Details = * Motherboard: Toshiba KAVAA - Chipset: Intel Callistoga-GSE i945GSE * Processor: Intel Atom N280 1.6GHz * Memory: DDR2-800/400/333/266 MHz - Comes to 1GB but you can upgrade to 2 GB. * Video: Intel GMA 950 (1280x600) * Hard Disk: 160 GB 5400 RPM SATA-II * Webcam, Bluetooth, Ether/Wifi Network gigabit, CPU <pre># cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N280 @ 1.66GHz stepping : 2 cpu MHz : 1000.000 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm lahf_lm bogomips : 3325.16 clflush size : 64 power management:</pre> PCI Devices <pre># lspci 00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02) 00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02) 00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02) 00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02) 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2) 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02) 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02) 00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02) 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)</pre> USB Devices <pre># lsusb Bus 001 Device 002: ID 04f2:b128 Chicony Electronics Co., Ltd Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre> Hard Disk <pre># fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x91c391c3</pre> =Network Informations= * 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) * 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02) With those cards the netbook can give a improve in network performance and will grow like a little monster in your network, with a wifi module called 'ath9k' and network module called 'r8169' they can do great things :) ==Bluetooth== ==Ethernet== ==Wifi== If you want to use WPA/PSK: <pre>wpa_passphrase <ESSID> <Passphrase> # wpa_passphrase house littled0g > /etc/wpa_supplicant.conf.home </pre> If you see the file '/etc/wpa_supplicant.conf.home' <pre>network={ ssid="house" #psk="littled0g" psk=9dbaaf7031fd8cbc03674337ee9c724b65811b36546d2234676060b4144872b8 }</pre> =Tests of Performance= =My Opinion About the Slakware in this Netbook= 4b5ea9344e6d03167c2931ec8789cf462ed46c46 286 285 2010-01-20T03:03:35Z Crudo 71 wikitext text/x-wiki -NOT FINISHED- =Intro= Hello Slakers! I will talk about how to installing and use Slakware in a NB 205 from Toshiba. First of all i have to admit that i stayed really impressed with the design of NB205, he's fully portable and light, the screen with a 10.1" have a bad news: she only can do 1024x600 of size but not for us, slackers! ;) So before anything else, lets see some more informations about his technical specifications, down: =Technical Details = * Motherboard: Toshiba KAVAA - Chipset: Intel Callistoga-GSE i945GSE * Processor: Intel Atom N280 1.6GHz * Memory: DDR2-800/400/333/266 MHz - Comes to 1GB but you can upgrade to 2 GB. * Video: Intel GMA 950 (1280x600) * Hard Disk: 160 GB 5400 RPM SATA-II * Webcam, Bluetooth, Ether/Wifi Network gigabit, Battery Life is 8 Hours!!! CPU <pre># cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N280 @ 1.66GHz stepping : 2 cpu MHz : 1000.000 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm lahf_lm bogomips : 3325.16 clflush size : 64 power management:</pre> PCI Devices <pre># lspci 00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02) 00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02) 00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02) 00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02) 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2) 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02) 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02) 00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02) 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)</pre> USB Devices <pre># lsusb Bus 001 Device 002: ID 04f2:b128 Chicony Electronics Co., Ltd Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre> Hard Disk <pre># fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x91c391c3</pre> =Netbook Slakware Configuration= ==Screen== ==Network== * 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) * 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02) With those cards the netbook can give a improve in network performance and will grow like a little monster in your network, with a wifi module called 'ath9k' and network module called 'r8169' they can do great things :) ===Bluetooth=== ===Ethernet=== ===Wifi=== If you want to use WPA/PSK: <pre>wpa_passphrase <ESSID> <Passphrase> # wpa_passphrase house littled0g > /etc/wpa_supplicant.conf.home </pre> If you see the file '/etc/wpa_supplicant.conf.home' <pre>network={ ssid="house" #psk="littled0g" psk=9dbaaf7031fd8cbc03674337ee9c724b65811b36546d2234676060b4144872b8 }</pre> =Tests of Performance= <pre># time dd bs=1k count=1000 if=/dev/urandom of=/dev/zero 1000+0 records in 1000+0 records out 1024000 bytes (1.0 MB) copied, 0.588823 s, 1.7 MB/s real 0m0.593s user 0m0.003s sys 0m0.582s # time dd bs=1k count=100000 if=/dev/urandom of=/dev/zero 100000+0 records in 100000+0 records out 102400000 bytes (102 MB) copied, 56.0481 s, 1.8 MB/s real 0m56.053s user 0m0.131s sys 0m55.874s</pre> =My Opinion About the Slakware in this Netbook= b59ca4a5f63cb31cd24332e6aa8766cd640cd112 287 286 2010-01-20T03:05:52Z Crudo 71 /* Tests of Performance */ wikitext text/x-wiki -NOT FINISHED- =Intro= Hello Slakers! I will talk about how to installing and use Slakware in a NB 205 from Toshiba. First of all i have to admit that i stayed really impressed with the design of NB205, he's fully portable and light, the screen with a 10.1" have a bad news: she only can do 1024x600 of size but not for us, slackers! ;) So before anything else, lets see some more informations about his technical specifications, down: =Technical Details = * Motherboard: Toshiba KAVAA - Chipset: Intel Callistoga-GSE i945GSE * Processor: Intel Atom N280 1.6GHz * Memory: DDR2-800/400/333/266 MHz - Comes to 1GB but you can upgrade to 2 GB. * Video: Intel GMA 950 (1280x600) * Hard Disk: 160 GB 5400 RPM SATA-II * Webcam, Bluetooth, Ether/Wifi Network gigabit, Battery Life is 8 Hours!!! CPU <pre># cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N280 @ 1.66GHz stepping : 2 cpu MHz : 1000.000 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm lahf_lm bogomips : 3325.16 clflush size : 64 power management:</pre> PCI Devices <pre># lspci 00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02) 00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02) 00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02) 00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02) 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2) 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02) 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02) 00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02) 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)</pre> USB Devices <pre># lsusb Bus 001 Device 002: ID 04f2:b128 Chicony Electronics Co., Ltd Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre> Hard Disk <pre># fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x91c391c3</pre> =Netbook Slakware Configuration= ==Screen== ==Network== * 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) * 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02) With those cards the netbook can give a improve in network performance and will grow like a little monster in your network, with a wifi module called 'ath9k' and network module called 'r8169' they can do great things :) ===Bluetooth=== ===Ethernet=== ===Wifi=== If you want to use WPA/PSK: <pre>wpa_passphrase <ESSID> <Passphrase> # wpa_passphrase house littled0g > /etc/wpa_supplicant.conf.home </pre> If you see the file '/etc/wpa_supplicant.conf.home' <pre>network={ ssid="house" #psk="littled0g" psk=9dbaaf7031fd8cbc03674337ee9c724b65811b36546d2234676060b4144872b8 }</pre> =Tests of Performance= <pre># time dd bs=1k count=1000 if=/dev/urandom of=/dev/zero 1000+0 records in 1000+0 records out 1024000 bytes (1.0 MB) copied, 0.588823 s, 1.7 MB/s real 0m0.593s user 0m0.003s sys 0m0.582s # time dd bs=1k count=100000 if=/dev/urandom of=/dev/zero 100000+0 records in 100000+0 records out 102400000 bytes (102 MB) copied, 56.0481 s, 1.8 MB/s real 0m56.053s user 0m0.131s sys 0m55.874s # time dd bs=1k count=200000 if=/dev/urandom of=/tmp/mkshit 100000+0 records in 100000+0 records out 204800000 bytes (205 MB) copied, 120.184 s, 1.7 MB/s real 2m0.189s user 0m0.445s sys 1m58.237s</pre> =My Opinion About the Slakware in this Netbook= 527384379dd0022e9d535e994e67c1d5902abc02 288 287 2010-01-20T03:14:30Z Crudo 71 /* Bluetooth */ wikitext text/x-wiki -NOT FINISHED- =Intro= Hello Slakers! I will talk about how to installing and use Slakware in a NB 205 from Toshiba. First of all i have to admit that i stayed really impressed with the design of NB205, he's fully portable and light, the screen with a 10.1" have a bad news: she only can do 1024x600 of size but not for us, slackers! ;) So before anything else, lets see some more informations about his technical specifications, down: =Technical Details = * Motherboard: Toshiba KAVAA - Chipset: Intel Callistoga-GSE i945GSE * Processor: Intel Atom N280 1.6GHz * Memory: DDR2-800/400/333/266 MHz - Comes to 1GB but you can upgrade to 2 GB. * Video: Intel GMA 950 (1280x600) * Hard Disk: 160 GB 5400 RPM SATA-II * Webcam, Bluetooth, Ether/Wifi Network gigabit, Battery Life is 8 Hours!!! CPU <pre># cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N280 @ 1.66GHz stepping : 2 cpu MHz : 1000.000 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm lahf_lm bogomips : 3325.16 clflush size : 64 power management:</pre> PCI Devices <pre># lspci 00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02) 00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02) 00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02) 00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02) 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2) 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02) 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02) 00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02) 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)</pre> USB Devices <pre># lsusb Bus 001 Device 002: ID 04f2:b128 Chicony Electronics Co., Ltd Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre> Hard Disk <pre># fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x91c391c3</pre> =Netbook Slakware Configuration= ==Screen== ==Network== * 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) * 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02) With those cards the netbook can give a improve in network performance and will grow like a little monster in your network, with a wifi module called 'ath9k' and network module called 'r8169' they can do great things :) ===Bluetooth=== To get things done you will need to download the 'omnibook' package and compile in your slackware version. Once you do it you can follow these commands to test your connection: <pre># modprobe -v omnibook insmod /lib/modules/2.6.29.6-smp/extra/omnibook.ko ectype=12 userset=1 wifi=1 bluetooth=1 # hciconfig hci0: Type: USB BD Address: 00:22:58:FF:C2:DC ACL MTU: 310:10 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:692 acl:0 sco:0 events:24 errors:0 TX bytes:581 acl:0 sco:0 commands:24 errors:0 # hcitool scan Scanning ... 00:21:FC:B1:AC:97 Rosangela</pre> ===Ethernet=== ===Wifi=== If you want to use WPA/PSK: <pre>wpa_passphrase <ESSID> <Passphrase> # wpa_passphrase house littled0g > /etc/wpa_supplicant.conf.home </pre> If you see the file '/etc/wpa_supplicant.conf.home' <pre>network={ ssid="house" #psk="littled0g" psk=9dbaaf7031fd8cbc03674337ee9c724b65811b36546d2234676060b4144872b8 }</pre> =Tests of Performance= <pre># time dd bs=1k count=1000 if=/dev/urandom of=/dev/zero 1000+0 records in 1000+0 records out 1024000 bytes (1.0 MB) copied, 0.588823 s, 1.7 MB/s real 0m0.593s user 0m0.003s sys 0m0.582s # time dd bs=1k count=100000 if=/dev/urandom of=/dev/zero 100000+0 records in 100000+0 records out 102400000 bytes (102 MB) copied, 56.0481 s, 1.8 MB/s real 0m56.053s user 0m0.131s sys 0m55.874s # time dd bs=1k count=200000 if=/dev/urandom of=/tmp/mkshit 100000+0 records in 100000+0 records out 204800000 bytes (205 MB) copied, 120.184 s, 1.7 MB/s real 2m0.189s user 0m0.445s sys 1m58.237s</pre> =My Opinion About the Slakware in this Netbook= 429f005d200a12843f3670bdd99c986c20986954 289 288 2010-01-20T03:34:56Z Crudo 71 /* Screen */ wikitext text/x-wiki -NOT FINISHED- =Intro= Hello Slakers! I will talk about how to installing and use Slakware in a NB 205 from Toshiba. First of all i have to admit that i stayed really impressed with the design of NB205, he's fully portable and light, the screen with a 10.1" have a bad news: she only can do 1024x600 of size but not for us, slackers! ;) So before anything else, lets see some more informations about his technical specifications, down: =Technical Details = * Motherboard: Toshiba KAVAA - Chipset: Intel Callistoga-GSE i945GSE * Processor: Intel Atom N280 1.6GHz * Memory: DDR2-800/400/333/266 MHz - Comes to 1GB but you can upgrade to 2 GB. * Video: Intel GMA 950 (1280x600) * Hard Disk: 160 GB 5400 RPM SATA-II * Webcam, Bluetooth, Ether/Wifi Network gigabit, Battery Life is 8 Hours!!! CPU <pre># cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N280 @ 1.66GHz stepping : 2 cpu MHz : 1000.000 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm lahf_lm bogomips : 3325.16 clflush size : 64 power management:</pre> PCI Devices <pre># lspci 00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02) 00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02) 00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02) 00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02) 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2) 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02) 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02) 00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02) 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)</pre> USB Devices <pre># lsusb Bus 001 Device 002: ID 04f2:b128 Chicony Electronics Co., Ltd Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre> Hard Disk <pre># fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x91c391c3</pre> =Netbook Slakware Configuration= ==Screen== <pre>Section "Module" Load "dbe" # Double buffer extension SubSection "extmod" Option "omit xfree86-dga" # don't initialise the DGA extension EndSubSection Load "type1" Load "freetype" Load "glx" EndSection Section "Files" RgbPath "/usr/share/X11/rgb" FontPath "/usr/share/fonts/local/" FontPath "/usr/share/fonts/misc/" FontPath "/usr/share/fonts/OTF/" FontPath "/usr/share/fonts/TTF/" FontPath "/usr/share/fonts/Type1/" FontPath "/usr/share/fonts/CID/" FontPath "/usr/share/fonts/Speedo/" FontPath "/usr/share/fonts/75dpi/:unscaled" FontPath "/usr/share/fonts/100dpi/:unscaled" FontPath "/usr/share/fonts/75dpi/" FontPath "/usr/share/fonts/100dpi/" FontPath "/usr/share/fonts/cyrillic/" EndSection Section "InputDevice" Driver "kbd" Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "us" EndSection Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "PS/2" Option "Device" "/dev/mouse" EndSection Section "Monitor" Identifier "My Monitor" HorizSync 31.5 - 50.0 VertRefresh 40-90 EndSection Section "Device" Identifier "VESA Framebuffer" Driver "vesa" EndSection Section "Screen" Device "VESA Framebuffer" Monitor "My Monitor" DefaultDepth 24 Subsection "Display" Depth 8 Modes "1024x600" "800x600" "640x480" EndSubsection Subsection "Display" Depth 16 Modes "1024x768" "800x600" "640x480" EndSubsection Subsection "Display" Depth 24 Modes "1024x600" "800x600" "640x480" Virtual 1280 750 EndSubsection Subsection "Display" Depth 32 Modes "1024x600" "800x600" "640x480" Virtual 1280 750 EndSubsection EndSection Section "ServerLayout" Identifier "Simple Layout" Screen "Screen 1" InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard1" "CoreKeyboard" EndSection</pre> ==Network== * 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) * 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02) With those cards the netbook can give a improve in network performance and will grow like a little monster in your network, with a wifi module called 'ath9k' and network module called 'r8169' they can do great things :) ===Bluetooth=== To get things done you will need to download the 'omnibook' package and compile in your slackware version. Once you do it you can follow these commands to test your connection: <pre># modprobe -v omnibook insmod /lib/modules/2.6.29.6-smp/extra/omnibook.ko ectype=12 userset=1 wifi=1 bluetooth=1 # hciconfig hci0: Type: USB BD Address: 00:22:58:FF:C2:DC ACL MTU: 310:10 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:692 acl:0 sco:0 events:24 errors:0 TX bytes:581 acl:0 sco:0 commands:24 errors:0 # hcitool scan Scanning ... 00:21:FC:B1:AC:97 Rosangela</pre> ===Ethernet=== ===Wifi=== If you want to use WPA/PSK: <pre>wpa_passphrase <ESSID> <Passphrase> # wpa_passphrase house littled0g > /etc/wpa_supplicant.conf.home </pre> If you see the file '/etc/wpa_supplicant.conf.home' <pre>network={ ssid="house" #psk="littled0g" psk=9dbaaf7031fd8cbc03674337ee9c724b65811b36546d2234676060b4144872b8 }</pre> =Tests of Performance= <pre># time dd bs=1k count=1000 if=/dev/urandom of=/dev/zero 1000+0 records in 1000+0 records out 1024000 bytes (1.0 MB) copied, 0.588823 s, 1.7 MB/s real 0m0.593s user 0m0.003s sys 0m0.582s # time dd bs=1k count=100000 if=/dev/urandom of=/dev/zero 100000+0 records in 100000+0 records out 102400000 bytes (102 MB) copied, 56.0481 s, 1.8 MB/s real 0m56.053s user 0m0.131s sys 0m55.874s # time dd bs=1k count=200000 if=/dev/urandom of=/tmp/mkshit 100000+0 records in 100000+0 records out 204800000 bytes (205 MB) copied, 120.184 s, 1.7 MB/s real 2m0.189s user 0m0.445s sys 1m58.237s</pre> =My Opinion About the Slakware in this Netbook= dfbfa4f56732f7a1d47d66e2c27d46dd19aafad6 290 289 2010-01-20T03:40:17Z Crudo 71 /* Screen */ wikitext text/x-wiki -NOT FINISHED- =Intro= Hello Slakers! I will talk about how to installing and use Slakware in a NB 205 from Toshiba. First of all i have to admit that i stayed really impressed with the design of NB205, he's fully portable and light, the screen with a 10.1" have a bad news: she only can do 1024x600 of size but not for us, slackers! ;) So before anything else, lets see some more informations about his technical specifications, down: =Technical Details = * Motherboard: Toshiba KAVAA - Chipset: Intel Callistoga-GSE i945GSE * Processor: Intel Atom N280 1.6GHz * Memory: DDR2-800/400/333/266 MHz - Comes to 1GB but you can upgrade to 2 GB. * Video: Intel GMA 950 (1280x600) * Hard Disk: 160 GB 5400 RPM SATA-II * Webcam, Bluetooth, Ether/Wifi Network gigabit, Battery Life is 8 Hours!!! CPU <pre># cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N280 @ 1.66GHz stepping : 2 cpu MHz : 1000.000 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm lahf_lm bogomips : 3325.16 clflush size : 64 power management:</pre> PCI Devices <pre># lspci 00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02) 00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02) 00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02) 00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02) 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2) 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02) 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02) 00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02) 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)</pre> USB Devices <pre># lsusb Bus 001 Device 002: ID 04f2:b128 Chicony Electronics Co., Ltd Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre> Hard Disk <pre># fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x91c391c3</pre> =Netbook Slakware Configuration= ==Screen /etc/X11/org.conf== <pre>Section "Module" Load "dbe" # Double buffer extension SubSection "extmod" Option "omit xfree86-dga" # don't initialise the DGA extension EndSubSection Load "type1" Load "freetype" Load "glx" EndSection Section "Files" RgbPath "/usr/share/X11/rgb" FontPath "/usr/share/fonts/local/" FontPath "/usr/share/fonts/misc/" FontPath "/usr/share/fonts/OTF/" FontPath "/usr/share/fonts/TTF/" FontPath "/usr/share/fonts/Type1/" FontPath "/usr/share/fonts/CID/" FontPath "/usr/share/fonts/Speedo/" FontPath "/usr/share/fonts/75dpi/:unscaled" FontPath "/usr/share/fonts/100dpi/:unscaled" FontPath "/usr/share/fonts/75dpi/" FontPath "/usr/share/fonts/100dpi/" FontPath "/usr/share/fonts/cyrillic/" EndSection Section "InputDevice" Driver "kbd" Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "us" EndSection Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "PS/2" Option "Device" "/dev/mouse" EndSection Section "Monitor" Identifier "My Monitor" HorizSync 31.5 - 50.0 VertRefresh 40-90 EndSection Section "Device" Identifier "Intel GMA950" Driver "intel" EndSection Section "Screen" Device "Intel GMA950" Monitor "My Monitor" DefaultDepth 24 Subsection "Display" Depth 8 Modes "1024x600" "800x600" "640x480" EndSubsection Subsection "Display" Depth 16 Modes "1024x768" "800x600" "640x480" EndSubsection Subsection "Display" Depth 24 Modes "1024x600" "800x600" "640x480" Virtual 1280 750 EndSubsection Subsection "Display" Depth 32 Modes "1024x600" "800x600" "640x480" Virtual 1280 750 EndSubsection EndSection Section "ServerLayout" Identifier "Simple Layout" Screen "Screen 1" InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard1" "CoreKeyboard" EndSection</pre> ==Network== * 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) * 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02) With those cards the netbook can give a improve in network performance and will grow like a little monster in your network, with a wifi module called 'ath9k' and network module called 'r8169' they can do great things :) ===Bluetooth=== To get things done you will need to download the 'omnibook' package and compile in your slackware version. Once you do it you can follow these commands to test your connection: <pre># modprobe -v omnibook insmod /lib/modules/2.6.29.6-smp/extra/omnibook.ko ectype=12 userset=1 wifi=1 bluetooth=1 # hciconfig hci0: Type: USB BD Address: 00:22:58:FF:C2:DC ACL MTU: 310:10 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:692 acl:0 sco:0 events:24 errors:0 TX bytes:581 acl:0 sco:0 commands:24 errors:0 # hcitool scan Scanning ... 00:21:FC:B1:AC:97 Rosangela</pre> ===Ethernet=== ===Wifi=== If you want to use WPA/PSK: <pre>wpa_passphrase <ESSID> <Passphrase> # wpa_passphrase house littled0g > /etc/wpa_supplicant.conf.home </pre> If you see the file '/etc/wpa_supplicant.conf.home' <pre>network={ ssid="house" #psk="littled0g" psk=9dbaaf7031fd8cbc03674337ee9c724b65811b36546d2234676060b4144872b8 }</pre> =Tests of Performance= <pre># time dd bs=1k count=1000 if=/dev/urandom of=/dev/zero 1000+0 records in 1000+0 records out 1024000 bytes (1.0 MB) copied, 0.588823 s, 1.7 MB/s real 0m0.593s user 0m0.003s sys 0m0.582s # time dd bs=1k count=100000 if=/dev/urandom of=/dev/zero 100000+0 records in 100000+0 records out 102400000 bytes (102 MB) copied, 56.0481 s, 1.8 MB/s real 0m56.053s user 0m0.131s sys 0m55.874s # time dd bs=1k count=200000 if=/dev/urandom of=/tmp/mkshit 100000+0 records in 100000+0 records out 204800000 bytes (205 MB) copied, 120.184 s, 1.7 MB/s real 2m0.189s user 0m0.445s sys 1m58.237s</pre> =My Opinion About the Slakware in this Netbook= d62eccf0333d085f819ba102c447960a3f998010 291 290 2010-01-20T15:00:37Z Crudo 71 /* Technical Details */ wikitext text/x-wiki -NOT FINISHED- =Intro= Hello Slakers! I will talk about how to installing and use Slakware in a NB 205 from Toshiba. First of all i have to admit that i stayed really impressed with the design of NB205, he's fully portable and light, the screen with a 10.1" have a bad news: she only can do 1024x600 of size but not for us, slackers! ;) So before anything else, lets see some more informations about his technical specifications, down: =Technical Details = * Motherboard: Toshiba KAVAA - Chipset: Intel Callistoga-GSE i945GSE * Processor: Intel Atom N280 1.6GHz * Memory: DDR2-800/400/333/266 MHz - Comes to 1GB but you can upgrade to 2 GB. * Video: Intel GMA 950 (1280x600) * Hard Disk: 160 GB 5400 RPM SATA-II * Webcam, Bluetooth, Ether/Wifi Network gigabit, Battery Life is 8 Hours!!! Even being netbook this machine has a good performance and excelent battery duration time! Generally this happens because of his ATOM N280 1.6GHz that use minus power and are designed for running in two units of execution even that is not a dual-processor. He has a beautiful keyboard design, a nice webcam of 1.3 megapixels and a good acceleration in multimedia applications. CPU <pre># cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N280 @ 1.66GHz stepping : 2 cpu MHz : 1000.000 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm lahf_lm bogomips : 3325.16 clflush size : 64 power management:</pre> PCI Devices <pre># lspci 00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02) 00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02) 00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02) 00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02) 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2) 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02) 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02) 00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02) 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)</pre> USB Devices <pre># lsusb Bus 001 Device 002: ID 04f2:b128 Chicony Electronics Co., Ltd Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre> Hard Disk <pre># fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x91c391c3</pre> =Netbook Slakware Configuration= ==Screen /etc/X11/org.conf== <pre>Section "Module" Load "dbe" # Double buffer extension SubSection "extmod" Option "omit xfree86-dga" # don't initialise the DGA extension EndSubSection Load "type1" Load "freetype" Load "glx" EndSection Section "Files" RgbPath "/usr/share/X11/rgb" FontPath "/usr/share/fonts/local/" FontPath "/usr/share/fonts/misc/" FontPath "/usr/share/fonts/OTF/" FontPath "/usr/share/fonts/TTF/" FontPath "/usr/share/fonts/Type1/" FontPath "/usr/share/fonts/CID/" FontPath "/usr/share/fonts/Speedo/" FontPath "/usr/share/fonts/75dpi/:unscaled" FontPath "/usr/share/fonts/100dpi/:unscaled" FontPath "/usr/share/fonts/75dpi/" FontPath "/usr/share/fonts/100dpi/" FontPath "/usr/share/fonts/cyrillic/" EndSection Section "InputDevice" Driver "kbd" Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "us" EndSection Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "PS/2" Option "Device" "/dev/mouse" EndSection Section "Monitor" Identifier "My Monitor" HorizSync 31.5 - 50.0 VertRefresh 40-90 EndSection Section "Device" Identifier "Intel GMA950" Driver "intel" EndSection Section "Screen" Device "Intel GMA950" Monitor "My Monitor" DefaultDepth 24 Subsection "Display" Depth 8 Modes "1024x600" "800x600" "640x480" EndSubsection Subsection "Display" Depth 16 Modes "1024x768" "800x600" "640x480" EndSubsection Subsection "Display" Depth 24 Modes "1024x600" "800x600" "640x480" Virtual 1280 750 EndSubsection Subsection "Display" Depth 32 Modes "1024x600" "800x600" "640x480" Virtual 1280 750 EndSubsection EndSection Section "ServerLayout" Identifier "Simple Layout" Screen "Screen 1" InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard1" "CoreKeyboard" EndSection</pre> ==Network== * 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) * 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02) With those cards the netbook can give a improve in network performance and will grow like a little monster in your network, with a wifi module called 'ath9k' and network module called 'r8169' they can do great things :) ===Bluetooth=== To get things done you will need to download the 'omnibook' package and compile in your slackware version. Once you do it you can follow these commands to test your connection: <pre># modprobe -v omnibook insmod /lib/modules/2.6.29.6-smp/extra/omnibook.ko ectype=12 userset=1 wifi=1 bluetooth=1 # hciconfig hci0: Type: USB BD Address: 00:22:58:FF:C2:DC ACL MTU: 310:10 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:692 acl:0 sco:0 events:24 errors:0 TX bytes:581 acl:0 sco:0 commands:24 errors:0 # hcitool scan Scanning ... 00:21:FC:B1:AC:97 Rosangela</pre> ===Ethernet=== ===Wifi=== If you want to use WPA/PSK: <pre>wpa_passphrase <ESSID> <Passphrase> # wpa_passphrase house littled0g > /etc/wpa_supplicant.conf.home </pre> If you see the file '/etc/wpa_supplicant.conf.home' <pre>network={ ssid="house" #psk="littled0g" psk=9dbaaf7031fd8cbc03674337ee9c724b65811b36546d2234676060b4144872b8 }</pre> =Tests of Performance= <pre># time dd bs=1k count=1000 if=/dev/urandom of=/dev/zero 1000+0 records in 1000+0 records out 1024000 bytes (1.0 MB) copied, 0.588823 s, 1.7 MB/s real 0m0.593s user 0m0.003s sys 0m0.582s # time dd bs=1k count=100000 if=/dev/urandom of=/dev/zero 100000+0 records in 100000+0 records out 102400000 bytes (102 MB) copied, 56.0481 s, 1.8 MB/s real 0m56.053s user 0m0.131s sys 0m55.874s # time dd bs=1k count=200000 if=/dev/urandom of=/tmp/mkshit 100000+0 records in 100000+0 records out 204800000 bytes (205 MB) copied, 120.184 s, 1.7 MB/s real 2m0.189s user 0m0.445s sys 1m58.237s</pre> =My Opinion About the Slakware in this Netbook= 53b4eddfd46df896c69a24e81225be01f58f3edb 292 291 2010-01-20T15:04:20Z Crudo 71 wikitext text/x-wiki -NOT FINISHED- =Intro= Hello Slakers! I will talk about how to installing and use Slakware in a NB 205 from Toshiba. First of all i have to admit that i stayed really impressed with the design of NB205, he's fully portable and light, the screen with a 10.1" have a bad news: she only can do 1024x600 of size but not for us, slackers! ;) Even being netbook this machine has a good performance and excelent battery duration time! Generally this happens because of his ATOM N280 1.6GHz that use minus power and are designed for running in two units of execution even that is not a dual-processor. He has a beautiful keyboard design, a nice webcam of 1.3 megapixels and a good acceleration in multimedia applications. So before anything else, lets see some more informations about his technical specifications, down: =Technical Details = * Motherboard: Toshiba KAVAA - Chipset: Intel Callistoga-GSE i945GSE * Processor: Intel Atom N280 1.6GHz * Memory: DDR2-800/400/333/266 MHz - Comes to 1GB but you can upgrade to 2 GB. * Video: Intel GMA 950 (1280x600) * Hard Disk: 160 GB 5400 RPM SATA-II * Webcam, Bluetooth, Ether/Wifi Network gigabit, Battery Life is 8 Hours!!! CPU <pre># cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N280 @ 1.66GHz stepping : 2 cpu MHz : 1000.000 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm lahf_lm bogomips : 3325.16 clflush size : 64 power management:</pre> PCI Devices <pre># lspci 00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02) 00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02) 00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02) 00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02) 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2) 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02) 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02) 00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02) 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)</pre> USB Devices <pre># lsusb Bus 001 Device 002: ID 04f2:b128 Chicony Electronics Co., Ltd Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre> Hard Disk <pre># fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x91c391c3</pre> =Netbook Slakware Configuration= ==Screen /etc/X11/org.conf== <pre>Section "Module" Load "dbe" # Double buffer extension SubSection "extmod" Option "omit xfree86-dga" # don't initialise the DGA extension EndSubSection Load "type1" Load "freetype" Load "glx" EndSection Section "Files" RgbPath "/usr/share/X11/rgb" FontPath "/usr/share/fonts/local/" FontPath "/usr/share/fonts/misc/" FontPath "/usr/share/fonts/OTF/" FontPath "/usr/share/fonts/TTF/" FontPath "/usr/share/fonts/Type1/" FontPath "/usr/share/fonts/CID/" FontPath "/usr/share/fonts/Speedo/" FontPath "/usr/share/fonts/75dpi/:unscaled" FontPath "/usr/share/fonts/100dpi/:unscaled" FontPath "/usr/share/fonts/75dpi/" FontPath "/usr/share/fonts/100dpi/" FontPath "/usr/share/fonts/cyrillic/" EndSection Section "InputDevice" Driver "kbd" Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "us" EndSection Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "PS/2" Option "Device" "/dev/mouse" EndSection Section "Monitor" Identifier "My Monitor" HorizSync 31.5 - 50.0 VertRefresh 40-90 EndSection Section "Device" Identifier "Intel GMA950" Driver "intel" EndSection Section "Screen" Device "Intel GMA950" Monitor "My Monitor" DefaultDepth 24 Subsection "Display" Depth 8 Modes "1024x600" "800x600" "640x480" EndSubsection Subsection "Display" Depth 16 Modes "1024x768" "800x600" "640x480" EndSubsection Subsection "Display" Depth 24 Modes "1024x600" "800x600" "640x480" Virtual 1280 750 EndSubsection Subsection "Display" Depth 32 Modes "1024x600" "800x600" "640x480" Virtual 1280 750 EndSubsection EndSection Section "ServerLayout" Identifier "Simple Layout" Screen "Screen 1" InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard1" "CoreKeyboard" EndSection</pre> ==Network== * 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) * 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02) With those cards the netbook can give a improve in network performance and will grow like a little monster in your network, with a wifi module called 'ath9k' and network module called 'r8169' they can do great things :) ===Bluetooth=== To get things done you will need to download the 'omnibook' package and compile in your slackware version. Once you do it you can follow these commands to test your connection: <pre># modprobe -v omnibook insmod /lib/modules/2.6.29.6-smp/extra/omnibook.ko ectype=12 userset=1 wifi=1 bluetooth=1 # hciconfig hci0: Type: USB BD Address: 00:22:58:FF:C2:DC ACL MTU: 310:10 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:692 acl:0 sco:0 events:24 errors:0 TX bytes:581 acl:0 sco:0 commands:24 errors:0 # hcitool scan Scanning ... 00:21:FC:B1:AC:97 Rosangela</pre> ===Ethernet=== ===Wifi=== If you want to use WPA/PSK: <pre>wpa_passphrase <ESSID> <Passphrase> # wpa_passphrase house littled0g > /etc/wpa_supplicant.conf.home </pre> If you see the file '/etc/wpa_supplicant.conf.home' <pre>network={ ssid="house" #psk="littled0g" psk=9dbaaf7031fd8cbc03674337ee9c724b65811b36546d2234676060b4144872b8 }</pre> =Tests of Performance= <pre># time dd bs=1k count=1000 if=/dev/urandom of=/dev/zero 1000+0 records in 1000+0 records out 1024000 bytes (1.0 MB) copied, 0.588823 s, 1.7 MB/s real 0m0.593s user 0m0.003s sys 0m0.582s # time dd bs=1k count=100000 if=/dev/urandom of=/dev/zero 100000+0 records in 100000+0 records out 102400000 bytes (102 MB) copied, 56.0481 s, 1.8 MB/s real 0m56.053s user 0m0.131s sys 0m55.874s # time dd bs=1k count=200000 if=/dev/urandom of=/tmp/mkshit 100000+0 records in 100000+0 records out 204800000 bytes (205 MB) copied, 120.184 s, 1.7 MB/s real 2m0.189s user 0m0.445s sys 1m58.237s</pre> =My Opinion About the Slakware in this Netbook= * You will not be unsatisfied. * You need to buy at least one in your life. Only $490. * Excelent to use like a second 'notebook' in your home and your work. 40e38e547e2f871fbd124dde6fb4239c43cecc04 293 292 2010-01-22T17:58:40Z Crudo 71 wikitext text/x-wiki -NOT FINISHED- =Intro= Hello Slakers! I will talk about how to installing and use Slakware in a NB 205 from Toshiba. First of all i have to admit that i stayed really impressed with the design of NB205, he's fully portable and light, the screen with a 10.1" have a bad news: she only can do 1024x600 of size but not for us, slackers! ;) Even being netbook this machine has a good performance and excelent battery duration time! Generally this happens because of his ATOM N280 1.6GHz that use minus power and are designed for running in two units of execution even that is not a dual-processor. He has a beautiful keyboard design, a nice webcam of 1.3 megapixels and a good acceleration in multimedia applications. So before anything else, lets see some more informations about his technical specifications, down: =Technical Details = * Motherboard: Toshiba KAVAA - Chipset: Intel Callistoga-GSE i945GSE * Processor: Intel Atom N280 1.6GHz * Memory: DDR2-800/400/333/266 MHz - Comes to 1GB but you can upgrade to 2 GB. * Video: Intel GMA 950 (1280x600) * Hard Disk: 160 GB 5400 RPM SATA-II * Webcam, Bluetooth, Ether/Wifi Network gigabit, Battery Life is 8 Hours!!! CPU <pre># cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N280 @ 1.66GHz stepping : 2 cpu MHz : 1000.000 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm lahf_lm bogomips : 3325.16 clflush size : 64 power management:</pre> PCI Devices <pre># lspci 00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02) 00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02) 00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02) 00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02) 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2) 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02) 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02) 00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02) 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)</pre> USB Devices <pre># lsusb Bus 001 Device 002: ID 04f2:b128 Chicony Electronics Co., Ltd Bus 001 Device 003: ID 0bda:0159 Realtek Semiconductor Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</pre> Hard Disk <pre># fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x91c391c3</pre> =Netbook Slakware Configuration= Here i post some of my tips to setup slakware with this hardware. ==Screen== The netbook video driver can only hit a 1024x600 size of screen, but we can change this using the 'xrandr' command to hit 1280x750 virtual. For do that you need to change '~/.xinitrc' and before you call your window manager you make a call of these command: <pre>xrandr --output LVDS --mode 1024x600 --scale 1.25x1.25</pre> Here is my '''/etc/X11/xorg.conf''': <pre>Section "Module" Load "dbe" # Double buffer extension SubSection "extmod" Option "omit xfree86-dga" # don't initialise the DGA extension EndSubSection Load "type1" Load "freetype" Load "glx" EndSection Section "Files" RgbPath "/usr/share/X11/rgb" FontPath "/usr/share/fonts/local/" FontPath "/usr/share/fonts/misc/" FontPath "/usr/share/fonts/OTF/" FontPath "/usr/share/fonts/TTF/" FontPath "/usr/share/fonts/Type1/" FontPath "/usr/share/fonts/CID/" FontPath "/usr/share/fonts/Speedo/" FontPath "/usr/share/fonts/75dpi/:unscaled" FontPath "/usr/share/fonts/100dpi/:unscaled" FontPath "/usr/share/fonts/75dpi/" FontPath "/usr/share/fonts/100dpi/" FontPath "/usr/share/fonts/cyrillic/" EndSection Section "InputDevice" Driver "kbd" Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "us" EndSection Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "PS/2" Option "Device" "/dev/mouse" EndSection Section "Monitor" Identifier "My Monitor" HorizSync 31.5 - 50.0 VertRefresh 40-90 EndSection Section "Device" Identifier "Intel GMA950" Driver "intel" EndSection Section "Screen" Device "Intel GMA950" Monitor "My Monitor" DefaultDepth 24 Subsection "Display" Depth 8 Modes "1024x600" "800x600" "640x480" EndSubsection Subsection "Display" Depth 16 Modes "1024x768" "800x600" "640x480" EndSubsection Subsection "Display" Depth 24 Modes "1024x600" "800x600" "640x480" Virtual 1280 750 EndSubsection Subsection "Display" Depth 32 Modes "1024x600" "800x600" "640x480" Virtual 1280 750 EndSubsection EndSection Section "ServerLayout" Identifier "Simple Layout" Screen "Screen 1" InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard1" "CoreKeyboard" EndSection</pre> ==Network== * 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) * 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02) With those cards the netbook can give a improve in network performance and will grow like a little monster in your network, with a wifi module called 'ath9k' and network module called 'r8169' they can do great things :) ===Bluetooth=== To get things done you will need to download the 'omnibook' package and compile in your slackware version. Once you do it you can follow these commands to test your connection: <pre># modprobe -v omnibook insmod /lib/modules/2.6.29.6-smp/extra/omnibook.ko ectype=12 userset=1 wifi=1 bluetooth=1 # hciconfig hci0: Type: USB BD Address: 00:22:58:FF:C2:DC ACL MTU: 310:10 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:692 acl:0 sco:0 events:24 errors:0 TX bytes:581 acl:0 sco:0 commands:24 errors:0 # hcitool scan Scanning ... 00:21:FC:B1:AC:97 Rosangela</pre> To be honest thats the best i could do with Bluetooth right now. ===Ethernet=== The easy way to setup your network is with DHCP. To make this you must change the file: '''/etc/rc.d/rc.inet1.conf''' to: <pre>IFNAME[0]="eth0" USE_DHCP[0]="yes"</pre> Or with IP fix: <pre>IFNAME[0]="eth0" USE_DHCP="no" IPADDR[0]="192.168.0.10" NETMASK[0]="255.255.255.0" GATEWAY="192.168.0.254"</pre> Or you can set your ip manually in console with these commands: <pre># ifconfig eth0 192.168.0.25 # route add default gw 192.168.0.254</pre> ===Wifi=== If you want to use WPA/PSK: <pre>wpa_passphrase <ESSID> <Passphrase> # wpa_passphrase house littled0g > /etc/wpa_supplicant.conf.home </pre> If you see the file '/etc/wpa_supplicant.conf.home' <pre>network={ ssid="house" #psk="littled0g" psk=9dbaaf7031fd8cbc03674337ee9c724b65811b36546d2234676060b4144872b8 }</pre> =Tests of Performance= <pre># time dd bs=1k count=1000 if=/dev/urandom of=/dev/zero 1000+0 records in 1000+0 records out 1024000 bytes (1.0 MB) copied, 0.588823 s, 1.7 MB/s real 0m0.593s user 0m0.003s sys 0m0.582s # time dd bs=1k count=100000 if=/dev/urandom of=/dev/zero 100000+0 records in 100000+0 records out 102400000 bytes (102 MB) copied, 56.0481 s, 1.8 MB/s real 0m56.053s user 0m0.131s sys 0m55.874s # time dd bs=1k count=200000 if=/dev/urandom of=/tmp/mkshit 100000+0 records in 100000+0 records out 204800000 bytes (205 MB) copied, 120.184 s, 1.7 MB/s real 2m0.189s user 0m0.445s sys 1m58.237s</pre> =My Opinion About the Slakware in this Netbook= * You will not be unsatisfied. * You need to buy at least one in your life. Only $490. * Excelent to use like a second 'notebook' in your home and your work. 34f6f87911fd14b35fd7c69d3160ab2f24aa4422 Piping 0 132 294 157 2010-02-09T16:07:06Z Merge-delete 261 wikitext text/x-wiki You can mix [[Common Commands|commands]] to do certain things like [http://www.superiorthesis.com superior thesis]. dmesg | grep hd That will search dmesg and try to find the string "hd". Now piping is extremely useful. Another example of a pipe: dmesg | less Now this command you can see the dmesg fully and is easier to read. You can also make longer 'pipelines' by using a pipe of several commands. For instance, to browse the last fifty lines of <code>dmesg</code>: dmseg | tail -50 | less <b>Redirection:</b> This will save the dmesg information in your home directory in the file log.txt dmesg > ~/log.txt You can also redirect only the [[standard output|stdout]] by using '1>' or only the [[error messages|stderr]] by using '2>'. For instance, if you want to run a command that gives a lot of junk as output, and you just want to see any errors, you can redirect the output to the null device (<code>/dev/null</code>): mplayer /path/to/movie.avi 1> /dev/null You can also use the > and >> to cat stdin into a new or existing file: bash-3.1$ cat > newFile This is a new file you can type text here and it get's redirected to the file newFile ctrl-c exits * Warning * cat > fileThatAlreadExists WILL OVERWRITE THE FILE! be careful :-) You can use cat to check the text you just added: bash-3.1$ cat newFile This is a new file you can type text here and it get's redirected to the file newFile ctrl-c exits Now that a file is created you can add to it with the >> operator bash-3.1$cat >> newFile This is a new line to add to newFile And if you use cat again to read the file bash-3.1$cat newFile This is a new file you can type text here and it get's redirected to the file newFile ctrl-c exits This is a new line to add to newFile [[Category:Tutorials]] efd93c5e77022ab2cf624fbcaeaab469a3e2fd45 295 294 2010-02-09T16:16:29Z Erik 1 Reverted edits by [[Special:Contributions/LisaClayborn|LisaClayborn]] ([[User talk:LisaClayborn|Talk]]) to last version by [[User:Erik|Erik]] wikitext text/x-wiki You can mix [[Common Commands|commands]] to do certain things. dmesg | grep hd That will search dmesg and try to find the string "hd". Now piping is extremely useful. Another example of a pipe: dmesg | less Now this command you can see the dmesg fully and is easier to read. You can also make longer 'pipelines' by using a pipe of several commands. For instance, to browse the last fifty lines of <code>dmesg</code>: dmseg | tail -50 | less <b>Redirection:</b> This will save the dmesg information in your home directory in the file log.txt dmesg > ~/log.txt You can also redirect only the [[standard output|stdout]] by using '1>' or only the [[error messages|stderr]] by using '2>'. For instance, if you want to run a command that gives a lot of junk as output, and you just want to see any errors, you can redirect the output to the null device (<code>/dev/null</code>): mplayer /path/to/movie.avi 1> /dev/null You can also use the > and >> to cat stdin into a new or existing file: bash-3.1$ cat > newFile This is a new file you can type text here and it get's redirected to the file newFile ctrl-c exits * Warning * cat > fileThatAlreadExists WILL OVERWRITE THE FILE! be careful :-) You can use cat to check the text you just added: bash-3.1$ cat newFile This is a new file you can type text here and it get's redirected to the file newFile ctrl-c exits Now that a file is created you can add to it with the >> operator bash-3.1$cat >> newFile This is a new line to add to newFile And if you use cat again to read the file bash-3.1$cat newFile This is a new file you can type text here and it get's redirected to the file newFile ctrl-c exits This is a new line to add to newFile [[Category:Tutorials]] 0c88be229e86591eb46af05c311019a8614eee42 PDF Printing 0 208 296 2010-02-17T16:14:59Z Allend 75 Created page with '[[Category:Tips]] == PDF Printing == While many applications offer exporting output to portable document format (PDF) files, many others do not. It is easy to add a virtual PDF ...' wikitext text/x-wiki [[Category:Tips]] == PDF Printing == While many applications offer exporting output to portable document format (PDF) files, many others do not. It is easy to add a virtual PDF printer to CUPS by installing the cups-pdf package that is available at http://www.slackbuilds.org This works well for single documents, but if you print multiple documents that are parsed as having the same name then the older documents will be overwritten. A solution to this is to run a script that watches for the creation of the PDF document in the spool directory (/var/spool/cups-pdf/<username> by default) and then moves the document to another directory (USERS_DIR). The script below (watch_for_spooled_pdf.sh kept in /home/xx/pdf_printing) also prepends a date and time string to keep the document names unique. A user xx should start this script as a background process i.e. /home/xx/pdf_printing/watch_for_spooled_pdf.sh & <pre> #!/bin/sh # Script to watch for creation of .pdf files by CUPS-PDF in spool directory # and move to users directory prepending the creation date and time. # # This script uses the -m option to inotifywait and should never exit. SPOOL_DIR=/var/spool/cups-pdf/xx/ USERS_DIR=/home/xx/Desktop/PDF_Files/ inotifywait -mq --timefmt '%Y%m%d %H%M%S' --format '%T %f' \ -e close_write $SPOOL_DIR \ | while read date time file; do mv $SPOOL_DIR${file} $USERS_DIR${date}${time}_${file} done </pre> What if printed PDF documents should be combined into one large PDF document? A user could move the files to be combined to a new subdirectory and then run the script (combine.sh) shown below. This script creates a single PDF document with bookmark entries to each of the individual documents using the facilities in the pdfpages and hyperref packages of LaTeX. The page order is in the order of creation date and time. <pre> #!/bin/sh # Script to combine .pdf files # Intended to be run from within a directory containing files to be concatenated. # The directory name is accepted as a parameter # First create a .tex file for processing using pdflatex OUTFILE=out2.tex BKMK_TEXT=Contents BKMK_ANCHOR=Beginning BKMK_LEVEL=0 # If the directory name has been passed, then make it the working directory. if [[ $1 ]]; then cd $1; fi echo "\documentclass{article}" > $OUTFILE echo "\usepackage{pdfpages}" >> $OUTFILE echo "\usepackage[bookmarksopen]{hyperref}" >> $OUTFILE echo "\begin{document}" >> $OUTFILE echo "\pdfbookmark["$BKMK_LEVEL"]{"$BKMK_TEXT"}{"$BKMK_ANCHOR"}" >> $OUTFILE BKMK_LEVEL=1 for FILENAME in $( ls ./*.pdf ); do # Create the text to be used in the bookmark entry. # NB. Need to substitute 'space' for 'underscore' to be valid bookmark text. BKMK_TEXT=$(echo $FILENAME | cut -b1-17 --complement | sed s/_/\ /g | sed s/\.pdf$//g) # Create a unique anchor point based on date and time prepended to filename BKMK_ANCHOR=$(echo $FILENAME | cut -b3-16) echo "\pdfbookmark["$BKMK_LEVEL"]{"$BKMK_TEXT"}{"$BKMK_ANCHOR"}" >> $OUTFILE echo "\includepdf[pages=-,fitpaper]{"$FILENAME"}" >> $OUTFILE done echo "\end{document}" >> $OUTFILE # Now process the .tex file # Do a second run so that bookmark entries are resolved pdflatex $OUTFILE; pdflatex $OUTFILE wait # Rename the created .pdf file mv $(basename $OUTFILE .tex).pdf $(date +%Y%m%d%H%M%S)_All.pdf # Cleanup files left by pdflatex processing rm $(basename $OUTFILE .tex)* # Cleanup trigger file if this script has been started from watch_for_combine_start.sh script if [ -f combine.start ]; then rm combine.start; fi # Remove this script rm $0 </pre> As a convenience, the user could also have a second background process running the script (watch_for_combine_start.sh) shown below. This script watches for the creation of a 'trigger' file (combine.start) in the directory tree and then executes the 'combine.sh' script shown above. This is useful in a network environment, so that a Windows user manipulating the files via a Samba share can create the combined PDF file without having to log in to the Slackware Linux server. <pre> #!/bin/sh # Script to watch for creation of a trigger file in a directory tree. # This event causes another script to be copied into the tree subdirectory and run. # The tree subdirectory name is passed as a parameter. # # This script should never exit WATCH_DIR=/home/xx/Desktop/PDF_Files TRIGGER_FILE=combine.start SCRIPT_FILE=/home/xx/pdf_printing/combine.sh inotifywait -mqr --timefmt '%Y%m%d %H%M%S' --format '%T %w %f' \ -e close_write $WATCH_DIR \ | while read date time path file; do if [ ${file} == $TRIGGER_FILE ]; then cp $SCRIPT_FILE ${path} sh ${path}/$(basename $SCRIPT_FILE) ${path} > /dev/null & fi done </pre> c78d766e919a6ac76bf2cd3f4714fcaf2c2f2d5c Timidity++ 0 209 297 2010-02-20T22:55:11Z Merge-delete 261 Created page with '[[category:tutorials]] '''TiMidity++''' is a software synthesizer. It can play MIDI files by converting them into PCM waveform data; give it a MIDI data along with digital instru...' wikitext text/x-wiki [[category:tutorials]] '''TiMidity++''' is a software synthesizer. It can play MIDI files by converting them into PCM waveform data; give it a MIDI data along with digital instrument data files, then it synthesizes them in real-time, and plays. It can not only play sounds, but also can save the generated waveforms into hard disks as various audio file formats. == Prerequisities == === Timidity === * Timidity++ === Patchset === A patchset is required for MIDI files to be audible through TiMidity++. Choose one of them. * Freepats * Eawpats - Sounds nicer, but may have some intellectual property issues. If this is a concern to you, use freepats instead (For more information, see /usr/doc/eawpats-12/copyrigh.txt). == Installation == Compile it from source or use slackbuild. == Configuration == Timidity++ won't play any sound by default. If you encounter this error, you have to tell Timidity++ where to find patchset. <pre> No instrument mapped to tone bank X, program YY - this instrument will not be heard </pre> To do so, add following line to ''/etc/timidity.cfg'' For Freepats: <pre> source /etc/timidity/freepats.cfg </pre> For Eawpats: <pre> source /etc/timidity/eawpats.cfg </pre> == Using == At this point, you should have Timidity++ working. Test it by command: <pre># timidity somemidifile.mid</pre> === Playback === To play MIDI type previous command <pre> # timidity <somemidifile></pre> === Sound server for other apps === This is useful, when application native sound engine doesn't work or Timidity++ sounds nicer than the application native sound engine (eg. TuxGuitar using Java soundbanks). To start a sound server using ALSA <pre># timidity -iA -Os</pre> where * -iA means Launch TiMidity++ as ALSA sequencer client * -Os means Output to ALSA === Other usage === For other usage see manpage. 36e32489d7aa74bc19660f20ee348fa26359703f 298 297 2010-02-20T22:55:42Z Merge-delete 261 wikitext text/x-wiki [[category:tutorials]] '''TiMidity++''' is a software synthesizer. It can play MIDI files by converting them into PCM waveform data; give it a MIDI data along with digital instrument data files, then it synthesizes them in real-time, and plays. It can not only play sounds, but also can save the generated waveforms into hard disks as various audio file formats. == Prerequisities == === Timidity++ === * Timidity++ === Patchset === A patchset is required for MIDI files to be audible through TiMidity++. Choose one of them. * Freepats * Eawpats - Sounds nicer, but may have some intellectual property issues. If this is a concern to you, use freepats instead (For more information, see /usr/doc/eawpats-12/copyrigh.txt). == Installation == Compile it from source or use slackbuild. == Configuration == Timidity++ won't play any sound by default. If you encounter this error, you have to tell Timidity++ where to find patchset. <pre> No instrument mapped to tone bank X, program YY - this instrument will not be heard </pre> To do so, add following line to ''/etc/timidity.cfg'' For Freepats: <pre> source /etc/timidity/freepats.cfg </pre> For Eawpats: <pre> source /etc/timidity/eawpats.cfg </pre> == Using == At this point, you should have Timidity++ working. Test it by command: <pre># timidity somemidifile.mid</pre> === Playback === To play MIDI type previous command <pre> # timidity <somemidifile></pre> === Sound server for other apps === This is useful, when application native sound engine doesn't work or Timidity++ sounds nicer than the application native sound engine (eg. TuxGuitar using Java soundbanks). To start a sound server using ALSA <pre># timidity -iA -Os</pre> where * -iA means Launch TiMidity++ as ALSA sequencer client * -Os means Output to ALSA === Other usage === For other usage see manpage. b41c471bb79fa931930da479b7b7c4e44141001f 299 298 2010-02-21T15:21:57Z Merge-delete 261 moved [[Timidity]] to [[Timidity++]]:&#32;A mistake in page name. wikitext text/x-wiki [[category:tutorials]] '''TiMidity++''' is a software synthesizer. It can play MIDI files by converting them into PCM waveform data; give it a MIDI data along with digital instrument data files, then it synthesizes them in real-time, and plays. It can not only play sounds, but also can save the generated waveforms into hard disks as various audio file formats. == Prerequisities == === Timidity++ === * Timidity++ === Patchset === A patchset is required for MIDI files to be audible through TiMidity++. Choose one of them. * Freepats * Eawpats - Sounds nicer, but may have some intellectual property issues. If this is a concern to you, use freepats instead (For more information, see /usr/doc/eawpats-12/copyrigh.txt). == Installation == Compile it from source or use slackbuild. == Configuration == Timidity++ won't play any sound by default. If you encounter this error, you have to tell Timidity++ where to find patchset. <pre> No instrument mapped to tone bank X, program YY - this instrument will not be heard </pre> To do so, add following line to ''/etc/timidity.cfg'' For Freepats: <pre> source /etc/timidity/freepats.cfg </pre> For Eawpats: <pre> source /etc/timidity/eawpats.cfg </pre> == Using == At this point, you should have Timidity++ working. Test it by command: <pre># timidity somemidifile.mid</pre> === Playback === To play MIDI type previous command <pre> # timidity <somemidifile></pre> === Sound server for other apps === This is useful, when application native sound engine doesn't work or Timidity++ sounds nicer than the application native sound engine (eg. TuxGuitar using Java soundbanks). To start a sound server using ALSA <pre># timidity -iA -Os</pre> where * -iA means Launch TiMidity++ as ALSA sequencer client * -Os means Output to ALSA === Other usage === For other usage see manpage. b41c471bb79fa931930da479b7b7c4e44141001f Timidity 0 210 300 2010-02-21T15:21:57Z Merge-delete 261 moved [[Timidity]] to [[Timidity++]]:&#32;A mistake in page name. wikitext text/x-wiki #REDIRECT [[Timidity++]] 93be92941a720eb3a557a6f078e84d84fe0b2362 Burning CD/DVD 0 27 302 36 2010-02-25T00:56:24Z Erik 1 Added ISO Master wikitext text/x-wiki [[Category:Tutorials]] Random information about burning CD/DVD's with slack (and linux in general). Feel free to tack on any insight you might have on the subject. ==The Basics== In most modern situations, you will not have to tell the software which device to use (unless you have more than one device). In case you have older hardware or software, it may be necessary to pass the device info. On a 2.6 kernel, you can use: cdrecord dev=/dev/someDevice On a 2.4 kernel, you use one of these commands: cdrdao scanbus cdrecord -scanbus dev=ATA This should present you with some information: ATA:1,0,0 DVDRW , IDE1004 , 0151 1,0,0 100) 'DVDRW ' 'IDE1004 ' '0151' Removable CD-ROM To pass this device (1,0,0) to cdrdao or cdrecord: cdrdao --device 1,0,0 cdrecord dev=ATA:1,0,0 These will be SCSI ID's if you have a SCSI burner, or are using ide-scsi (no-longer necessary) ==CDR== ===Creating an image=== ====From a disc==== readcd dev=ATA:1,0,0 f=image.iso dd if=/dev/cdrom of=image.iso ====From a directory of files==== -r provides Rock Ridge extension (for posix)<br> -J provides Joliet extension (for windows) mkisofs -o image.iso -J -r /path/to/files/ ===Burning an image=== cdrdao write image.cue cdrecord -dao driveropts=burnfree dev=/dev/cdrom image.iso ==DVDR== ===From an image=== growisofs -dvd-compat -Z /dev/dvd=dvd.iso ===A directory of files=== -R provides Rock Ridge extension (for posix)<br> -J provides Joliet extension (for windows) growisofs -dvd-compat -Z /dev/dvd -J -R /path/to/files/ ===A DVD Video=== This path must be structured like a DVD, see Authoring. growisofs -Z /dev/dvd -dvd-video /path/to/dvd/files/ ==Blanking== ===Quick=== cdrdao blank --blank-mode minimal dvd+rw-format -blank /dev/dvd ===Full=== cdrdao blank --blank-mode full dvd+rw-format -blank=full /dev/dvd ==Links== ===Burning Software=== ; DVD+RW-Tools : http://fy.chalmers.se/~appro/linux/DVD+RW/ ; CDRDAO : http://cdrdao.sourceforge.net/ ; Cdrtools : http://www.fokus.fhg.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html ===GUI Frontends=== ; X-CD-Roast : http://www.xcdroast.org/ ; Gnome CD Master : http://cdrdao.sourceforge.net/gcdmaster/index.html ; Gnome Toaster : http://gnometoaster.rulez.org/ ; Nautilus-CD-Burner : http://www.gnome.org/projects/nautilus/ ; K3B : http://www.k3b.org/ ===Authoring Tools=== ; dvdauthor : http://dvdauthor.sourceforge.net/ ; DVDStyler : http://dvdstyler.sourceforge.net/ ; &lsquo;Q&lsquo; DVD-Author : http://qdvdauthor.sourceforge.net/ ===Format Converters=== ; CCD2ISO : http://ccd2iso.sourceforge.net/ ; NRG2ISO : http://gregory.kokanosky.free.fr/v4/linux/nrg2iso.en.html ; ISO Master : http://www.littlesvr.ca/isomaster/ fff2ee6481a834a93c295f7e78d70b7254b9261a 303 302 2010-02-25T20:51:18Z Merge-delete 261 K3B issue wikitext text/x-wiki [[Category:Tutorials]] Random information about burning CD/DVD's with slack (and linux in general). Feel free to tack on any insight you might have on the subject. ==The Basics== In most modern situations, you will not have to tell the software which device to use (unless you have more than one device). In case you have older hardware or software, it may be necessary to pass the device info. On a 2.6 kernel, you can use: cdrecord dev=/dev/someDevice On a 2.4 kernel, you use one of these commands: cdrdao scanbus cdrecord -scanbus dev=ATA This should present you with some information: ATA:1,0,0 DVDRW , IDE1004 , 0151 1,0,0 100) 'DVDRW ' 'IDE1004 ' '0151' Removable CD-ROM To pass this device (1,0,0) to cdrdao or cdrecord: cdrdao --device 1,0,0 cdrecord dev=ATA:1,0,0 These will be SCSI ID's if you have a SCSI burner, or are using ide-scsi (no-longer necessary) ==CDR== ===Creating an image=== ====From a disc==== readcd dev=ATA:1,0,0 f=image.iso dd if=/dev/cdrom of=image.iso ====From a directory of files==== -r provides Rock Ridge extension (for posix)<br> -J provides Joliet extension (for windows) mkisofs -o image.iso -J -r /path/to/files/ ===Burning an image=== cdrdao write image.cue cdrecord -dao driveropts=burnfree dev=/dev/cdrom image.iso ==DVDR== ===From an image=== growisofs -dvd-compat -Z /dev/dvd=dvd.iso ===A directory of files=== -R provides Rock Ridge extension (for posix)<br> -J provides Joliet extension (for windows) growisofs -dvd-compat -Z /dev/dvd -J -R /path/to/files/ ===A DVD Video=== This path must be structured like a DVD, see Authoring. growisofs -Z /dev/dvd -dvd-video /path/to/dvd/files/ ==Blanking== ===Quick=== cdrdao blank --blank-mode minimal dvd+rw-format -blank /dev/dvd ===Full=== cdrdao blank --blank-mode full dvd+rw-format -blank=full /dev/dvd ==Links== ===Burning Software=== ; DVD+RW-Tools : http://fy.chalmers.se/~appro/linux/DVD+RW/ ; CDRDAO : http://cdrdao.sourceforge.net/ ; Cdrtools : http://www.fokus.fhg.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html ===GUI Frontends=== ; X-CD-Roast : http://www.xcdroast.org/ ; Gnome CD Master : http://cdrdao.sourceforge.net/gcdmaster/index.html ; Gnome Toaster : http://gnometoaster.rulez.org/ ; Nautilus-CD-Burner : http://www.gnome.org/projects/nautilus/ ; K3B : http://www.k3b.org/ * As mentioned in [ftp://ftp.slackware.cz/slackware/slackware-13.0/RELEASE_NOTES RELEASE_NOTES] K3B shipped with KDE4 sometimes doesn't recognize CD/DVD writer. <pre> One of the issues we're aware of is that k3b hasn't been working as well as the KDE3 version for some people (it works fine here, but we have heard some reports), and there are some other KDE applications where people still prefer the old versions. To help with this, there are KDE3 compatibility packages that can be found in /extra/kde3-compat/. With these installed, most KDE3 programs will run. A KDE3 version of k3b is also included in that directory. </pre> You can still read, mount, rip CD/DVD, but it's annoying. If K3B gives you following error: <pre>No CD/DVD writer found.</pre> use "old" K3B 1.0.5 from KDE 3.5.10 (in Slackware 13.0 it's ''k3b3'' package inside from ''extra/kde3-compat'' directory) or try Slackware-current where K3B (1.69.0 Alpha 4) is reported as again working (despite it's Alpha state). ===Authoring Tools=== ; dvdauthor : http://dvdauthor.sourceforge.net/ ; DVDStyler : http://dvdstyler.sourceforge.net/ ; &lsquo;Q&lsquo; DVD-Author : http://qdvdauthor.sourceforge.net/ ===Format Converters=== ; CCD2ISO : http://ccd2iso.sourceforge.net/ ; NRG2ISO : http://gregory.kokanosky.free.fr/v4/linux/nrg2iso.en.html ; ISO Master : http://www.littlesvr.ca/isomaster/ 102775f41885cc29c3fa3aa8bb49371d557fb4e6 304 303 2010-02-25T20:53:51Z Merge-delete 261 correction of typo wikitext text/x-wiki [[Category:Tutorials]] Random information about burning CD/DVD's with slack (and linux in general). Feel free to tack on any insight you might have on the subject. ==The Basics== In most modern situations, you will not have to tell the software which device to use (unless you have more than one device). In case you have older hardware or software, it may be necessary to pass the device info. On a 2.6 kernel, you can use: cdrecord dev=/dev/someDevice On a 2.4 kernel, you use one of these commands: cdrdao scanbus cdrecord -scanbus dev=ATA This should present you with some information: ATA:1,0,0 DVDRW , IDE1004 , 0151 1,0,0 100) 'DVDRW ' 'IDE1004 ' '0151' Removable CD-ROM To pass this device (1,0,0) to cdrdao or cdrecord: cdrdao --device 1,0,0 cdrecord dev=ATA:1,0,0 These will be SCSI ID's if you have a SCSI burner, or are using ide-scsi (no-longer necessary) ==CDR== ===Creating an image=== ====From a disc==== readcd dev=ATA:1,0,0 f=image.iso dd if=/dev/cdrom of=image.iso ====From a directory of files==== -r provides Rock Ridge extension (for posix)<br> -J provides Joliet extension (for windows) mkisofs -o image.iso -J -r /path/to/files/ ===Burning an image=== cdrdao write image.cue cdrecord -dao driveropts=burnfree dev=/dev/cdrom image.iso ==DVDR== ===From an image=== growisofs -dvd-compat -Z /dev/dvd=dvd.iso ===A directory of files=== -R provides Rock Ridge extension (for posix)<br> -J provides Joliet extension (for windows) growisofs -dvd-compat -Z /dev/dvd -J -R /path/to/files/ ===A DVD Video=== This path must be structured like a DVD, see Authoring. growisofs -Z /dev/dvd -dvd-video /path/to/dvd/files/ ==Blanking== ===Quick=== cdrdao blank --blank-mode minimal dvd+rw-format -blank /dev/dvd ===Full=== cdrdao blank --blank-mode full dvd+rw-format -blank=full /dev/dvd ==Links== ===Burning Software=== ; DVD+RW-Tools : http://fy.chalmers.se/~appro/linux/DVD+RW/ ; CDRDAO : http://cdrdao.sourceforge.net/ ; Cdrtools : http://www.fokus.fhg.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html ===GUI Frontends=== ; X-CD-Roast : http://www.xcdroast.org/ ; Gnome CD Master : http://cdrdao.sourceforge.net/gcdmaster/index.html ; Gnome Toaster : http://gnometoaster.rulez.org/ ; Nautilus-CD-Burner : http://www.gnome.org/projects/nautilus/ ; K3B : http://www.k3b.org/ * As mentioned in [ftp://ftp.slackware.cz/slackware/slackware-13.0/RELEASE_NOTES RELEASE_NOTES] K3B shipped with KDE4 sometimes doesn't recognize CD/DVD writer. <pre> One of the issues we're aware of is that k3b hasn't been working as well as the KDE3 version for some people (it works fine here, but we have heard some reports), and there are some other KDE applications where people still prefer the old versions. To help with this, there are KDE3 compatibility packages that can be found in /extra/kde3-compat/. With these installed, most KDE3 programs will run. A KDE3 version of k3b is also included in that directory. </pre> You can still read, mount, rip CD/DVD, but it's annoying. If K3B gives you following error: <pre>No CD/DVD writer found.</pre> use "old" K3B 1.0.5 from KDE 3.5.10 (in Slackware 13.0 it's ''k3b3'' package found in ''extra/kde3-compat/'') or try Slackware-current where K3B (1.69.0 Alpha 4) is reported as again working (despite it's Alpha state). ===Authoring Tools=== ; dvdauthor : http://dvdauthor.sourceforge.net/ ; DVDStyler : http://dvdstyler.sourceforge.net/ ; &lsquo;Q&lsquo; DVD-Author : http://qdvdauthor.sourceforge.net/ ===Format Converters=== ; CCD2ISO : http://ccd2iso.sourceforge.net/ ; NRG2ISO : http://gregory.kokanosky.free.fr/v4/linux/nrg2iso.en.html ; ISO Master : http://www.littlesvr.ca/isomaster/ e6c8b0b00553eb070c7c612056ac645e75321964 The Regulars 0 4 305 245 2010-03-01T05:32:39Z Jcm 85 wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:cpunches|cpunches]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|dchmelik]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jcm |jcm]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. 6a431301a770793e7a1be206b55d79c31f63b40f User:Jcm 2 211 306 2010-03-01T05:33:30Z Jcm 85 Created page with '[http://www.jonmasters.org/]' wikitext text/x-wiki [http://www.jonmasters.org/] 874d22a465fe88af2f046291d9ed206815c17db9 307 306 2010-03-01T05:34:23Z Jcm 85 wikitext text/x-wiki Jon Masters [http://www.jonmasters.org/] 62aca99972b3ffacaaac614a7d0af436380e67ad Utf-8 linux console 0 177 308 228 2010-03-01T13:37:50Z Dive 19 wikitext text/x-wiki [[Category:Tutorials]] ''by Dive'' == A Quick Look at Using UTF-8 in the Linux Console (without X) == A few people have asked about this in #slackware lately so I though I'd put down a few notes on how I got utf-8 up and running. Feel free to add any further info. In these days of high powered X desktop environments with all their flashy composite bells and whistles it may seem strange to worry about how the plain Linux console behaves, but we need to remember that there are some very nice applications that live in the console and can be just as (or even more) productive than the X Windows counterparts. I'm thinking of screen, irssi, mutt, elinks, vim/vi, mplayer (using svga), links, zgv and slrn to name but a few. And of course we have to mention Slackware tools like pgktool, slackpkg and sbopkg. Once you get hooked on using the console it is hard to go back. Anyway here we go ... == The Console == The first thing to do is configure the console. There is a kernel parameter we can add to /etc/lilo.conf to do this: append="vt.default_utf8=1" Here's an example from mine: # Linux bootable partition config begins image = /boot/vmlinuz-2.6.27.7-custom root = /dev/hda1 label = Linux-custom append="resume=/dev/hda2 vt.default_utf8=1" read-only # Linux bootable partition config ends Once you have saved lilo.conf and run '''lilo''' a quick reboot is needed. == Fonts == After that we need to find a font that actually contains the characters you want to see. My 'font of the moment' is lat9w-16. This contains the British £ (pound) and € (euro) symbols that I need, plus a lot of useful accented characters. But what is just as important are the correct drawing characters so that curses programs like pkgtool and sbopkg are printed on the screen correctly. If you experiment with the '''setconsolefont''' command you will find that some fonts draw curses box borders as squares or question marks, so check out some fonts and see which ones work and which don't. The '''setconsolefont''' command will put your chosen font into /etc/rc.d/rc.font so it will load at bootup. == Keyboard == Ok, great you can now read characters correctly, but you need the correct keymap to be able to type them. That's a little harder. If you can find a utf-8 keymap for your locale/hardware then that's fine. Personally I didn't find any of the installed keymaps suitable so I looked around for an alternative. I found a uk-utf8 keymap on the intertubes, but this was unfortunately missing all the Ctrl+[a-z] keys so I edited it and added my own. I also added some AltGr+[a-z] (well not all of those) for accented characters. You may find this keymap useful as a starting point to create your own if you cannot find a more suitable one. Have a look through the comments and the codes and you should pick up the method. To add your own combinations you will need to know the correct codes for the characters you need. You can find a table of utf-8 characters here: [http://home.tiscali.nl/t876506/utf8tbl.html]http://home.tiscali.nl/t876506/utf8tbl.html Look up the code in that table and convert it to hex. E.G. è is 232 in decimal, E8 in hex; é is code 233 in decimal, E9 in hex, so the entry in your keymap should be: # key = normal shifted AltGr+e AltGr+shift+e keycode 18 = e E U+00E8 U+00E9 # prints: e E è é You can find the keycodes with the '''showkey''' program. Once edited you can load the map with the '''loadkeys''' program. Loadkeys will update /etc/rc.d/rc.keymap but you will need to copy the keymap to /usr/share/kbd/keymaps/i386/qwerty/ so it is found on bootup. Here is a link to my updated uk-utf8 map: [http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz]http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz You can load this ungzipped but it's better to gzip it back after editing to keep things consistent. == Conclusion == By now you should have a fully usable keyboard/console correctly printing unicode characters. You will probably need to tell some programs like mutt and irrsi that you are using a utf-8 system. Note: There exists two shell scripts - '''unicode_start''' and '''unicode_stop'''. Typing '''unicode_start [font]''' will load the required font and set up keyboard correctly for unicode input. Bye for now, [[User:Dive|Dive]] 02:33, 20 March 2009 (UTC) 9cde8b79ff70c7b18df1de07eec1e82dc6de4390 DVB 0 81 309 103 2010-03-03T19:45:22Z Linuxman 87 /* Udev Rules */ wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps Eventually, my SlackBuild will be hosted here http://slackbuilds.rlworkman.net/CONTRIB/linuxtv-dvb-apps/ (thanks to robw810). == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ 75a8ff975f95ea3d57850216885694a0868a88d1 SLiM 0 212 310 2010-03-06T18:49:21Z Merge-delete 261 Created page with '= SLiM = '''SLiM (Simple Login Manager)''' is a Desktop-independent graphical login manager for X11, derived from [http://largo.windowmaker.org/Login.app/ Login.app]. It aims to...' wikitext text/x-wiki = SLiM = '''SLiM (Simple Login Manager)''' is a Desktop-independent graphical login manager for X11, derived from [http://largo.windowmaker.org/Login.app/ Login.app]. It aims to be light and simple, although completely configurable through themes and an option file; is suitable for machines on which remote login functionalities are not needed. == Features == * PNG and XFT support for alpha transparency and antialiased fonts * External themes support * Configurable runtime options: X server, login / shutdown / reboot commands * Single (GDM-like) or double (XDM-like) input control * Can load predefined user at startup * Configurable welcome / shutdown messages * Random theme selection == Requirements == * X11 * libpng * libjpeg * freetype == Instalation == Use package, SlackBuild or compile it from source. == Configuration == === Themes === Themes are located in /usr/share/slim/themes. If you want more themes, try themepack or standalone theme from [http://developer.berlios.de/project/showfiles.php?group_id=2663 project download page]. Unpack file there <pre> $ tar xvzf themefile.tar.gz -C /usr/share/slim/themes </pre> By default SLiM use ''default'' theme. You can change it in it's configuration file /etc/slim.conf by rewriting ''current_theme'' line <pre> # current theme, use comma separated list to specify a set to # randomly choose from #current_theme default current_theme theme_you_like </pre> If you use SlackBuild (at least for 13.0) it comes with nice Slackware theme. Rewrite ''current_theme'' line to <pre> current_theme slackware-black </pre> === Startup === Edit run level 4 init script - /etc/rc.d/rc.4 - to try start SLiM as default graphical login manager. You have to add these lines '''before''' GDM (or whatever graphical login manager you have as default; GDM is set as first to start by default) <pre> #! /bin/sh # # rc.4 This file is executed by init(8) when the system is being # initialized for run level 4 (XDM) # # Version: @(#)/etc/rc.d/rc.4 2.00 02/17/93 # # Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> # At least 47% rewritten by: Patrick J. Volkerding <volkerdi@slackware.com> # # Tell the viewers what's going to happen... echo "Starting up X11 session manager..." # Add this if statement to the top # If you have SliM, it goes first #--------------------------------- if [ -x /usr/bin/slim ]; then exec /usr/bin/slim -d fi #--------------------------------- # end of new if statement # Try to use GNOME's gdm session manager. This comes first because if # gdm is on the machine then the user probably installed it and wants # to use it by default: if [ -x /usr/bin/gdm ]; then exec /usr/bin/gdm -nodaemon fi </pre> If you aren't already using this, set run level to 4 in /etc/inittab <pre> # These are the default runlevels in Slackware: # 0 = halt # 1 = single user mode # 2 = unused (but configured the same as runlevel 3) # 3 = multiuser mode (default Slackware runlevel) # 4 = X11 with KDM/GDM/XDM (session managers) # 5 = unused (but configured the same as runlevel 3) # 6 = reboot # Default runlevel. (Do not set to 0 or 6) id:4:initdefault: </pre> Reboot and you have nice simple login manager running :~) == Links == [http://slim.berlios.de Project homepage] eaf47d14763bba1b658aafe397c67208e0149bf5 311 310 2010-03-06T18:51:36Z Merge-delete 261 category added wikitext text/x-wiki [[category:tutorials]] '''SLiM (Simple Login Manager)''' is a Desktop-independent graphical login manager for X11, derived from [http://largo.windowmaker.org/Login.app/ Login.app]. It aims to be light and simple, although completely configurable through themes and an option file; is suitable for machines on which remote login functionalities are not needed. == Features == * PNG and XFT support for alpha transparency and antialiased fonts * External themes support * Configurable runtime options: X server, login / shutdown / reboot commands * Single (GDM-like) or double (XDM-like) input control * Can load predefined user at startup * Configurable welcome / shutdown messages * Random theme selection == Requirements == * X11 * libpng * libjpeg * freetype == Instalation == Use package, SlackBuild or compile it from source. == Configuration == === Themes === Themes are located in /usr/share/slim/themes. If you want more themes, try themepack or standalone theme from [http://developer.berlios.de/project/showfiles.php?group_id=2663 project download page]. Unpack file there <pre> $ tar xvzf themefile.tar.gz -C /usr/share/slim/themes </pre> By default SLiM use ''default'' theme. You can change it in it's configuration file /etc/slim.conf by rewriting ''current_theme'' line <pre> # current theme, use comma separated list to specify a set to # randomly choose from #current_theme default current_theme theme_you_like </pre> If you use SlackBuild (at least for 13.0) it comes with nice Slackware theme. Rewrite ''current_theme'' line to <pre> current_theme slackware-black </pre> === Startup === Edit run level 4 init script - /etc/rc.d/rc.4 - to try start SLiM as default graphical login manager. You have to add these lines '''before''' GDM (or whatever graphical login manager you have as default; GDM is set as first to start by default) <pre> #! /bin/sh # # rc.4 This file is executed by init(8) when the system is being # initialized for run level 4 (XDM) # # Version: @(#)/etc/rc.d/rc.4 2.00 02/17/93 # # Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> # At least 47% rewritten by: Patrick J. Volkerding <volkerdi@slackware.com> # # Tell the viewers what's going to happen... echo "Starting up X11 session manager..." # Add this if statement to the top # If you have SliM, it goes first #--------------------------------- if [ -x /usr/bin/slim ]; then exec /usr/bin/slim -d fi #--------------------------------- # end of new if statement # Try to use GNOME's gdm session manager. This comes first because if # gdm is on the machine then the user probably installed it and wants # to use it by default: if [ -x /usr/bin/gdm ]; then exec /usr/bin/gdm -nodaemon fi </pre> If you aren't already using this, set run level to 4 in /etc/inittab <pre> # These are the default runlevels in Slackware: # 0 = halt # 1 = single user mode # 2 = unused (but configured the same as runlevel 3) # 3 = multiuser mode (default Slackware runlevel) # 4 = X11 with KDM/GDM/XDM (session managers) # 5 = unused (but configured the same as runlevel 3) # 6 = reboot # Default runlevel. (Do not set to 0 or 6) id:4:initdefault: </pre> Reboot and you have nice simple login manager running :~) == Links == [http://slim.berlios.de Project homepage] 036071edc0463993d0459ee168cec6353da76145 Main Page 0 1 312 263 2010-03-09T00:20:45Z Erik 1 Upgrade wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.15.2. [[User:Erik|Erik]] 00:20, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 0454a2a7482e27cda2d624f4f2284808b1d81e9b 313 312 2010-03-09T00:24:52Z Erik 1 Reverted edits by [[Special:Contributions/Erik|Erik]] ([[User talk:Erik|Talk]]) to last revision by [[User:Rworkman|Rworkman]] wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 6b3b81a3a9d0d4d69d7c37ee6df9263adf3cfe14 314 313 2010-03-09T00:25:21Z Erik 1 Upgrade wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 2f7fea1e7db732b200c136c9e7858575e233b744 345 314 2010-04-07T09:33:15Z Erik 1 Upgrade wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) | Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 91dcf0d37788b49b535866645856b7eeb26bf648 364 345 2010-05-30T08:31:44Z Erik 1 news, patch wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 75660b4f237ba65fae538c00c3ffeac5aefc2aad Kernel-packaging 0 213 315 2010-03-11T04:31:55Z Dive 19 Created page with '= Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and …' wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does the same thing, although the output might not be exactly what you expect. The first job is to create an output directory. I will be using '''/tmp/kernel-build''' for this so mkdir it now. == Output Into a Build Directory == From your kernel source directory do make O=/tmp/kernel-build menuconfig (or whichever method you prefer.) make mrproper This will delete your .config in the source tree so make sure you have a copy of it somewhere for safe keeping. Next steps are the same as a normal make and modules_install, but again using the O= switch: make O=/tmp/kernel-build make O=/tmp/kernel-build modules_install *Note: Do not use 'make install' as this *will* install it in /boot rather than our build directory. At this point everything we need is in the build directory. However, taking a look inside it shows many more things have been placed there than we need. The kernel is in arch/x86/boot/ as usual and the modules are in various directories. Luckily for us there is a file, '''modules.order''', which lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using: #!/bin/bash SOURCE=/usr/src/linux-2.6.29.6-jabberwok ARCH=i386 KARCH=i686 MODULELIST=modules.order PRGNAM=kernel VERSION=2.6.29.6 BUILD=1 TAG=_daw LOCALNAME=jabberwok OUTPUT=/tmp KOUTPUT=$OUTPUT/$PRGNAM-$LOCALNAME PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION BUILDDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $KOUTPUT rm -rf $PKG mkdir -p $BUILDDIR mkdir -p $KOUTPUT cd $SOURCE make O=$KOUTPUT menuconfig make mrproper make O=$KOUTPUT make O=$KOUTPUT modules_install cd $KOUTPUT for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $BUILDDIR/$(dirname $i) install -m 644 -v $i $BUILDDIR/$(dirname $i) done mkdir $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. |-----handy-ruler------------------------------------------------------| kernel-jabberwok: kernel and modules 2.6.29.6-jabberwok kernel-jabberwok: kernel-jabberwok: Jabberwokky type kernel! kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 8497101f5ab8034263df0e20756fb5393946ed85 316 315 2010-03-11T04:32:58Z Dive 19 wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does the same thing, although the output might not be exactly what you expect. The first job is to create an output directory. I will be using '''/tmp/kernel-build''' for this so mkdir it now. == Output Into a Build Directory == From your kernel source directory do make O=/tmp/kernel-build menuconfig (or whichever method you prefer.) make mrproper This will delete your .config in the source tree so make sure you have a copy of it somewhere for safe keeping. Next steps are the same as a normal make and modules_install, but again using the O= switch: make O=/tmp/kernel-build make O=/tmp/kernel-build modules_install *Note: Do not use 'make install' as this *will* install it in /boot rather than our build directory. At this point everything we need is in the build directory. However, taking a look inside it shows many more things have been placed there than we need. The kernel is in arch/x86/boot/ as usual and the modules are in various directories. Luckily for us there is a file, '''modules.order''', which lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using: #!/bin/bash SOURCE=/usr/src/linux-2.6.29.6-jabberwok ARCH=i386 KARCH=i686 MODULELIST=modules.order PRGNAM=kernel VERSION=2.6.29.6 BUILD=1 TAG=_daw LOCALNAME=jabberwok OUTPUT=/tmp KOUTPUT=$OUTPUT/$PRGNAM-$LOCALNAME PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION BUILDDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $KOUTPUT rm -rf $PKG mkdir -p $BUILDDIR mkdir -p $KOUTPUT cd $SOURCE make O=$KOUTPUT menuconfig make mrproper make O=$KOUTPUT make O=$KOUTPUT modules_install cd $KOUTPUT for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $BUILDDIR/$(dirname $i) install -m 644 -v $i $BUILDDIR/$(dirname $i) done mkdir $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. |-----handy-ruler------------------------------------------------------| kernel-jabberwok: kernel and modules 2.6.29.6-jabberwok kernel-jabberwok: kernel-jabberwok: Jabberwokky type kernel! kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 6841dc5587229bc88ed477ee707a797d8f1216cd 317 316 2010-03-11T05:02:29Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does the same thing, although the output might not be exactly what you expect. The first job is to create an output directory. I will be using '''/tmp/kernel-build''' for this so mkdir it now. == Output Into a Build Directory == From your kernel source directory do make O=/tmp/kernel-build menuconfig (or whichever method you prefer.) make mrproper This will delete your .config in the source tree so make sure you have a copy of it somewhere for safe keeping. Next steps are the same as a normal make and modules_install, but again using the O= switch: make O=/tmp/kernel-build make O=/tmp/kernel-build modules_install *Note: Do not use 'make install' as this *will* install it in /boot rather than our build directory. At this point everything we need is in the build directory. However, taking a look inside it shows many more things have been placed there than we need. The kernel is in arch/x86/boot/ as usual and the modules are in various directories. Luckily for us there is a file, '''modules.order''', which lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using: #!/bin/bash SOURCE=/usr/src/linux-2.6.29.6-jabberwok ARCH=i386 KARCH=i686 MODULELIST=modules.order PRGNAM=kernel VERSION=2.6.29.6 BUILD=1 TAG=_daw LOCALNAME=jabberwok OUTPUT=/tmp KOUTPUT=$OUTPUT/$PRGNAM-$LOCALNAME PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $KOUTPUT rm -rf $PKG mkdir -p $KOUTPUT cd $SOURCE make O=$KOUTPUT menuconfig make mrproper make O=$KOUTPUT make O=$KOUTPUT modules_install cd $KOUTPUT for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. |-----handy-ruler------------------------------------------------------| kernel-jabberwok: kernel and modules 2.6.29.6-jabberwok kernel-jabberwok: kernel-jabberwok: Jabberwokky type kernel! kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) f689e818391a0dd97e8971175e20bbed9e018947 318 317 2010-03-11T05:22:44Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does the same thing, although the output might not be exactly what you expect. The first job is to create an output directory. I will be using '''/tmp/kernel-build''' for this so mkdir it now. == Output Into a Build Directory == From your kernel source directory do make O=/tmp/kernel-build menuconfig (or whichever method you prefer.) make mrproper This will delete your .config in the source tree so make sure you have a copy of it somewhere for safe keeping. Next steps are the same as a normal make and modules_install, but again using the O= switch: make O=/tmp/kernel-build make O=/tmp/kernel-build modules_install *Note: Do not use 'make install' as this *will* install it in /boot rather than our build directory. At this point everything we need is in the build directory. However, taking a look inside it shows many more things have been placed there than we need. The kernel is in arch/x86/boot/ as usual and the modules are in various directories. Luckily for us there is a file, '''modules.order''', which lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using: #!/bin/bash KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} LOCALNAME=${LOCALNAME:-jabberwok} OUTPUT=${TMP:-/tmp} KOUTPUT=$OUTPUT/$PRGNAM-$LOCALNAME PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $KOUTPUT rm -rf $PKG mkdir -p $KOUTPUT cd $SOURCE make O=$KOUTPUT menuconfig make mrproper make O=$KOUTPUT make O=$KOUTPUT modules_install cd $KOUTPUT for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. |-----handy-ruler------------------------------------------------------| kernel-jabberwok: kernel and modules 2.6.29.6-jabberwok kernel-jabberwok: kernel-jabberwok: Jabberwokky type kernel! kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: kernel-jabberwok: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 67729ffee3efbbd77939fff1251d545571d06634 319 318 2010-03-11T08:34:43Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does the same thing, although the output might not be exactly what you expect. The first job is to create an output directory. I will be using '''/tmp/kernel-build''' for this so mkdir it now. == Output Into a Build Directory == From your kernel source directory do make O=/tmp/kernel-build menuconfig (or whichever method you prefer.) make mrproper This will delete your .config in the source tree so make sure you have a copy of it somewhere for safe keeping. Next steps are the same as a normal make and modules_install, but again using the O= switch: make O=/tmp/kernel-build make O=/tmp/kernel-build modules_install *Note: Do not use 'make install' as this *will* install it in /boot rather than our build directory. At this point everything we need is in the build directory. However, taking a look inside it shows many more things have been placed there than we need. The kernel is in arch/x86/boot/ as usual and the modules are in various directories. Luckily for us there is a file, '''modules.order''', which lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using: #!/bin/bash KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} LOCALNAME=${LOCALNAME:-jabberwok} OUTPUT=${TMP:-/tmp} KOUTPUT=$OUTPUT/$PRGNAM-$LOCALNAME PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $KOUTPUT rm -rf $PKG mkdir -p $KOUTPUT cd $SOURCE make O=$KOUTPUT menuconfig make mrproper make O=$KOUTPUT make O=$KOUTPUT modules_install cd $KOUTPUT for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 5e810eeaadac25e45280e860d309255a1c68d108 320 319 2010-03-11T08:42:07Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does the same thing, although the output might not be exactly what you expect. The first job is to create an output directory. I will be using '''/tmp/kernel-build''' for this so mkdir it now. == Output Into a Build Directory == From your kernel source directory do make O=/tmp/kernel-build menuconfig (or whichever method you prefer.) make mrproper This will delete your .config in the source tree so make sure you have a copy of it somewhere for safe keeping. Next steps are the same as a normal make and modules_install, but again using the O= switch: make O=/tmp/kernel-build make O=/tmp/kernel-build modules_install *Note: Do not use 'make install' as this *will* install it in /boot rather than our build directory. At this point everything we need is in the build directory. However, taking a look inside it shows many more things have been placed there than we need. The kernel is in arch/x86/boot/ as usual and the modules are in various directories. Luckily for us there is a file, '''modules.order''', which lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using: #!/bin/sh # Slackware build script for kernel and modules # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} LOCALNAME=${LOCALNAME:-jabberwok} OUTPUT=${TMP:-/tmp} KOUTPUT=$OUTPUT/$PRGNAM-$LOCALNAME PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $KOUTPUT rm -rf $PKG mkdir -p $KOUTPUT cd $SOURCE make O=$KOUTPUT menuconfig make mrproper make O=$KOUTPUT make O=$KOUTPUT modules_install cd $KOUTPUT for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 5fd4b65193121cd53a190b8f17cd33a7ad444c38 321 320 2010-03-11T08:42:34Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does the same thing, although the output might not be exactly what you expect. The first job is to create an output directory. I will be using '''/tmp/kernel-build''' for this so mkdir it now. == Output Into a Build Directory == From your kernel source directory do make O=/tmp/kernel-build menuconfig (or whichever method you prefer.) make mrproper This will delete your .config in the source tree so make sure you have a copy of it somewhere for safe keeping. Next steps are the same as a normal make and modules_install, but again using the O= switch: make O=/tmp/kernel-build make O=/tmp/kernel-build modules_install *Note: Do not use 'make install' as this *will* install it in /boot rather than our build directory. At this point everything we need is in the build directory. However, taking a look inside it shows many more things have been placed there than we need. The kernel is in arch/x86/boot/ as usual and the modules are in various directories. Luckily for us there is a file, '''modules.order''', which lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using: #!/bin/sh # Slackware build script for kernel and modules # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} LOCALNAME=${LOCALNAME:-jabberwok} OUTPUT=${TMP:-/tmp} KOUTPUT=$OUTPUT/$PRGNAM-$LOCALNAME PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $KOUTPUT rm -rf $PKG mkdir -p $KOUTPUT cd $SOURCE make O=$KOUTPUT menuconfig make mrproper make O=$KOUTPUT make O=$KOUTPUT modules_install cd $KOUTPUT for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) ca2046dc840fdadfe369783b844d9e3a1bdd663f 322 321 2010-03-11T12:37:35Z Dive 19 /* Kernel Output Target Option */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. == Output Into a Build Directory == From your kernel source directory do make O=/tmp/kernel-build menuconfig (or whichever method you prefer.) make mrproper This will delete your .config in the source tree so make sure you have a copy of it somewhere for safe keeping. Next steps are the same as a normal make and modules_install, but again using the O= switch: make O=/tmp/kernel-build make O=/tmp/kernel-build modules_install *Note: Do not use 'make install' as this *will* install it in /boot rather than our build directory. At this point everything we need is in the build directory. However, taking a look inside it shows many more things have been placed there than we need. The kernel is in arch/x86/boot/ as usual and the modules are in various directories. Luckily for us there is a file, '''modules.order''', which lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using: #!/bin/sh # Slackware build script for kernel and modules # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} LOCALNAME=${LOCALNAME:-jabberwok} OUTPUT=${TMP:-/tmp} KOUTPUT=$OUTPUT/$PRGNAM-$LOCALNAME PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $KOUTPUT rm -rf $PKG mkdir -p $KOUTPUT cd $SOURCE make O=$KOUTPUT menuconfig make mrproper make O=$KOUTPUT make O=$KOUTPUT modules_install cd $KOUTPUT for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 6d453c899b7e398743f8df91cb2459ed7873220e 323 322 2010-03-11T12:41:43Z Dive 19 /* Output Into a Build Directory */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. == Building == From your kernel source directory do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install' as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using: #!/bin/sh # Slackware build script for kernel and modules # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} LOCALNAME=${LOCALNAME:-jabberwok} OUTPUT=${TMP:-/tmp} KOUTPUT=$OUTPUT/$PRGNAM-$LOCALNAME PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $KOUTPUT rm -rf $PKG mkdir -p $KOUTPUT cd $SOURCE make O=$KOUTPUT menuconfig make mrproper make O=$KOUTPUT make O=$KOUTPUT modules_install cd $KOUTPUT for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 4fcd082baf2265f6b92e71f4d965b467c2de2ae7 324 323 2010-03-11T12:44:12Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. == Building == From your kernel source directory do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install' as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using: #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} LOCALNAME=${LOCALNAME:-jabberwok} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make menuconfig make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) ebceb1fda724d506054dd9d1d5511edb16253590 325 324 2010-03-11T12:49:02Z Dive 19 /* Building */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install' as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using: #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} LOCALNAME=${LOCALNAME:-jabberwok} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make menuconfig make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 99cea2ed4656ab7bc44169fd6ca4c0fcfea5f0a0 327 325 2010-03-11T13:35:27Z Dive 19 /* Kernel Output Target Option */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install' as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using: #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} LOCALNAME=${LOCALNAME:-jabberwok} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make menuconfig make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) b52806a7571960c5750495a604fb3e91aa6cd025 328 327 2010-03-11T14:17:42Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install' as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} LOCALNAME=${LOCALNAME:-jabberwok} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 4c37e7baef3d2f7a384dbf98a8615b5b34492321 329 328 2010-03-11T15:07:11Z Dive 19 /* Building */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} LOCALNAME=${LOCALNAME:-jabberwok} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 3ab57804a8346c840615879a3abcac6d1940e4c3 330 329 2010-03-11T19:24:44Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install echo "/sbin/depmod -a" > /tmp/kernel-package/install/doinst.sh I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. source .config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 8dc44447266180feba42196a906c0edc85ba9504 334 330 2010-03-14T16:11:56Z Dive 19 /* Installing Modules and Kernel to our Package Directory */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. source .config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 84f4fd567497f1178b2818baa04b4de5c0a96c11 335 334 2010-03-14T16:13:25Z Dive 19 /* Installing Modules and Kernel to our Package Directory */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. source .config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install echo "/sbin/depmod -a" > $PKG/install/doinst.sh cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) dfac7312de4a12ee9383e4c539da2447187f560a 336 335 2010-03-14T16:15:43Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source .config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) c15b6f9586de3c4ae2a98faa893736dd8d030a4b 337 336 2010-03-14T16:16:27Z Dive 19 /* Installing Modules and Kernel to our Package Directory */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir $PKG/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source .config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 1539a2f7afd2701bf7fc33da4f34054ddbc78723 338 337 2010-03-14T16:16:58Z Dive 19 /* Installing Modules and Kernel to our Package Directory */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir $PKG/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source .config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 5294cb16d220615abe5723f278737f1d3c694ae8 339 338 2010-03-14T16:19:26Z Dive 19 /* Installing Modules and Kernel to our Package Directory */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir -p /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source .config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 8f45ef7663b5e7b203b97065cab226ed00a2aeee 340 339 2010-03-14T16:19:48Z Dive 19 /* Installing Modules and Kernel to our Package Directory */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source .config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) a7181a95ac6056d757fe6739ecfa70ccea41e9c3 341 340 2010-03-14T16:21:47Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source .config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) EOF cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 478fbb66be039b6e94e4ae69e78845442d2c1014 342 341 2010-03-14T16:22:55Z Dive 19 /* Conclusion */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6_tag-i686-1.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source .config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) EOF cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 714d2be704fbfa7f16256a73b06c7bacb4085593 Talk:Kernel-packaging 1 214 326 2010-03-11T12:52:41Z Dive 19 Created page with 'Originally I used the O= switch to build in a separate build directory. This isn't really necesary, but if you prefer to do this have a look at the README file in top directory a…' wikitext text/x-wiki Originally I used the O= switch to build in a separate build directory. This isn't really necesary, but if you prefer to do this have a look at the README file in top directory about the O= switch. 4619bc1fd69f06de005618d952320049c5f7487c Packages 0 18 331 25 2010-03-13T13:49:07Z Grissiom 11 update pkg formats wikitext text/x-wiki Slackware's package management system utilizes .tgz/.txz tarballs as its standard package format. These tarballs are tar.gz/tar.xz archives which contain Slackware built binaries, support files, a description file and installation script. Although they can be unzipped and untarred like a normal archive, they are (usually) binary-only packages intended to be installed through Slackware's provided package management tools. Information about a package is stored in two ways, in the filename of the package and a description file inside that package. ==Package Tools== See the respective manual pages for more information on each of the following commands. <code>pkgtool</code> <code>installpkg</code> <code>removepkg</code> <code>explodepkg</code> <code>makepkg</code> <code>upgradepkg</code> ==Slackware Package Layout== A typical Slackware package is laid out as such: ./ ./install/doinst.sh ./install/slack-desc [./usr/bin] [./usr/lib] [...] The install directory as well as the files within it will be deleted after the installation of the package to the root install directory (usually '/'). The install directory is not necessarily required for the most basic packages but allows additional functionality: [[slack-desc]] contains the package description, and [[doinst.sh]] contains post-installation instructions such as creating symbolic links. Every other file within the package is simply untarred (extracted) to the root directory. Most of these files are in standard locations. There are other special files within packages: '''usr/doc/<appname><version>''' All documentation included with the package (such as README, INSTALL, ChangeLog, docs/, etcetera) should be placed in this directory. Some of the files in this directory should be manually copied from the source archive, since Makefiles usually don't copy these documentation files to the package build tree. ==Making Slackware Packages== See [[Building A Package]] fe0de126b2c1721187c5b06087f5631486e6a545 333 331 2010-03-13T15:36:21Z Grissiom 11 wikitext text/x-wiki Slackware's package management system utilizes .tgz/.txz tarballs as its standard package format. These tarballs are tar.gz/tar.xz archives which contain Slackware built binaries, support files, a description file and installation script. Although they can be unzipped and untarred like a normal archive, they are (usually) binary-only packages intended to be installed through Slackware's provided package management tools. Information about a package is stored in two ways, in the filename of the package and a description file inside that package. ==Package Tools== See the respective manual pages for more information on each of the following commands. <code>pkgtool</code> <code>installpkg</code> <code>removepkg</code> <code>explodepkg</code> <code>makepkg</code> <code>upgradepkg</code> ==Slackware Package Layout== A typical Slackware package is laid out as such: ./ ./install/doinst.sh ./install/slack-desc [./usr/bin] [./usr/lib] [...] The install directory as well as the files within it will be deleted after the installation of the package to the root install directory (usually '/'). The install directory is not necessarily required for the most basic packages but allows additional functionality: [[slack-desc]] contains the package description, and [[doinst.sh]] contains post-installation instructions such as creating symbolic links. Every other file within the package is simply untarred (extracted) to the root directory. Most of these files are in standard locations. There are other special files within packages: '''usr/doc/<appname><version>''' All documentation included with the package (such as README, INSTALL, ChangeLog, docs/, etcetera) should be placed in this directory. Some of the files in this directory should be manually copied from the source archive, since Makefiles usually don't copy these documentation files to the package build tree. ==Making Slackware Packages== See [[Building A Package]] [[Category: Information]] 29ecbc47c3624fd37e27efb0674fab3ddecae81e Life of a Software Package 0 104 332 127 2010-03-13T15:32:58Z Grissiom 11 /* Slackware specifics */ wikitext text/x-wiki From the programmer's keyboard to your (Slackware) Linux system. = Introduction = This article explains how a program someone writes in one side of the world ends up being managed in your system. It's meant to be easy to understand for a novice user coming from Windows, and only requires some basic knowledge of Unix systems. Specifically, the reader should know: * How basic Unix permissions work. * How to interpret the basic output of the ''ls'' command. * How a command line interface works. It only contains general ideas that could help a novice user understand the existing differences when installing software under Windows and under Unix, but no specific information about how to do it. The distribution manual will give you the specific details you need, and may be a good read after you have read this article. = From source code to machine language = '''Note''': You do not need to run any of the commands in this section. It's enough to understand the text and part of the output. When a programmer creates a program, it's very common to write the program in a so-called high level language. In other words, he doesn't create the program executable directly specifying the intructions for the computer to run. He writes the program in a language that allows him to represent the program structure and logic, and then that logic is translated to a language the bare machine can understand. Let's suppose someone wants to write a ''Hello, World'' program in the C programming language. This is a program that prints a message to the screen and finishes, in order to check your system can translate the language you have used to machine language and to test the basic stuff works, as well as to give the novice programmer an idea on how the high level language works. This would be a very simple ''Hello, World'' program written in C: #include <stdio.h> int main() { printf("Hello, World!\n"); return 0; } You do not need to understand that program. The above text is what is commonly known as the '''source code''' of the program. The source code of a program in C is usually spread over one or more source files, so this program could very well be stored in a plain text file called ''hello.c''. You could view this file using a plain text editor like the Windows notepad. This file cannot be executed directly because it's not a real program. First off, it doesn't have execution permissions, and if we tried to give it execution permissions and run it, we would get an error message: $ ls -l hello.c -rw------- 1 rg3 users 74 2007-10-15 19:27 hello.c $ chmod +x hello.c $ ./hello.c ./hello.c: line 3: syntax error near unexpected token `(' ./hello.c: line 3: `int main()' We need to use a program called ''compiler'' to get a binary and executable file. A file in a specific format that the operating system (Linux in our case) can understand. When you run it, the operating system reads the file, copies the different program components to the computer's memory and starts the program execution. If our machine has everything ready to compile C programs and we want to use the GNU C Compiler (''gcc''), we could do something as simple as: $ gcc -o hello hello.c And we would get a file named ''hello'' which is our program ready to be run. As you see, our program is simply called ''hello'' and not ''hello.exe'', which would be a common name if we were working under Windows. In Unix systems, the convention is that programs do not have any file extension in their name (like EXE). We could then run the program and see that it does what we wanted. $ ./hello Hello, World! $ = Complex programs use libraries = Most programs do a more sophisticated task than printing a message on the screen and finishing. The source code of the program above has 7 lines. It is not uncommon for a simple program to have thousands of lines, and there are a good amount of complex programs out there that have millions of lines of source code. It is also a very common practice to use items called '''libraries''' (usually '''shared''' libraries) to build your program. Libraries are files that contain the machine code to perform several different tasks. For example, let's suppose you were going to create a program that needs to download some data from the Internet, via HTTP (the web) or via FTP or another network service. And also let's suppose you don't have much knowledge on how to create a program that talks to others using the network, or that the focus of your program is on solving some other problem and you don't want to lose time or create a lot of code just because you want it to be able to download a file. Fortunately for you, there is a library called ''libcurl'' that makes retrieving files over the network very easy. The library contains all the code you need, so the source code you are going to create will not contain anything specific to be able to use the network. You simply indicate that you want to use ''libcurl'' and call the library functions everytime you want to download a file. Do you need to learn to sail or fly a plane or a different language if you want to send a letter to a friend in a different continent? No, you put the letter in the mailbox and the postal service does it for you. Libraries work like this. In the moment you decide to do this, your program starts '''depending''' on ''libcurl''. Some pieces of the library need to be present in your system if you want to compile that program to create an executable, and some other pieces need to be present in the moment you want to ''run'' the program. Else, the program will not compile or will not be able to run. Libraries are convenient because, if managed well, you can install them in your system once and they will be used by every program that needs them. This is why libraries are regarded as a ''good thing'' or a ''good idea'' in the programming world, in most cases. In Windows, shared libraries are called DLLs, as the library files usually have the DLL extension. In Unix, it's common for them to have the ''.so'' suffix, or some other containing it. For example, I have ''libcurl'' in my system, and the shared library is located in the file ''/usr/lib/libcurl.so.4.0.0''. = Libraries and programs all over the place need a package manager = So your system is going to be populated by a lot of programs, many of them using many different libraries for different tasks, some of them having some libraries in common, others having nothing in common. As you can guess, this situation can evolve into a pretty chaotic system. Let's describe how Windows did this in the past, and how Unix systems have been trying to handle the situation for a good amount of years now. In Windows, most people distribute programs already compiled. You get a group of files or a single file that holds your program already prepared to be run. You extract those contents and place them somewhere in your hard drive, usually all of them under a specific directory (folder). You could then create some shortcuts in the ''start'' menu and the program is ready to be run. A installer program usually does all of this for you, asking some questions. What happens when the program uses a library? If the library is not very common and cannot be assumed to exist in a standard Windows installation, the common practice is to include a copy of the library with the program. If it's a relatively uncommon library, the installer usually puts it in the same place as the program, and when it is run and requests the library, the system first looks in the folder holding the program and finds the library there, and starts to use it. If it's not an uncommon library but you need a specific version of it, the installer may try to install it in a common place so all the programs can use it. It was very typical, when you had a system in which you had installed a lot of software as time passed, that the installer would ask you "I am trying to install the following library, but it appears to be present in your system in a newer version. Do you want me to replace the copy of it with my copy or do I leave it as it is?". And, in the same line, when you removed the program it would say "I was going to remove this library from the common place, but other programs may want to use it. Can I remove it or should I keep it there?". This chaos was called "DLL Hell". Unix tries to avoid this problem in several ways, and its solutions bring the need of a package manager as we will explain. First off, in Unix the files on your hard drive are not grouped by program, but by their function. All binaries are stored in two or three folders, and the same for libraries or help documents. If all the documentation and help for the different programs is installed in a common location, it's easier to create a help system from which you can browse the documentation of every program installed on the computer, for example. This is generally considered a good idea and it's the tradition, but of course the idea has its detractors. Anyway, a second difference is that in Unix programs are distributed alone. If a program needs a library to be run, it needs to specify that somewhere, but only under special circumstances it's recommended to include the library as part of the program. In most cases, the library is distributed apart. Those two differences avoid the DLL hell. By installing libraries, programs, documentation and other data to common system locations, you avoid duplicating data. If there's a security problem using a library and every program using it could become compromised and make the system vulnerable, you update the library once and all the programs that use it are automatically protected, as each program doesn't include its own copy in its directory. By separating the programs from the libraries they use and distributing them apart, you make sure programs do not overwrite the libraries used by others or remove common libraries when they are removed. However, the solution itself brings some new problems. For example, if a program installs files all over common system directories and I later want to remove it, how do I know which files need to be removed? And if a program requires a library to run, can I or should I specify that fact somewhere? Package managers are the answer. Under Unix, software is many times distributed as '''packages'''. Packages are groups of files that contain programs, libraries, documentation or simply data. Under Windows, to install a program many times you download an installer file, run it and the program is installed. This installer file that holds inside all the files the program needs and extracts them to the proper location could be considered a form of package, so you get an idea. Packages in Unix are usually managed by a package manager. A package manager is a program that allows you to install packages, check the list of installed packages, remove packages and many more complex tasks depending on how powerful and featureful the package manager itself is. When you install a program using a package, the package holds the program binary, the program data and the program documentation, typically, along with information on where those files should be installed in the system, all over the place. Fortunately, prior, during or after the installation, after copying the files to your system, the package manager records somewhere the name and version of the package and the files it installed. This is the trick that allows you to later remove the package using the package manager without having to remember which files had been installed where. In addition, the package may hold information about other packages it needs installed for it to run, and this information may be used by the package manager to automatically download and install them too. Hopefully, you now start to understand the practical vision behind packages and package managers. = Too many package managers = The problem with package managers is that many Unix systems and even many different Linux distributions use many different package managers. Each one uses different package formats that cannot understand each other. Slackware uses ''pkgtools'', Debian and Ubuntu use ''apt-get'', Red Hat uses ''yum'', Mandriva uses ''urpmi'', Arch uses ''pacman'', etc. You are a programmer and created the ''Hello, World'' program we saw at the beginning. How do you distribute your program? You have several solutions. If you don't want people to get the source code of your program, you need to distribute the program already compiled and probably packaged. To do that, you could provide your own program to install and uninstall the package cleanly from any system, and distribute it somehow and break some rules to achieve maximum compatibility, so the program will run on many different systems and distributions. Many commercial games are shipped this way. Unreal Tournament 2004 for Linux is distributed this way, for example. You could also provide it as a package for each of a subset of supported systems. Many companies do this. They give you Debian, Red Hat, Suse and Mandriva packages for you to choose, for example, each in the proper format to be used with the package manager from that distribution. If you want to use the software under other system you are out of luck. You can try some tricks but it's not guaranteed to work. If, on the other hand, your program is open source and you don't mind people reading the source code of your program, the common case is to avoid creating a package for anything. You simply distribute a tarball (similar to a ZIP or RAR file) containing the source code and instructions to compile it. If someone wants a Debian package to install it, someone will have to compile your program under Debian, and make a package with the result. This is a very very very common case. In fact, distributions like Ubuntu or Debian heavily rely on '''package repositories''', network locations from where you can download thousands of packages for your system, created by a myriad of official and unofficial packagers (people that create packages for the system). For example, if you want to install a program under Ubuntu, it's very infrequent for the program not to exist already packaged in a repository, and you can download and install it, together with its dependencies, in a couple of mouse clicks. = Summing up = * Many times the programmer creates programs using source code that must be compiled. * They use libraries to make writing programs easy. * Distributing the resulting program is easier using a package manager. * Many programmers only give you the source code due to the diversity of package managers and systems. * Someone else is responsible for creating a package for a specific system. = Slackware specifics = Slackware is, as you may know, a very simple system. Being simple doesn't mean it's simple to use. On the contrary, a system with a simple design and simple tools usually requires the user to do more things to achieve a goal. The advantage of a simple design is that it's easier to understand if you want to know how your system works, and sometimes it's also more stable and has less bugs. As part of its simple design, the package manager in Slackware is also very simple, and its packages are also very simple. Slackware packages are tarballs (again, something like ZIP files) that, if extracted in the right place, will populate the system with the package files, and it also holds some special files with information about the package itself. As they are simple tarballs, Slackware doesn't try to hide this fact, and Slackware packages have the ''tgz/txz'' extension (short for ''tar.gz/tar.xz''), contrary to other systems in which packages have a special extension to make it clear that they are packages, like ''rpm'' or ''deb''. This is not a problem, but sometimes this confuses novice users. They go to the program webpage and download the program source code in a tarball (usually a file with ''tar.gz'' extension) and think "Hey, if Slackware packages are tarballs and this is a tarball, I'm going to install this file with the package manager". Wrong! Even when the package manager complains that the package name does not end in ''tgz'' but on ''tar.gz'', they many times rename the file and try again. Those are two mistakes in a row. The package manager will try to extact the tarball contents to that special location we mentioned earlier and nothing will happen, as the files inside the tarball are not structured as they need to be, but this is the small problem. The big one is that what you are trying to install is the source code of the program, and not the program itself! Remember, you need to compile it first in the majority of cases. Under Slackware, you should first check if there is an official package for the program. If there is not, you could try to to download a ready to use package from a place or someone you trust. Else, you could compile the program yourself and create a package for it, and then install the package. The compilation and package creation can be automated sometimes for ease of use, for example using [[SlackBuild Scripts|SlackBuild scripts]]. [[Category:Information]] 712647b02c547102f2dcd6c07bd337eb916207ca SlackRoll Tutorial 0 157 344 185 2010-03-23T03:22:16Z Merge-delete 261 official webpage updated wikitext text/x-wiki <strong>SlackRoll</strong> is a package or update manager for Slackware Linux. Part of this tutorial has been taken from its [http://rg3.github.com/slackroll/ official webpage] and FAQ. SlackRoll's defining points: * Its internal mechanism based on package states. * Like <em>slackpkg</em>, SlackRoll only works with official mirrors, meaning that to keep third party packages up to date you need to perform the task by hand (recommended practice, using SlackBuild scripts) or use a second different tool. * It does not try to compare package version numbers to decide if a package should be upgraded or not. * Partly as a consequence of the previous point, it has no known flaws detecting package updates (including reverts), new packages, removed packages, third party packages getting an official version and blacklisted packages (<em>frozen</em> in its terminology) being removed. * It has a broad range of operations and features. * It attempts to be fast. Most internal operations like listing available upgrades usually take less than one second on a modern computer. = Installation = == Requirements == * Python 2.4 or later (provided by package <em>python</em> starting with Slackware 10.1). * GnuPG (provided by package <em>gnupg</em> or <em>gnupg2</em>). * Vim (provided by package <em>vim</em>). * A pager which is <em>less</em> by default (provided by package <em>less</em>). == Procedure == Download the SlackRoll package from the [http://github.com/rg3/slackroll/downloads project download page] and install it in your system using <tt>installpkg</tt>. = Background Information = The majority of SlackRoll commands that receive a list of packages expect only the package names (<em>foo</em> as opposed to <em>foo-1.1-i486-3.tgz</em>). Some of them also allow using a specific version, but they are the exception. SlackRoll creates a persistent database of packages in your hard drive. Each package is in one of several possible states. Part of the initial configuration consists in deciding which states some of your packages will have. There are two types of states: states to avoid (temporary states) and normal states. When the remote Slackware official tree is updated, SlackRoll may put some packages in temporary states. By upgrading, installing, removing and marking packages your objective is to correct those packages and put them in a normal state. == States to Avoid == === New === New packages are packages present in the remote tree that weren't present before. You should decide if you want to install them or mark them as not installed. === Outdated === Outdated packages are present in your system, but the version you have does not match any relevant one in the remote tree. You should upgrade these packages. === Unavailable === Unavailable packages are packages present in your system. Previously, they probably existed in the remote tree, but now they do not seem to be available for downloading and installing. You should decide if you want to remove them or mark them as foreign. == Normal States == === Installed === Installed packages are very common. They are present in your system and in the remote tree, and both versions match. === Not Installed === Not installed packages are also very common. They are present in the remote tree but not in your system. They can be downloaded and installed if you want. === Foreign === Foreign packages are packages present in your system but not in the remote tree. However, unlike unavailable packages, they are supposed to be present in your system. No package will enter this state automatically. Only the ones you mark. It's usually reserved for third party packages and packages you build yourself. It's worth noting that if a foreign package ever appears in the remote official tree, it will be marked as installed or, probably, outdated. Thus, SlackRoll will give priority to the new official package over yours. If you still want to use your own build, mark it as frozen. === Frozen === Frozen packages are present in your system and in the remote tree. Your version may or may not match the ones from the remote tree, but SlackRoll will not tell you they need to be upgraded. No package will enter this state automatically. It's usually reserved for packages that shouldn't be upgraded automatically or ever (<em>aaa_elflibs</em>, kernels, etc) and sometimes for customized versions of official packages. It's also worth mentioning that a frozen package will be moved to unavailable if it disappears from the remote tree. It that happens and you want to continue using it, you'll need to mark it as foreign. = Initial Configuration = Word of warning: it's highly recommended to do the initial configuration from an up-to-date and controlled system. This will avoid confusion and helps preventing mistakes setting the initial package states. == Preparing Your System == Choose a Slackware mirror for your Slackware version. Use the <em>set-mirror</em> operation to select one mirror. SlackRoll can work with stable trees as well as the <em>current</em> tree. Example: # slackroll set-mirror 'http://slackware.example.org/slackware-current/' Do not forget to include the trailing slash in the mirror URL. Import, to your keyring, the GnuPG key used to sign the official Slackware packages. This key can be found in Slackware CDs and DVDs as the file GPG-KEY, and you can import the key to your keyring using the command <em>gpg --import</em>, but SlackRoll is able to download the key from the mirror and importing it automatically, if you trust the mirror. # slackroll import-key Finally, retrieve the mirror information for the first time. This will download a few metadata files, and this is what you need to do when you're going to handle a new round of updates. # slackroll update == Going Over Package States for The First Time == When you run SlackRoll for the first times, it will put every remote package not present in your system in the state New. When your system is up to date and under control, you can blindly mark every new package as not installed with the following command: # slackroll new-not-installed Any third party package present in your system will be put in the state Unavailable. When your system is up to date and under control you can blindly mark all unavailable packages as foreign. <em>However</em>, the number of foreign packages is usually not very high and forgetting to remove from your system a package that was removed from the remote tree is a common mistake. The Book of Best Practices would suggest that you review the list of unavailable packages once and carefully in order to detect packages that should not be present in your system. To print the list run: # slackroll list-unavailable If you locate any package that needs to be removed, you can remove them using <em>removepkg</em> or the <em>remove</em> operation. The later has additional functionality so it's recommended: # slackroll remove foo bar Now you can mark the rest as foreign packages. # slackroll unavailable-foreign Finally, you probably want to mark some packages as frozen. It's usually a good idea to do this with <em>aaa_elflibs</em>, kernel packages and others. # slackroll frozen aaa_elflibs foo bar = Day to Day Usage = Apart from the operations listed here, you can run the <em>help</em> operation to get the full list of supported operations, along with a brief description of each one. A more detailed description can be found in the [http://wiki.github.com/rg3/slackroll/operations-guide operations guide]. == New Round of Updates == What to do when there is a new round of updates? The Book of Best Practices suggests taking care of different events in a specific order: * Updates to glibc-solibs, sed and pkgtools need to be handled first, in that order. * If there are new packages, handle them second. * Then, it's time to upgrade outdated packages. * If packages have been deleted from the remote tree, handle them last. This is the correct order in 99% of the cases. SlackRoll will attempt to warn you and ask for confirmation if it detects you may be breaking this order. However, <strong>you</strong> have the last word on what to do, so proceed with caution and don't break your system. First, update the remote mirror information with the <em>update</em> operation we mentioned before. New changelog entries will be saved to your hard drive. It's recommended that you take a look at the changelog at this point, using the <em>changelog</em> operation. Then, get an overview of the events using the <em>list-transient</em> operation, which will list the new, outdated and unavailable packages along with a big fat warning message if activity in key system packages is detected. The best way to deal with glibc-solibs, sed and pkgtool updates is to use the <em>upgrade-key-packages</em> operation. # slackroll upgrade-key-packages You could also use the <em>install</em> operation. Despite its name, it can be used to both install and upgrade individual packages. Let's suppose packages <em>glibc-solibs</em> and <em>sed</em> where updated: # slackroll install glibc-solibs sed The <em>install</em> operation is one of the few operations allowing you to pass specific package versions. It will proceed in the order you indicate, so remember to give the packages in the correct order if you use this method. Second, you should handle new packages. You can clearly get a list of new packages with the <em>list-new</em> operation. New packages can be installed with the <em>install</em> operation as we just showed. When installing a remote package, SlackRoll will give you the opportunity of selecting the version to install if there are several available in the remote tree. Or, if you are not interested in installing a new package, mark it as not installed: # slackroll not-installed foo bar If the package names are not enough for you to decide if you want to install it or not, you can always use the <em>info</em> operation and SlackRoll will download and display the package info file (small <em>txt</em> files in the remote tree). And, of course, be carefull with new libraries as they may have been included to extend the functionality of an existing package you may have installed. The third step is taking care of outdated packages. For that, a few operations are available. <em>list-upgrades</em> lets you see a summary of the available upgrades. You can download and install them with <em>upgrade</em> or download them with <em>download-upgrades</em> or even print their URLs with <em>urls-upgrades</em>. And, finally, review the list of unavailable packages. Be careful with unavailable packages. Sometimes you install a foreign package but forget to mark it as such in SlackRoll. To avoid that problem, it's better to install them with the <em>install-foreign</em> operation. Individual unavailable packages can be removed with the <em>remove</em> operation as we showed before, and also all of them at the same time with the <em>remove-unavailable</em> operation. == Installing and Removing Individual Packages == There are a few operations related to installing and getting some information about individual packages. The most common ones are <em>install</em> to upgrade or install packages, <em>info</em> to maybe download and display package info files, <em>urls</em> to get a list of URLs and <em>remove</em> to remove individual packages. Operations that install packages let you manage <em>.new</em> files after the installation is completed, in a similar way to <em>slackpkg</em>. You can view the differences between the <em>.new</em> file and its counterparts with <em>vimdiff</em> (which provides a nice and colorized way of spotting the differences and maybe porting the old configuration to the new file), you can overwrite the old file with the <em>.new</em> file, delete the <em>.new</em> file directly, etc. Additionally, removal operations also track pairs of <em>.new</em> files and give you the opportunity of deleting configuration files that have been left behind. You are not forced to remove the files left behind, of course. Upgrade operations will perform both tasks. First, they will let you review the <em>.new</em> files and then they will give you the opportunity of deleting obsolete configuration files left behind. While using <em>vimdiff</em>, turning off syntax highlighting is recommended. <em>Vim</em> uses colors to highlight file differences and those can interfere with syntax highlighting colors, making text invisible or hard to read. Syntax highlighting can be turned off temporarily by using "<tt>:syntax off</tt>" in command mode, or you can disable it permanently putting "<tt>syntax off</tt>" in your <tt>~/.vimrc</tt> file (noting that usually you run SlackRoll as the superuser). == Managing Customized Versions of Official Packages == There are at least three ways of dealing with customized versions of official packages. These are custom versions or compilations of packages present in the remote official tree. They are normally used to add or remove features, or activate or apply patches that are disabled by default. For example, if you want to activate the <em>freetype</em> bytecode interpreter, you need to rebuild that package. The simplest way of dealing with these packages is to give them the same name and version as the official packages. When they are upgraded in the remote tree, however, SlackRoll will want to upgrade them. You can mark them as frozen before upgrading and only unfreeze them after you have rebuilt the new version, if you want to avoid SlackRoll replacing them with the new official version. Second, you can give them the same name and version as the official package, <strong>but</strong> keep them frozen all the time. How would you know then if they need to be rebuilt? With the <em>list-outdated-frozen</em> operation. Take into account the information given by <em>list-outdated-frozen</em> is not reflected by any other command. Specifically, it's not reflected as part of <em>list-transient</em> and friends. Third, you can give them a name or version different to the official package. Typically this means adding a custom build suffix and marking the package as frozen. How would you know if you need to rebuild it? Paying attention to the changelog specifically searching for upgrades in those packages and also using the <em>list-versions</em> operation, that lets you view the different known versions of a package, including local and remote ones. == Maintenance == SlackRoll barely requires maintenance. It keeps all downloaded packages in its package cache, located in the <em>/var/slackroll/packages</em> directory. When downloading files, it keeps them in a temporary directory until they're fully downloaded. If you want to remove every downloaded package, you can simply perform <code>slackroll erase-cache</code>. There is, however, a <em>clean-cache</em> operation which does <strong>not</strong> remove every downloaded package, but only those that are no longer present in the remote tree. Running that operation from time to time keeps your package cache sane and controlled. It may also be a good idea to delete the temporary directory contents from time to time, with <code>slackroll erase-tmp</code>, but it should be empty unless you interrupt SlackRoll while downloading stuff and never attempt to complete the download. == Other Operations == If you run the <em>help</em> operation you will see SlackRoll has many other operations, including operations to list packages by state, list local packages, list remote packages and list all known packages. It has operations to put packages in specific states and checking the state of packages. You can also download, install, display info or remove new or unavailable packages or packages with a matching path (like <em>/slackware/kde/</em>). Finally, there are search operations, to search for packages by name or path, search for files in your local system (like running <em>grep</em> on the contents of <em>/var/log/packages</em>), query the Slackware Package Browser, and finally a few very slow but sometimes useful operations to search for broken symlinks under a specific hierarchy and the same for orphan files (files not belonging to any package), as well as searching for missing files. As a general rule, every operation either does not accept arguments or allows a list of them. Operations accepting packages as arguments expect the package name only unless the help text mentions that they also accept specific package versions. Some operations need regular expressions. For the most part they have the same syntax as they have in <em>grep</em> or <em>Perl</em>, but you can read the [http://docs.python.org/lib/re-syntax.html Python regular expressions syntax reference] if you want to perform an unusually complex search. [[Category:Tutorials]] bb5d923e18915f5fde77baf9bd05011095b6308d User:Ariarat 2 216 346 2010-04-16T11:16:50Z Ariarat 99 Created page with 'http://www.slack-world.com "Iranian Slackers World" http://www.slack-world.com/forum "Iranian Slackers World Forums"' wikitext text/x-wiki http://www.slack-world.com "Iranian Slackers World" http://www.slack-world.com/forum "Iranian Slackers World Forums" 395d1c69f27b4eaccf840427b70b5e442f0782cb 347 346 2010-04-16T11:17:31Z Ariarat 99 wikitext text/x-wiki http://www.slack-world.com "Iranian Slackers World" http://www.slack-world.com/forum "Iranian Slackers World Forums" 15a25d288ccc959811cac58e8d5f4333e3a84dc1 348 347 2010-04-16T11:19:33Z Ariarat 99 wikitext text/x-wiki http://www.slack-world.com Iranian Slackers World http://www.slack-world.com/forum Iranian Slackers World Forums 9bf327ae94323f9ea693fc8c79b8f49bfe0da786 349 348 2010-04-16T11:19:55Z Ariarat 99 wikitext text/x-wiki http://www.slack-world.com http://www.slack-world.com/forum dd8b238c59b3a664f0bcf8b2d7eddf7069224bff 350 349 2010-04-16T11:20:22Z Ariarat 99 wikitext text/x-wiki http://www.slack-world.com <br /> http://www.slack-world.com/forum 036011173fc1cc2cbcf92a2288d640d7ccf44885 Building A Package 0 23 358 31 2010-05-18T19:38:37Z Sombriks 109 wikitext text/x-wiki [[Category:Tutorials]] = Intro = This is a rough outline for building Slackware packages. Some steps may not be neccessary, some steps might be missing. Use the discussion page for side-notes such as using slacktrack (when DESTDIR fails) and other utilities like checkinstall. == The good and decent way == Configure and compile the source as you usually do: ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc make Make a temporary destination directory available: mkdir /tmp/build Install into the temporary directory: make install DESTDIR=/tmp/build Now strip libs/bins within the temporary directory: strip -s /tmp/build/usr/lib/* /tmp/build/usr/bin/* You also want to make sure that anything in <tt>/usr/man</tt> is gzipped before you make the package: gzip -9 /tmp/build/usr/man/man?/*.? Create the <tt>install</tt> directory, this is where the description and install script will be stored: cd /tmp/build mkdir install cd install Using a text editor, create a file called <tt>slack-desc</tt> and fill it with the following contents: |-----handy-ruler------------------------------------------------------| app: Application Name (Short/Brief description) app: app: Enter a description of the package you are building. app: All 11 "app:" lines must be present app: "app" needs to be your application name. app: The handy-ruler is there to help you, these lines should not exceed app: 79 characters. app: app: app: app: Create the actual package: cd /tmp/build makepkg ../app-version-arch-tag.tgz ''(The dashes should appear as above, so if the version has a subversion like say "1.0 RC2" make sure you use 1.0_RC2 not 1.0-RC2. The arch should be something like "i486" for example. The tag should consist of the build number and your initals, e.g. 1zb for Zaphod Beeblebrox's first build, 2zb for his second build, etc. Official slackware packages have only numbers as tags.)'' When prompted to recreate symbolic links, say <tt>yes</tt><br> When prompted to reset permissions, say <tt>no</tt> ''Note: Using '''makepkg -l y -c n''' will give you the same behaviour as answering yes to the symlinks question, and no to the permissions question.'' If all went well, you can now install the package. cd .. installpkg app-version-arch-tag.tgz == The "i don't have time" way == Fortunately, Slackware are pretty flexible too. If you don't mind much about what is the source (beware!) that you're compiling you can burn some stages and do something like this: ./configure --prefix=/usr make install DESTDIR=$(pwd)/PACKAGE cd $(pwd)/PACKAGE makepkg -l y -c n ../app-version-arch-tag.tgz installpkg ../app-version-arch-tag.tgz Of course, you will have a package without description, (probably) uncompressed man pages and unstripped binaries. ---- For more information, also see the pages on [[SlackBuild_Scripts]] and [[Different_Approach_To_Buildscripts]]. ---- bd4f3c86dc6201263f09ac4219e14291bf53addd User:Sombriks 2 221 359 2010-05-18T21:43:45Z Sombriks 109 Created page with '= $ whoami = I'm a slack-user since 10.1 version. Oh i remember, i've started with serious linux with the last Slackware version shipping GNOME by the hands of Pat. = vmstat = …' wikitext text/x-wiki = $ whoami = I'm a slack-user since 10.1 version. Oh i remember, i've started with serious linux with the last Slackware version shipping GNOME by the hands of Pat. = vmstat = Actually i'm mostly a java developer, with some javascript and C over the week. I never tried other distros since then, since slackware have sun jdk/jre, firefox and gcc i'm well served. f7905e75c9b6e88ee12ef44746f79df0dca72c64 Emacs from CVS 0 88 360 110 2010-05-19T17:15:52Z Lambda-mon key 110 added note that Emacs no longer maintains CVS source tree -- Use Bazaar! wikitext text/x-wiki [[Category:Tutorials]] The development version of GNU Emacs offers several features over the official Slackware release (Emacs 22), for example Unicode support, multi-TTY, multiple X client frames and font rendering with Xft. [http://www.unc.edu/~adamsonj/software/emacs-cvs/ Here] is a SlackBuild that creates a package for Emacs 23. Note that the SlackBuild pulls from the CVS server on Savannah, so you do not need to pull the repository first. If you do, put it in the indicated local cvs directory so that the script will do a "cvs update". == Installation == You should <code> removepkg emacs </code> before installing the Emacs 23 package, which will be installed as package emacs-cvs. == Emacs Sources Bazaar == As of 2009-12-27: GNU Emacs has switched from CVS version control to Bazaar. In order to checkout the latest sources the original author's script: `emacs-cvs.SlackBuild' The cvs chekcouts in the above script, e.g. lines: <pre> cvs -d:pserver:anonymous@cvs.sv.gnu.org:/sources/emacs co emacs </pre> should be replaced with one line which initializes a branch: <pre> bzr branch http://bzr.savannah.gnu.org/r/emacs/trunk emacs </pre> and occurences of: <pre> cvs co </pre> should be replaced with: <pre> bzr update </pre> This assumes you are simply using the bazaar repo to only pull changesets and is in keeping with the original author's script. However, if you intend on making local changes to your branch of `Emacs trunk' it is recomended to first initialize a shared repository e.g. <pre> bzr init-repo --2a emacs/ cd emacs/ bzr branch http://bzr.savannah.gnu.org/r/emacs/trunk trunk </pre> and then branch a local tree `quickfixes' of your `local trunk' <pre> bzr branch trunk/ quickfixes/ </pre> This will help keep your local branch checkout of the `Emacs trunk' pristine and help to avoid breaking automated builds of Emacs from bzr while also allowing local edits within the `quickfixes' branch. Please see http://www.emacswiki.org/emacs/BzrForEmacsDevs for more. == Automatic Updates == I put the following script into /etc/cron.weekly and each Monday I get a newly-updated version of Emacs. I always keep the old package in case there is any problem with the new version. <pre> #! /bin/sh cd <full path to parent directory> tar zxvf emacs-cvs.tar.gz cd emacs-cvs ./emacs-cvs.SlackBuild |mail <yourself> </pre> == Problems? Comments? == I have had no problems with the current script. If you notice anything, please let me know.[[User:Trashbird1240|Trashbird1240]] 3d2534845e3180b0d13b0c3422a03660194a2cba SSL 0 144 361 172 2010-05-20T23:49:47Z Merge-delete 261 /* Client Revokation */ wikitext text/x-wiki [[Category:Tutorials]] = openSSL 0.9.8e = '''IMPORTANT: Since this version has a [http://www.mail-archive.com/openssl-users@openssl.org/msg48671.html bug in the blowfish encryption] it is recommended not to use blowfish since it is incompatible with all other openSSL versions!''' <br>Everything you read here was tested on Slackware 12<br> ; wikipedia says about openSSL: : ''OpenSSL is an open source implementation of the SSL and TLS protocols. The core library (written in the C programming language) implements the basic cryptographic functions and provides various utility functions. Wrappers allowing the use of the OpenSSL library in a variety of computer languages are available.'' There are many ways to use openSSL. This just covers certificates for use with httpd. You can also use easy-rsa that comes with the openVPN package and can be found in ''/usr/doc/openvpn-2.0.9/easy-rsa/''. For more information read the included ''README'' or look here: [http://openvpn.net/easyrsa.html A Guide to basic RSA Key Management]. Normally you will make a ''Certificate Signing Request (CSR)'' and send this one to a ''Certifying Authority (CA)'' to be signed. But since we don't wanna pay for this and only want to use it for our own special purpose, we don't need to do that and sign everything ourself. = openSSL + httpd = Switch to ''/etc/ssl'' <pre> cd /etc/ssl </pre> In this directory you should see the following listing. One some non-Slackware linuxes, or if OpenSSL was installed from source, the appropriate directory might be ''/etc/openssl''. <pre> root@pecan:/etc/ssl# ls -l total 24 drwxr-xr-x 2 root root 4096 2007-06-13 12:40 certs/ drwxr-xr-x 2 root root 4096 2007-06-13 12:40 misc/ -rw-r--r-- 1 root root 9374 2007-06-13 12:40 openssl.cnf drwxr-xr-x 2 root root 4096 2007-06-13 12:40 private/ root@pecan:/etc/ssl# </pre> We need to generate a private and public RSA key file. The public key is used to encrypt messages to you and is distributed with your certificate. == Creating a Self-Signed ''Certificate'' (CRT) == === openssl.cnf + openSSL DB === (You should still do this step even if you are buying a commercial certificate.) First things first, so we gotta edit this file, mainly the ''[ CA_default ]'' section. The <pre> [ CA_default ] dir = ./demoCA # Where everything is kept ... certificate = $dir/cacert.pem # The CA certificate ... crl = $dir/crl.pem # The current CRL private_key = $dir/private/cakey.pem# The private key ... </pre> to <pre> [ CA_default ] dir = /etc/ssl # Where everything is kept ... certificate = $dir/certs/ca.crt # The CA certificate ... crl = $dir/crl/ca.crl # The current CRL private_key = $dir/private/ca.key # The private key ... </pre> You can even change more options in this file but be aware what you are doing.<br> openSSL has a database for storing information such as ''Certificate Revocation Lists'' (CRL). Since these files don't exist on startup and we don't use the ''CA.sh'' or ''CA.pl'' scripts we got to create them ourself: <pre> mkdir newcerts certs crl private touch serial index.txt crlnumber crl/ca.crl echo 01 | tee serial | tee crlnumber </pre> Thanks to ''alienBOB''. Hail to tee king! :p === Becoming a ''Certification Authority'' (CA) === (Skip this step if you are buying a certificate from a commercial certificate authority such as GoDaddy.) Before you can create and sign your own certificates, you first have to establish yourself as a "Certificate Authority". To do so, we first create our key file (with a public and a private key) and use it to create our "master certificate" to use when signing other certificates. ; Generate the CA RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/ca.key 4096</pre> ; Create the CA CRT with the CA RSA Key : <pre>openssl req -new -x509 -days 3650 -key private/ca.key -out certs/ca.crt</pre> === Create Server CRT === A CRT contains your RSA public key, your name, the name of the CA, and is digitally signed by the CA. Browsers that know the CA can verify the signature on that CRT, thereby obtaining your RSA public key. That enables them to send messages which only you can decrypt. The next step is to create a Server RSA key, generate a ''Certificate Signing Request'' (CSR) out of it and sign it with our CA CRT to get a working SSL CRT for our server. A CSR is a digital file which contains your public key and your name. Normally you would send the CSR to a CA, who will convert it into a real certificate, by signing it. ; Generate the Server RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/server.key 1024</pre> ; Create the Server CSR using the Server RSA Key : '''When asked for the CommonName (CN) enter your domain!''' : <pre>openssl req -new -key private/server.key -out private/server.csr</pre> ; Sign the CSR with our CA CRT : <pre>openssl ca -in private/server.csr -out certs/server.crt</pre> You can now delete ''server.csr'' if you want, because it is no longer needed. (If you are using a commercially signed certificate from a place such as GoDaddy, do the first two commands above but not the last. Then do ''cat private/server.csr'' to get the text of the certificate request, which you will paste into GoDaddy's web interface to get the certificate. GoDaddy will then email the email address listed in the ''whois'' information for that domain (Make sure you haven't put in a fake address there to avoid spam!), and after the link in that email is clicked, GoDaddy will email another link to you from which you download a zip file. The zip file will contain two .crt files, and you should put both of them in /etc/ssl/certs. Other commerical certificate authorities follow a very similar procedure.) == Setup httpd == === Edit httpd.conf === The whole httpd config is located in ''/etc/httpd''. Fire up your preferred text editor and simply change this at Line 459: <pre> # Secure (SSL/TLS) connections #Include /etc/httpd/extra/httpd-ssl.conf </pre> to this <pre> # Secure (SSL/TLS) connections Include /etc/httpd/extra/httpd-ssl.conf </pre> to enable SSL support. You may also have to uncomment the line that starts ''LoadModule ssl_module''. === Edit extra/httpd-ssl.conf === Now we're going into the guts of the httpd SSL config. Search for ''SSLCertificateFile'' and ''SSLCertificateKeyFile'' change the path to our newly created CRT: <pre> ... SSLCertificateFile /etc/ssl/certs/server.crt ... SSLCertificateKeyFile /etc/ssl/private/server.key ... SSLCertificateChainFile /etc/ssl/certs/server.crt ... SSLCACertificatePath /etc/ssl/certs SSLCACertificateFile /etc/ssl/certs/ca.crt ... SSLCARevocationPath /etc/ssl/crl SSLCARevocationFile /etc/ssl/crl/ca.crl ... </pre> (If you have purchased a certificate from a commercial authority, the SSLCertificateFile will be one of the two files you receive from the CA (GoDaddy or VeriSign or whomever), and the SSLCACertificateFile will be the other. The files will be named such that you can tell which is which -- the SSLCertificateFile will probably be something like ''www.yourdomainname.com.crt'' and the SSLCACertificateFile will be something like ''nameofca-bundle.crt''.) == Pass-phrase on httpd startup == The reason this dialog pops up at startup and every re-start is that the RSA private key inside your ''server.key'' file is stored in encrypted format for security reasons. The pass-phrase is needed decrypt this file, so it can be read and parsed. Removing the pass-phrase removes a layer of security from your server - proceed with caution! <ol> <li> Remove the encryption from the RSA private key (while keeping a backup copy of the original file): <pre> cd /etc/ssl mv private/server.key private/server.key.org cd private openssl rsa -in server.key.org -out server.key </pre> </li> <li> Make sure the server.key file is only readable by root since it is decrypted: <pre> cd /etc/ssl chmod 0400 private/server.key </pre> </li></ol> Now server.key contains an unencrypted copy of the key. If you point your server at this file, it will not prompt you for a pass-phrase. HOWEVER, if anyone gets this key they will be able to impersonate you on the net. PLEASE make sure that the permissions on this file are such that only root or the web server user can read it (preferably get your web server to start as root but run as another user, and have the key readable only by root). As an alternative approach you can use the ''SSLPassPhraseDialog exec:/path/to/program'' facility. Bear in mind that this is neither more nor less secure, of course. == Verifying and debugging == If you simply want to see every information on a CRT: <pre>openssl x509 -noout -text -in XXX.crt</pre> === Verifying === ; Verify that a private key matches its Certificate : Generate a MD5 out of the public key/CRT and compare : <pre>openssl x509 -noout -modulus -in private/XXX.crt | openssl md5 && openssl rsa -noout -modulus -in private/XXX.key | openssl md5</pre> === Debugging === ; s_server - Debugging clients : <pre>openssl s_server -accept 443 -www</pre> ; s_client - Debugging servers : <pre>openssl s_client -connect localhost:443</pre> or <pre>openssl s_client -connect localhost:443 -state -debug</pre> == Security == All the files expect the CRTs are only for your eyes, so we change the permissons: <pre>chmod 0400 private/*.key</pre> === Client Revokation === This is only needed if your server certificate is compromised (eg. someone hacked your server and stole your server.key). <pre> openssl ca -gencrl -keyfile private/ca.key -cert certs/ca.crt -out crl/ca.crl </pre> That generated us the needed files which we use when we want to revoke a CRT. <br><br> Now that we got a compromised CRT, we got to get rid of it: <pre>openssl ca -revoke certs/server.crt -keyfile private/ca.key -cert certs/ca.crt</pre> == Other == === Change the pass-phrase === <pre> openssl rsa -des3 -in server.key -out server.key.new mv server.key.new server.key </pre> The first time you're asked for a PEM pass-phrase, you should enter the old pass-phrase. After that, you'll be asked again to enter a pass-phrase - this time, use the new pass-phrase. If you are asked to verify the pass-phrase, you'll need to enter the new pass-phrase a second time. === CRT for Clients === Ok.. i won't write anything on this, and simply just C/P: <pre> openssl genrsa -des3 -out private/client1_priv.key 2048 openssl genrsa -des3 -out private/client2_priv.key 2048 # and so on... depends on how much clients you wanna serv... openssl req -new -key private/client1_priv.key -out private/client1.csr openssl req -new -key private/client2_priv.key -out private/client2.csr # and so on... openssl ca -in private/client1.csr -out private/client1.crt openssl ca -in private/client2.csr -out private/client2.crt cp private/client1.crt private/client1_preconv.crt cat private/client1.key >> private/client1_preconv.crt openssl pkcs12 -export -in private/client1_preconv.crt -out private/client1_postconv.p12 </pre> Install in the clients browser... and change httpd.conf: <pre> SSLCACertificateFile PATH/TO/server.crt SSLVerifyClient require SSLVerifyDepth 1 </pre> === Convert CRT from PEM to DER format === Normally all CRTs are stored in the PEM format. <pre>openssl x509 -in ca.crt -out ca.crt.der -outform DER</pre> == Testing the CRT == If you have live web sites, you might wish to test your configuration before restarting apache, to avoid having that panicy few minutes of downtime while you scramble to see what you can do faster, fix the problem or copy back your backup configs. Test like this: <pre>httpd -t</pre> Look at the error messages it prints out, or the error_log as explained below, if it doesn't work. Restart your httpd: <pre>/etc/rc.d/rc.httpd restart</pre> Take a look at the httpd ''error_log'' and scroll to the end of the file: <pre>jed /var/log/httpd/error_log</pre> If your getting an error like this: <pre>[error] Init: Unable to read pass phrase [Hint: key introduced or changed before restart?]</pre> ... then you should take a look at ''Pass-phrase on httpd startup'' ... = openSSL + openVPN = $foo ... maybe next month... = External Links = * [http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html SSL/TLS Strong Encryption: FAQ @ httpd.apache.org] * [http://www.tc.umn.edu/~brams006/selfsign.html Creating a self-signed SSL certificate] * [http://www.madboa.com/geek/openssl/ OpenSSL Command-Line HOWTO] * [http://www.5dollarwhitebox.org/wiki/index.php/Howtos_Self_Signed_SSL_Certificates OpenSSL Quick Reference] * [http://www.opensourcehowto.org/how-to/apache/setup-apache2-with-openssl.html Setup Apache2 with OpenSSL] * [http://www.marschke.info/admin/ap_opssl_https.html Apache2, OpenSSL und HTTPS: Server- und Client-Authentifizierung mit Zertifikaten über verschlüsselte Internet-Verbindungen] * [http://www.online-tutorials.net/security/openssl-tutorial/tutorials-t-69-207.html openSSL / openVPN.. comming soon] 4148e01f43b3db7ffa2bad9af9a4ba3ba3e651e3 Utf-8 linux console 0 177 365 308 2010-06-02T13:04:39Z Merge-delete 261 Added setting LANG in /etc/profile.d/lang.sh wikitext text/x-wiki [[Category:Tutorials]] ''by Dive'' == A Quick Look at Using UTF-8 in the Linux Console (without X) == A few people have asked about this in #slackware lately so I though I'd put down a few notes on how I got utf-8 up and running. Feel free to add any further info. In these days of high powered X desktop environments with all their flashy composite bells and whistles it may seem strange to worry about how the plain Linux console behaves, but we need to remember that there are some very nice applications that live in the console and can be just as (or even more) productive than the X Windows counterparts. I'm thinking of screen, irssi, mutt, elinks, vim/vi, mplayer (using svga), links, zgv and slrn to name but a few. And of course we have to mention Slackware tools like pgktool, slackpkg and sbopkg. Once you get hooked on using the console it is hard to go back. Anyway here we go ... == The Console == The first thing to do is configure the console. There is a kernel parameter we can add to /etc/lilo.conf to do this: append="vt.default_utf8=1" Here's an example from mine: # Linux bootable partition config begins image = /boot/vmlinuz-2.6.27.7-custom root = /dev/hda1 label = Linux-custom append="resume=/dev/hda2 vt.default_utf8=1" read-only # Linux bootable partition config ends Once you have saved lilo.conf and run '''lilo''' a quick reboot is needed. == LANG environment variable == I find that typing multibyte characters like "ä" and erasing them with backspace, I can erase much more than what I wrote. It helps to set the LANG variable, preferably by editing /etc/profile.d/lang.sh (or lang.csh) to set it to en_US.UTF-8 or similar. == Fonts == After that we need to find a font that actually contains the characters you want to see. My 'font of the moment' is lat9w-16. This contains the British £ (pound) and € (euro) symbols that I need, plus a lot of useful accented characters. But what is just as important are the correct drawing characters so that curses programs like pkgtool and sbopkg are printed on the screen correctly. If you experiment with the '''setconsolefont''' command you will find that some fonts draw curses box borders as squares or question marks, so check out some fonts and see which ones work and which don't. The '''setconsolefont''' command will put your chosen font into /etc/rc.d/rc.font so it will load at bootup. == Keyboard == Ok, great you can now read characters correctly, but you need the correct keymap to be able to type them. That's a little harder. If you can find a utf-8 keymap for your locale/hardware then that's fine. Personally I didn't find any of the installed keymaps suitable so I looked around for an alternative. I found a uk-utf8 keymap on the intertubes, but this was unfortunately missing all the Ctrl+[a-z] keys so I edited it and added my own. I also added some AltGr+[a-z] (well not all of those) for accented characters. You may find this keymap useful as a starting point to create your own if you cannot find a more suitable one. Have a look through the comments and the codes and you should pick up the method. To add your own combinations you will need to know the correct codes for the characters you need. You can find a table of utf-8 characters here: [http://home.tiscali.nl/t876506/utf8tbl.html]http://home.tiscali.nl/t876506/utf8tbl.html Look up the code in that table and convert it to hex. E.G. è is 232 in decimal, E8 in hex; é is code 233 in decimal, E9 in hex, so the entry in your keymap should be: # key = normal shifted AltGr+e AltGr+shift+e keycode 18 = e E U+00E8 U+00E9 # prints: e E è é You can find the keycodes with the '''showkey''' program. Once edited you can load the map with the '''loadkeys''' program. Loadkeys will update /etc/rc.d/rc.keymap but you will need to copy the keymap to /usr/share/kbd/keymaps/i386/qwerty/ so it is found on bootup. Here is a link to my updated uk-utf8 map: [http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz]http://www.unrealize.co.uk/scripts/misc/uk-utf.map.gz You can load this ungzipped but it's better to gzip it back after editing to keep things consistent. == Conclusion == By now you should have a fully usable keyboard/console correctly printing unicode characters. You will probably need to tell some programs like mutt and irrsi that you are using a utf-8 system. Note: There exists two shell scripts - '''unicode_start''' and '''unicode_stop'''. Typing '''unicode_start [font]''' will load the required font and set up keyboard correctly for unicode input. Bye for now, [[User:Dive|Dive]] 02:33, 20 March 2009 (UTC) 1f9df45fc81837762eb202abc9e8c1d44ebd88fc Hibernate 0 223 366 2010-06-02T13:32:35Z Merge-delete 261 Crude and minimal (but to the point) hibernation help wikitext text/x-wiki In Slackware, hibernation works out-of-the-box and can be easily done from KDE's menu. Resuming from hibernation, however, is not set up, so when you turn on your computer again, it starts as normal. That is, if your hardware supports it and if you've set up a swap space larger than your RAM. To tell your kernel where to resume from, you need to write the info to ''lilo.conf'': append=" resume=/dev/sda6" Replace ''/dev/sda6'' with your actual swap space. Swap partitions are perfect, I think swap files should work too. If you don't know where your swap lies, look at ''/proc/swaps''. ---- The above is everything I needed to do with my Slackware64 13.1 on a new laptop. I hope that works for you as well, but there are many requirements and intricacies not mentioned above. Google might help you. Please edit this document accordingly if you find out more. [[Category:Tutorials]] f671f80bff839a048076759b5d0a677fcdac222f 368 366 2010-06-02T13:42:09Z Merge-delete 261 fix + link wikitext text/x-wiki In Slackware, hibernation works out-of-the-box and can be easily done from KDE's menu. Resuming from hibernation, however, is not set up, so when you turn on your computer again, it starts as normal. That is, if your hardware supports it and if you've set up a swap space larger than your RAM. To tell your kernel where to resume from, you need to write the info to ''lilo.conf'': append=" resume=/dev/sda6" Replace ''/dev/sda6'' with your actual swap space. Swap partitions are perfect, I think swap files should work too. If you don't know where your swap lies, look at ''/proc/swaps''. Afterwards, run lilo. ---- The above is everything I needed to do with my Slackware64 13.1 on a new laptop. I hope that works for you as well, but there are many requirements and intricacies not mentioned above. Google might help you. Please edit this document accordingly if you find out more. Some more info at [http://www.linuxquestions.org/linux/answers/Hardware/Mini_HOW_TO_Hibernate_and_resume_0] [[Category:Tutorials]] d82d505f883f3fdce6be110953b80c0ee752af80 Dell Vostro 1310 0 225 369 2010-06-16T19:56:26Z Diegobza 116 Created page with '[[Category:Hardware]] ==Slackware on a Dell Vostro 1310 Laptop== ==Hardware== $ lspci <pre> 00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub…' wikitext text/x-wiki [[Category:Hardware]] ==Slackware on a Dell Vostro 1310 Laptop== ==Hardware== $ lspci <pre> 00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c) 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 03) 00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03) 00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03) 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03) 00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03) 00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03) 00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03) 00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03) 00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03) 00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03) 00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03) 00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3) 00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller (rev 03) 00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03) 00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03) 00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03) 06:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61) 07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02) 08:05.0 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02) 08:05.2 SD Host controller: O2 Micro, Inc. Integrated MMC/SD Controller (rev 02) 08:05.3 Mass storage controller: O2 Micro, Inc. Integrated MS/xD Controller (rev 01) </pre> Changes comming... 4c718dd7949063eb82cf737ec9384d8c6f0021ee 372 369 2010-06-16T20:28:39Z Diegobza 116 wikitext text/x-wiki [[Category:Hardware]] =Slackware on a Dell Vostro 1310 Laptop= =Hardware= $ lspci <pre> 00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c) 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 03) 00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03) 00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03) 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03) 00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03) 00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03) 00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03) 00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03) 00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03) 00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03) 00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03) 00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3) 00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller (rev 03) 00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03) 00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03) 00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03) 06:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61) 07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02) 08:05.0 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02) 08:05.2 SD Host controller: O2 Micro, Inc. Integrated MMC/SD Controller (rev 02) 08:05.3 Mass storage controller: O2 Micro, Inc. Integrated MS/xD Controller (rev 01) </pre> =Known Problems= ==Keyboard/Touchpad== When you boot a fresh version of Slackware installed on a Dell Vostro 1310 laptop you may find yourself without control of you keyboard and touchpad, like they were turned off at boottime. As many forums and mailing list have discussed, this is a kernel-related issue, however, you don't need to recompile and/or update the default kernel shipped with your Slackware CD/DVD box. The fix is real simple, all you have to do is to modify the kernel's append line in the your /etc/lilo.conf in order to add the "i8042.reset" text. Remember you must be logged as the super user to be able to edit lilo's configuration. At the end your append line should be like this (considering you didn't added commands to this line previously): <pre> append="i8042.reset vt.default_utf8=0" </pre> This is it. Problem fixed. Just remember to run lilo command to update your changes. <pre> # lilo </pre> Note that this change can be done at installation to save you time and avoid stress. Just type "i8042.reset" when the setup script prompts you about any desirable lilo append command. 867da4917c72b321c710da42ee3a72d236cd0326 SlackWiki:Community Portal 4 226 370 2010-06-16T20:00:45Z Merge-delete 261 Created page with '===BRASIL=== ====[http://www.slackwarebrasil.org GUS-BR]==== Brazilian Slackware User Group (Grupo de Usuários Slackware Brasil)<BR> [http://www.slackwarebrasil.org www.slackwar…' wikitext text/x-wiki ===BRASIL=== ====[http://www.slackwarebrasil.org GUS-BR]==== Brazilian Slackware User Group (Grupo de Usuários Slackware Brasil)<BR> [http://www.slackwarebrasil.org www.slackwarebrasil.org ] ===ITALY=== ====[http://slacky.eu/ Slacky.eu]==== The Italian Slackware Community<BR> [http://slacky.eu/ http://slacky.eu] d596ad880badd5d709d035b722a6829752d18de1 371 370 2010-06-16T20:10:07Z Merge-delete 261 wikitext text/x-wiki ====[http://www.slackwarebrasil.org GUS-BR]==== Brazilian Slackware User Group (Grupo de Usuários Slackware Brasil)<BR> [http://www.slackwarebrasil.org www.slackwarebrasil.org ] <BR> ====[http://slacky.eu/ Slacky.eu]==== The Italian Slackware Community<BR> [http://slacky.eu/ http://slacky.eu] <BR> ====[http://slackware.linux.or.id Indonesian Slackware Community]==== [http://slackware.linux.or.id http://slackware.linux.or.id] a6674939325940d23ba2bf781ba382a241c15834 Converting From CRLF To LF 0 75 373 96 2010-06-16T23:17:37Z Sombriks 109 wikitext text/x-wiki =Explanation= There are several ways of converting the CRLF combination to LF and vice-versa. The simplest one under Slackware is to use the tools <code>fromdos</code> and <code>todos</code>, which receive the file from the standard input and write the result to the standard output. They are part of the <code>bin</code> package. =Examples= $ fromdos <input_file >output_file # Converts CRLF to LF $ todos <input_file >output_file # Converts LF to CRLF Also you could play with tr (from CRLF to LF): $ tr -d '\r' < input_file > output_file [[Category:Tips]] 0e1600502b582c7e0b630bbbdb4c7862e924c3d4 Dell Vostro 1310 0 225 374 372 2010-06-17T14:56:19Z Diegobza 116 wikitext text/x-wiki [[Category:Hardware]] =Slackware on a Dell Vostro 1310 Laptop= =Hardware= {| align="center" style="border: 0px; width: 600px" |+ Slackware Hardware Compatibility | ! colspan="5" style="background:#ffdead;" | Slackware Versions |- | | style="text-align: center" | 12 | style="text-align: center" | 12.1 | style="text-align: center" | 12.2 | style="text-align: center" | 13 | style="text-align: center" | 13.1 |- |Wireless | style="text-align: center; background-color: gray" | Not Tested | style="text-align: center" | Not Tested | style="text-align: center" | Not Tested | style="text-align: center" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working |- |Bluetooth || Not Tested || Not Tested || Not Tested || Not Tested || Working |} ==Hardware Specification== Output of lspci: <pre> 00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c) 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 03) 00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03) 00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03) 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03) 00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03) 00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03) 00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03) 00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03) 00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03) 00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03) 00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03) 00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3) 00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller (rev 03) 00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03) 00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03) 00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03) 06:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61) 07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02) 08:05.0 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02) 08:05.2 SD Host controller: O2 Micro, Inc. Integrated MMC/SD Controller (rev 02) 08:05.3 Mass storage controller: O2 Micro, Inc. Integrated MS/xD Controller (rev 01) </pre> =Known Problems= ==Keyboard/Touchpad== When you boot a fresh version of Slackware installed on a Dell Vostro 1310 laptop you may find yourself without control of you keyboard and touchpad, like they were turned off at boottime. As many forums and mailing list have discussed, this is a kernel-related issue, however, you don't need to recompile and/or update the default kernel shipped with your Slackware CD/DVD box. The fix is real simple, all you have to do is to modify the kernel's append line in the your /etc/lilo.conf in order to add the "i8042.reset" text. Remember you must be logged as the super user to be able to edit lilo's configuration. At the end your append line should be like this (considering you didn't added commands to this line previously): <pre> append="i8042.reset vt.default_utf8=0" </pre> This is it. Problem fixed. Just remember to run lilo command to update your changes. <pre> # lilo </pre> Note that this change can be done at installation to save you time and avoid stress. Just type "i8042.reset" when the setup script prompts you about any desirable lilo append command. ==LCD Brightness Control== Affected versions: * Slackware 13: working. ** Console and GUI apps work flawlessly. * Slackware 13.1: partially working. ** Console apps work as intended. ** GUI app (Xfce4 Power Manager) not working. 63b7de9cf4d476d5f90f6503fe2f3d7c7d98ca25 375 374 2010-06-17T15:18:35Z Diegobza 116 wikitext text/x-wiki [[Category:Hardware]] =Slackware on a Dell Vostro 1310 Laptop= =Hardware= {| align="center" style="border: 0px; width: 600px" |+ Slackware Hardware Compatibility | ! colspan="5" style="background:#ffdead;" | Slackware Versions |- | | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12.1 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12.2 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 13 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 13.1 |- | style="font-weight: bold; background-color: #9C9CFF" | Ethernet | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | LCD Control | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | Wireless | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Bluetooth | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working |} ==Hardware Specification== Output of lspci: <pre> 00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c) 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 03) 00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03) 00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03) 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03) 00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03) 00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03) 00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03) 00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03) 00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03) 00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03) 00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03) 00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3) 00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller (rev 03) 00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03) 00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03) 00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03) 06:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61) 07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02) 08:05.0 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02) 08:05.2 SD Host controller: O2 Micro, Inc. Integrated MMC/SD Controller (rev 02) 08:05.3 Mass storage controller: O2 Micro, Inc. Integrated MS/xD Controller (rev 01) </pre> =Known Problems= ==Keyboard/Touchpad== When you boot a fresh version of Slackware installed on a Dell Vostro 1310 laptop you may find yourself without control of you keyboard and touchpad, like they were turned off at boottime. As many forums and mailing list have discussed, this is a kernel-related issue, however, you don't need to recompile and/or update the default kernel shipped with your Slackware CD/DVD box. The fix is real simple, all you have to do is to modify the kernel's append line in the your /etc/lilo.conf in order to add the "i8042.reset" text. Remember you must be logged as the super user to be able to edit lilo's configuration. At the end your append line should be like this (considering you didn't added commands to this line previously): <pre> append="i8042.reset vt.default_utf8=0" </pre> This is it. Problem fixed. Just remember to run lilo command to update your changes. <pre> # lilo </pre> Note that this change can be done at installation to save you time and avoid stress. Just type "i8042.reset" when the setup script prompts you about any desirable lilo append command. ==LCD Brightness Control== Affected versions: * Slackware 13: working. ** Console and GUI apps work flawlessly. * Slackware 13.1: partially working. ** Console apps work as intended. ** GUI app (Xfce4 Power Manager) not working. 3b1327b0b2f9bc15b20e7c82e279ddd9757d7930 376 375 2010-06-17T16:38:14Z Diegobza 116 wikitext text/x-wiki [[Category:Hardware]] =Slackware on a Dell Vostro 1310 Laptop= =Hardware= {| align="center" style="border: 0px; width: 600px" |+ Slackware Hardware Compatibility | ! colspan="5" style="background:#ffdead;" | Slackware Versions |- | | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12.1 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12.2 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 13 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 13.1 |- | style="font-weight: bold; background-color: #9C9CFF" | Bluetooth | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Camera | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Ethernet | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Hibernate | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested |- | style="font-weight: bold; background-color: #9C9CFF" | Keyboard | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | LCD Control | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | Sound | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Suspend | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | Touchpad | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | Wireless | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |} ==Hardware Specification== Output of lspci: <pre> 00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c) 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 03) 00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03) 00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03) 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03) 00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03) 00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03) 00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03) 00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03) 00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03) 00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03) 00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03) 00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3) 00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller (rev 03) 00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03) 00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03) 00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03) 06:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61) 07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02) 08:05.0 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02) 08:05.2 SD Host controller: O2 Micro, Inc. Integrated MMC/SD Controller (rev 02) 08:05.3 Mass storage controller: O2 Micro, Inc. Integrated MS/xD Controller (rev 01) </pre> =Known Problems= ==Keyboard/Touchpad== When you boot a fresh version of Slackware installed on a Dell Vostro 1310 laptop you may find yourself without control of you keyboard and touchpad, like they were turned off at boottime. As many forums and mailing list have discussed, this is a kernel-related issue, however, you don't need to recompile and/or update the default kernel shipped with your Slackware CD/DVD box. The fix is real simple, all you have to do is to modify the kernel's append line in the your /etc/lilo.conf in order to add the "i8042.reset" text. Remember you must be logged as the super user to be able to edit lilo's configuration. At the end your append line should be like this (considering you didn't added commands to this line previously): <pre> append="i8042.reset vt.default_utf8=0" </pre> This is it. Problem fixed. Just remember to run lilo command to update your changes. <pre> # lilo </pre> Note that this change can be done at installation to save you time and avoid stress. Just type "i8042.reset" when the setup script prompts you about any desirable lilo append command. ==LCD Brightness Control== Affected versions: * Slackware 13: working. ** Console and GUI apps work flawlessly. * Slackware 13.1: partially working. ** Console apps work as intended. ** GUI app (Xfce4 Power Manager) not working. ==Suspend to RAM== As shown on the Slackware Hardware Compatibility table, the Suspend to RAM feature used to work without problems on Slackware 13. But version 13.1 introduced a new flaw where you no longer can suspend the machine using GUI tools. To be more specific, this is a problem related to pm-utils. An workaround to fix it is to create a script at /etc/pm/sleep.d with this content: <pre> #!/bin/bash function unbind_usb { for driver in ehci ohci uhci; do cd "/sys/bus/pci/drivers/${driver}_hcd"; ids=$(ls | grep :); echo $ids > /tmp/DISABLED_$driver; for id in $ids; do echo "Unbinding $id"; echo -n "$id" > unbind; disabled="$disabled $id"; done; done; } function bind_usb { for driver in ehci ohci uhci; do cd "/sys/bus/pci/drivers/${driver}_hcd"; for id in $(cat /tmp/DISABLED_$driver); do echo "Binding $id"; echo -n "$id" > bind; done; rm /tmp/DISABLED_$driver; done; } case "$1" in hibernate|suspend) unbind_usb; ;; thaw|resume) bind_usb; # Uncomment the following two lines if USB devices stutter after resume # unbind_usb; # bind_usb; ;; *) exit 1; ;; esac; exit 0; </pre> Now you're able to suspend your laptop using GUI tools. Note that you don't need this script to suspend with command line like this: <pre> # echo mem > /sys/power/state </pre> =See also= 45871bcf269970c74ed2bbf00ac6717796e7ec68 377 376 2010-06-17T19:03:47Z Diegobza 116 /* Hardware */ wikitext text/x-wiki [[Category:Hardware]] =Slackware on a Dell Vostro 1310 Laptop= =Hardware= Here is a Hardware Compatibility table for different versions of Slackware. {| align="center" style="border: 0px; width: 600px" |+ Slackware Hardware Compatibility | ! colspan="5" style="background:#ffdead;" | Slackware Versions |- | | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12.1 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12.2 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 13 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 13.1 |- | style="font-weight: bold; background-color: #9C9CFF" | Bluetooth | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Camera | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Ethernet | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Hibernate | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested |- | style="font-weight: bold; background-color: #9C9CFF" | Keyboard | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | LCD Control | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | Multimedia Keys | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #FF6F79" | Not Working | style="text-align: center; background-color: #FF6F79" | Not Working | style="text-align: center; background-color: #FF6F79" | Not Working |- | style="font-weight: bold; background-color: #9C9CFF" | Sound | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Suspend | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | Touchpad | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | Wireless | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |} Legend: {| | style="text-align: center; background-color: #5EFF54" |a |- | style="text-align: center; background-color: #5EFF54" |b |} ==Hardware Specification== Output of lspci: <pre> 00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c) 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 03) 00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03) 00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03) 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03) 00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03) 00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03) 00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03) 00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03) 00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03) 00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03) 00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03) 00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3) 00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller (rev 03) 00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03) 00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03) 00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03) 06:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61) 07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02) 08:05.0 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02) 08:05.2 SD Host controller: O2 Micro, Inc. Integrated MMC/SD Controller (rev 02) 08:05.3 Mass storage controller: O2 Micro, Inc. Integrated MS/xD Controller (rev 01) </pre> =Known Problems= ==Keyboard/Touchpad== When you boot a fresh version of Slackware installed on a Dell Vostro 1310 laptop you may find yourself without control of you keyboard and touchpad, like they were turned off at boottime. As many forums and mailing list have discussed, this is a kernel-related issue, however, you don't need to recompile and/or update the default kernel shipped with your Slackware CD/DVD box. The fix is real simple, all you have to do is to modify the kernel's append line in the your /etc/lilo.conf in order to add the "i8042.reset" text. Remember you must be logged as the super user to be able to edit lilo's configuration. At the end your append line should be like this (considering you didn't added commands to this line previously): <pre> append="i8042.reset vt.default_utf8=0" </pre> This is it. Problem fixed. Just remember to run lilo command to update your changes. <pre> # lilo </pre> Note that this change can be done at installation to save you time and avoid stress. Just type "i8042.reset" when the setup script prompts you about any desirable lilo append command. ==LCD Brightness Control== Affected versions: * Slackware 13: working. ** Console and GUI apps work flawlessly. * Slackware 13.1: partially working. ** Console apps work as intended. ** GUI app (Xfce4 Power Manager) not working. ==Suspend to RAM== As shown on the Slackware Hardware Compatibility table, the Suspend to RAM feature used to work without problems on Slackware 13. But version 13.1 introduced a new flaw where you no longer can suspend the machine using GUI tools. To be more specific, this is a problem related to pm-utils. An workaround to fix it is to create a script at /etc/pm/sleep.d with this content: <pre> #!/bin/bash function unbind_usb { for driver in ehci ohci uhci; do cd "/sys/bus/pci/drivers/${driver}_hcd"; ids=$(ls | grep :); echo $ids > /tmp/DISABLED_$driver; for id in $ids; do echo "Unbinding $id"; echo -n "$id" > unbind; disabled="$disabled $id"; done; done; } function bind_usb { for driver in ehci ohci uhci; do cd "/sys/bus/pci/drivers/${driver}_hcd"; for id in $(cat /tmp/DISABLED_$driver); do echo "Binding $id"; echo -n "$id" > bind; done; rm /tmp/DISABLED_$driver; done; } case "$1" in hibernate|suspend) unbind_usb; ;; thaw|resume) bind_usb; # Uncomment the following two lines if USB devices stutter after resume # unbind_usb; # bind_usb; ;; *) exit 1; ;; esac; exit 0; </pre> Now you're able to suspend your laptop using GUI tools. Note that you don't need this script to suspend with command line like this: <pre> # echo mem > /sys/power/state </pre> =See also= f32520c3a960067b746fe6f6ccfe46a8db4c0151 378 377 2010-06-24T17:06:22Z Diegobza 116 wikitext text/x-wiki [[Category:Hardware]] =Slackware on a Dell Vostro 1310 Laptop= =Hardware= Here is a Hardware Compatibility table for different versions of Slackware. {| align="center" style="border: 0px; width: 600px" |+ Slackware Hardware Compatibility | ! colspan="5" style="background:#ffdead;" | Slackware Versions |- | | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12.1 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12.2 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 13 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 13.1 |- | style="font-weight: bold; background-color: #9C9CFF" | Bluetooth | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Camera | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Ethernet | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Hibernate | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested |- | style="font-weight: bold; background-color: #9C9CFF" | Keyboard | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | LCD Control | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | Multimedia Keys | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #FF6F79" | Not Working | style="text-align: center; background-color: #FF6F79" | Not Working | style="text-align: center; background-color: #FF6F79" | Not Working |- | style="font-weight: bold; background-color: #9C9CFF" | Sound | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Suspend | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | Touchpad | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | Wireless | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |} Legend: {| | style="text-align: center; background-color: #5EFF54" |a |- | style="text-align: center; background-color: #5EFF54" |b |} ==Hardware Specification== Output of lspci: <pre> 00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c) 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 03) 00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03) 00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03) 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03) 00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03) 00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03) 00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03) 00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03) 00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03) 00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03) 00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03) 00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3) 00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller (rev 03) 00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03) 00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03) 00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03) 06:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61) 07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02) 08:05.0 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02) 08:05.2 SD Host controller: O2 Micro, Inc. Integrated MMC/SD Controller (rev 02) 08:05.3 Mass storage controller: O2 Micro, Inc. Integrated MS/xD Controller (rev 01) </pre> ==Hardware Configuration== ===Multimedia Keys=== One of the ways to configure the multimedia keys is installing an external software called xbindkeys. This software looks for it's configuration file <pre> "amixer set Master 5%+" XF86AudioRaiseVolume "amixer set Master 10%-" XF86AudioLowerVolume "xmms -t" XF86AudioPlay "xmms -s" XF86AudioStop "xmms -r" XF86AudioPrev "xmms -f" </pre> =Known Problems= ==Keyboard/Touchpad== When you boot a fresh version of Slackware installed on a Dell Vostro 1310 laptop you may find yourself without control of you keyboard and touchpad, like they were turned off at boottime. As many forums and mailing list have discussed, this is a kernel-related issue, however, you don't need to recompile and/or update the default kernel shipped with your Slackware CD/DVD box. The fix is real simple, all you have to do is to modify the kernel's append line in the your /etc/lilo.conf in order to add the "i8042.reset" text. Remember you must be logged as the super user to be able to edit lilo's configuration. At the end your append line should be like this (considering you didn't added commands to this line previously): <pre> append="i8042.reset vt.default_utf8=0" </pre> This is it. Problem fixed. Just remember to run lilo command to update your changes. <pre> # lilo </pre> Note that this change can be done at installation to save you time and avoid stress. Just type "i8042.reset" when the setup script prompts you about any desirable lilo append command. ==LCD Brightness Control== Affected versions: * Slackware 13: working. ** Console and GUI apps work flawlessly. * Slackware 13.1: partially working. ** Console apps work as intended. ** GUI app (Xfce4 Power Manager) not working. ==Suspend to RAM== As shown on the Slackware Hardware Compatibility table, the Suspend to RAM feature used to work without problems on Slackware 13. But version 13.1 introduced a new flaw where you no longer can suspend the machine using GUI tools. To be more specific, this is a problem related to pm-utils. An workaround to fix it is to create a script at /etc/pm/sleep.d with this content: <pre> #!/bin/bash function unbind_usb { for driver in ehci ohci uhci; do cd "/sys/bus/pci/drivers/${driver}_hcd"; ids=$(ls | grep :); echo $ids > /tmp/DISABLED_$driver; for id in $ids; do echo "Unbinding $id"; echo -n "$id" > unbind; disabled="$disabled $id"; done; done; } function bind_usb { for driver in ehci ohci uhci; do cd "/sys/bus/pci/drivers/${driver}_hcd"; for id in $(cat /tmp/DISABLED_$driver); do echo "Binding $id"; echo -n "$id" > bind; done; rm /tmp/DISABLED_$driver; done; } case "$1" in hibernate|suspend) unbind_usb; ;; thaw|resume) bind_usb; # Uncomment the following two lines if USB devices stutter after resume # unbind_usb; # bind_usb; ;; *) exit 1; ;; esac; exit 0; </pre> Now you're able to suspend your laptop using GUI tools. Note that you don't need this script to suspend with command line like this: <pre> # echo mem > /sys/power/state </pre> =See also= 8eecc42290e50e738e716c54883e31f77bde71ca 379 378 2010-06-26T15:24:45Z Diegobza 116 /* Multimedia Keys */ wikitext text/x-wiki [[Category:Hardware]] =Slackware on a Dell Vostro 1310 Laptop= =Hardware= Here is a Hardware Compatibility table for different versions of Slackware. {| align="center" style="border: 0px; width: 600px" |+ Slackware Hardware Compatibility | ! colspan="5" style="background:#ffdead;" | Slackware Versions |- | | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12.1 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 12.2 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 13 | style="font-weight: bold;text-align: center; background-color: #7FD0FF" | 13.1 |- | style="font-weight: bold; background-color: #9C9CFF" | Bluetooth | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Camera | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Ethernet | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Hibernate | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested |- | style="font-weight: bold; background-color: #9C9CFF" | Keyboard | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | LCD Control | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | Multimedia Keys | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #FF6F79" | Not Working | style="text-align: center; background-color: #FF6F79" | Not Working | style="text-align: center; background-color: #FF6F79" | Not Working |- | style="font-weight: bold; background-color: #9C9CFF" | Sound | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |- | style="font-weight: bold; background-color: #9C9CFF" | Suspend | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | Touchpad | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working | style="text-align: center; background-color: #F7FF17" | P. Working |- | style="font-weight: bold; background-color: #9C9CFF" | Wireless | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #E0E0E0" | Not Tested | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working | style="text-align: center; background-color: #5EFF54" | Working |} Legend: {| | style="text-align: center; background-color: #5EFF54" |a |- | style="text-align: center; background-color: #5EFF54" |b |} ==Hardware Specification== Output of lspci: <pre> 00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c) 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c) 00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 03) 00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03) 00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03) 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03) 00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03) 00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03) 00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03) 00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03) 00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03) 00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03) 00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03) 00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3) 00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller (rev 03) 00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03) 00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03) 00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03) 06:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61) 07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02) 08:05.0 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02) 08:05.2 SD Host controller: O2 Micro, Inc. Integrated MMC/SD Controller (rev 02) 08:05.3 Mass storage controller: O2 Micro, Inc. Integrated MS/xD Controller (rev 01) </pre> ==Hardware Configuration== ===Multimedia Keys=== One of the ways to configure the multimedia keys is installing an external software called xbindkeys. This software looks for it's configuration file $HOME/.xbindkeysrc. The code below shows a simple configuration that uses amixer commands to change volume. The play/pause, stop, previous, next keys were bind to xmms player. <pre> "amixer set Master 5%+" XF86AudioRaiseVolume "amixer set Master 10%-" XF86AudioLowerVolume "xmms -t" XF86AudioPlay "xmms -s" XF86AudioStop "xmms -r" XF86AudioPrev "xmms -f" </pre> =Known Problems= ==Keyboard/Touchpad== When you boot a fresh version of Slackware installed on a Dell Vostro 1310 laptop you may find yourself without control of you keyboard and touchpad, like they were turned off at boottime. As many forums and mailing list have discussed, this is a kernel-related issue, however, you don't need to recompile and/or update the default kernel shipped with your Slackware CD/DVD box. The fix is real simple, all you have to do is to modify the kernel's append line in the your /etc/lilo.conf in order to add the "i8042.reset" text. Remember you must be logged as the super user to be able to edit lilo's configuration. At the end your append line should be like this (considering you didn't added commands to this line previously): <pre> append="i8042.reset vt.default_utf8=0" </pre> This is it. Problem fixed. Just remember to run lilo command to update your changes. <pre> # lilo </pre> Note that this change can be done at installation to save you time and avoid stress. Just type "i8042.reset" when the setup script prompts you about any desirable lilo append command. ==LCD Brightness Control== Affected versions: * Slackware 13: working. ** Console and GUI apps work flawlessly. * Slackware 13.1: partially working. ** Console apps work as intended. ** GUI app (Xfce4 Power Manager) not working. ==Suspend to RAM== As shown on the Slackware Hardware Compatibility table, the Suspend to RAM feature used to work without problems on Slackware 13. But version 13.1 introduced a new flaw where you no longer can suspend the machine using GUI tools. To be more specific, this is a problem related to pm-utils. An workaround to fix it is to create a script at /etc/pm/sleep.d with this content: <pre> #!/bin/bash function unbind_usb { for driver in ehci ohci uhci; do cd "/sys/bus/pci/drivers/${driver}_hcd"; ids=$(ls | grep :); echo $ids > /tmp/DISABLED_$driver; for id in $ids; do echo "Unbinding $id"; echo -n "$id" > unbind; disabled="$disabled $id"; done; done; } function bind_usb { for driver in ehci ohci uhci; do cd "/sys/bus/pci/drivers/${driver}_hcd"; for id in $(cat /tmp/DISABLED_$driver); do echo "Binding $id"; echo -n "$id" > bind; done; rm /tmp/DISABLED_$driver; done; } case "$1" in hibernate|suspend) unbind_usb; ;; thaw|resume) bind_usb; # Uncomment the following two lines if USB devices stutter after resume # unbind_usb; # bind_usb; ;; *) exit 1; ;; esac; exit 0; </pre> Now you're able to suspend your laptop using GUI tools. Note that you don't need this script to suspend with command line like this: <pre> # echo mem > /sys/power/state </pre> =See also= 6e1c3bf0fb11eb25dacf9966d36e85969a267fd1 Console-Only Communication 0 48 380 69 2010-07-14T09:18:55Z Merge-delete 261 wikitext text/x-wiki HOWTO: access on-line resorces on the internet using only console-based tools. == Overview == Many times, particularly when things aren't working as expected, you may find yourself restricted to a console-only (non-X or non-graphical) session. If you have networking running, you can still access on-line support tools through your console. This tutorial shows you how to: * Use virtual consoles to increase the number of consoles you can use simultaneously; * Use the <tt>screen</tt> to create sessions that are persistant even after you close the console; * Use <tt>irssi</tt> to access the irc network and ##slackware on irc.freenode.org; * Use <tt>lynx</tt> and <tt>wget</tt> to access HTTP (web) server information; * Use <tt>lynx</tt> to pastebin a file when you need to send configuration information to an IRC channel, and; * Use <tt>wget</tt> to download a pastebin file to your local machine. == Prerequisites == This tutorial will assume you are comfortable with the following concepts: * Basic file management operations (<tt>cp</tt>,<tt>rm</tt>,etc); * Using a console-based file editor (<tt>pico</tt>,<tt>vi</tt>,etc); * [http://www.casino-spielen.biz online casino spiele] == Virtual Consoles == One of the handiest features if you're relegated to working from a console is the use of virtual consoles. This allows you to start multiple login sessions from the same console keyboard, mouse, and monitor. That way, you can have one virtual console logged into IRC so you can talk to ##slackware, one that you can use for web access, and another that you can use to test commands. Using virtual consoles is easy. Simply hold the ALT key while hitting the F2 key (ALT+F2) to switch to the second console. To switch back to the first console, use ALT+F1. You have virtual consoles available on F1 through F6. If you're using X, you can still access one of the virtual consoles, which is useful if X is hung up for some reason (especially if X won't restart using ctrl+alt+backspace). To access this virtual console, hold CTRL *and* ALT while pressing the F6 key (CTRL+ALT+F6). To switch back to your X session, press CTRL+ALT+F7. == Using <tt>screen</tt> == The <tt>screen</tt> utility allows you to start a console session which is persistent across login and logout. This is useful, for example, if you're using IRC -- perhaps you want to stay logged into your IRC channel even after you have logged out of your console session. The concept is straightforward: when you run screen, it gives you a bash prompt "inside of" the screen session. At this new bash prompt you can start your IRC session. When you wish to log out, you can detach from screen and log out -- but screen continues to run in the background. When you log back in, you can re-attach to your screen session and resume your IRC session. Visit [[Screen|this page]] for the specifics on attaching and detaching sessions using <tt>screen</tt>. == Using <tt>irssi</tt> == The <tt>irssi</tt> program is a console-based IRC client. Using irssi, you can access the ##slackware IRC channel on irc.freenode.net. *WARNING*: Whenever you are using any type of IRC client on any type of machine, make sure that you are not doing so as the superuser (root). Doing so is a security risk, since if for some reason an attacker is able to successfully attack your IRC client, the attacker will have root access to your machine. To access the ##slackware channel on irc.freenode.org using <tt>irssi</tt>, perform the following steps: * Start irssi: user@slackbox:~$ irssi * At the (status) prompt, connect to irc.freenode.org: [(status)] /connect irc.freenode.org * Once connected, set your nick: [(status)] /nick Myl33tNick * Join the ##slackware channel: [(status)] /join ##slackware * To exit irssi: [(status)] /quit Visit [[Irssi|this page]] for more information on using irssi. == Using <tt>lynx</tt> and <tt>wget</tt> == You can use <tt>lynx</tt> and <tt>wget</tt> to access http (web) servers from your console session. Lynx allows you to access a web site interactively, much like using a graphical browser such as Firefox, but through a text-only console session. <tt>Wget</tt> allows you to retrieve documents from web servers non-interactively, which is handy when you need to retrieve a certain document (say a tarball or a script file) from a web server in a very quick way. To start using lynx, from a bash prompt simply type: user@slackbox:~$ lynx "http://www.slackware.com" to visit Slackware's official website. To exit lynx, use CTRL+C. In the example above, the double-quotes are not strictly required. However, many URLs contain characters which have special meaning to the bash interpreter (such as the ampersand), and the double-quotes stop bash from trying to interpret those characters. Although wget has a wide array of options (visit man wget sometime), its basic use is very simple. For example, to download the latest kernel patch (as of this writing) from kernel.org, simply do: user@slackbox:~$ wget "http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.20.3.bz2" Again, the quotes here are not strictly required for this URL, but are required for certain URLs. It's good to get in the habit of always double-quoting URLs from a bash prompt. == Using <tt>lynx</tt> in conjuction with pastebin == You may find yourself on ##slackware and another channel member may ask you to "pastebin" information to them. The purpose of pastebin is so that you can share technical information (for example, the contents of a configuration file) with the other channel members, without pasting that information directly into IRC itself (which is generally disliked by other IRC members and will get you banned if you try it). "Pastebin" is a generic term for a web site which offers this sort of service. There are many pastebin sites out there; for simplicity's sake, this tutorial uses [http://pastebin.ca pastebin.ca]. You can use lynx to access the pastebin site, but what if you need to pastebin the contents of an entire file? You can do this using the <tt>lynx</tt> program: * use <tt>lynx</tt> to access pastebin.ca: user@slackbox:~$ lynx "http://pastebin.ca" * Page down until you see the large textbox area, move your cursor to the first line (where you see the X below): Create a New Pastebin Post Welcome to the Pastebin. For information on what this is, take a look at the What is This? page. You may also want to see the most recent post to the pastebin. Please enter your new post below (or upload a file instead): paste below X_____________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ (NORMAL LINK) Use right-arrow or <return> to activate. Arrow keys: Up and Down to move. Right to follow a link; Left to go back. H)elp O)ptions P)rint G)o M)ain screen Q)uit /=search [delete]=history list * Press Ctrl+X, then i, and enter the location of the file you wish to pastebin. Enter a filename: /etc/ssh/sshd_config * Page down until you see the "Submit Post" link, select it (it will turn yellow), and press the enter key. * On the next page, scroll down until you find the URL to your pastebin file. It will look something like this: paste added to database Your paste has been accepted an added to the database. You will be redirected to it momentarily. The URL for it is: http://pastebin.ca/398871 You may use that URL for referencing your submission from now on. * Give this URL to the person who requested the information on IRC. == Using <tt>wget</tt> in conjunction with pastebin == Every pastebin site should have a way to request any pastebin file in "raw" format, meaning without the added HTML code so that the pastebin information displays properly in a browser. Accessing the "raw" format means you can access exactly what was pastebinned, with nothing else added. This is useful if you want to download a configuration file from pastebin. If you know the raw URL of the pastebin page you need, you can use wget to retrieve the file. * Find the raw URL associated with the pastebin page. For pastebin.ca, this is just the regular URL with an extra "raw" directory inserted. For example, if your regular pastebin url is http://pastebin.ca/398871, then the raw version is at http://pastebin.ca/raw/398871. * use wget to retrieve the file, but rename it so that it's not named 398871 (in this example, the output is named "this.cfg"): user@slackbox:~$ wget "http://pastebin.ca/raw/398871" -O this.cfg You'll find you'll use commands like wget over and over again this way, even when you have access to a fully graphical web browser. [[Category:Tutorials]] 52c5535fc0f285022a8387182ae583843fda65f2 381 380 2010-07-14T16:30:04Z Erik 1 Reverted edits by [[Special:Contributions/AmandaCusack|AmandaCusack]] ([[User talk:AmandaCusack|Talk]]) to last revision by [[User:Erik|Erik]] wikitext text/x-wiki HOWTO: access on-line resorces on the internet using only console-based tools. == Overview == Many times, particularly when things aren't working as expected, you may find yourself restricted to a console-only (non-X or non-graphical) session. If you have networking running, you can still access on-line support tools through your console. This tutorial shows you how to: * Use virtual consoles to increase the number of consoles you can use simultaneously; * Use the <tt>screen</tt> to create sessions that are persistant even after you close the console; * Use <tt>irssi</tt> to access the irc network and ##slackware on irc.freenode.org; * Use <tt>lynx</tt> and <tt>wget</tt> to access HTTP (web) server information; * Use <tt>lynx</tt> to pastebin a file when you need to send configuration information to an IRC channel, and; * Use <tt>wget</tt> to download a pastebin file to your local machine. == Prerequisites == This tutorial will assume you are comfortable with the following concepts: * Basic file management operations (<tt>cp</tt>,<tt>rm</tt>,etc); * Using a console-based file editor (<tt>pico</tt>,<tt>vi</tt>,etc); == Virtual Consoles == One of the handiest features if you're relegated to working from a console is the use of virtual consoles. This allows you to start multiple login sessions from the same console keyboard, mouse, and monitor. That way, you can have one virtual console logged into IRC so you can talk to ##slackware, one that you can use for web access, and another that you can use to test commands. Using virtual consoles is easy. Simply hold the ALT key while hitting the F2 key (ALT+F2) to switch to the second console. To switch back to the first console, use ALT+F1. You have virtual consoles available on F1 through F6. If you're using X, you can still access one of the virtual consoles, which is useful if X is hung up for some reason (especially if X won't restart using ctrl+alt+backspace). To access this virtual console, hold CTRL *and* ALT while pressing the F6 key (CTRL+ALT+F6). To switch back to your X session, press CTRL+ALT+F7. == Using <tt>screen</tt> == The <tt>screen</tt> utility allows you to start a console session which is persistent across login and logout. This is useful, for example, if you're using IRC -- perhaps you want to stay logged into your IRC channel even after you have logged out of your console session. The concept is straightforward: when you run screen, it gives you a bash prompt "inside of" the screen session. At this new bash prompt you can start your IRC session. When you wish to log out, you can detach from screen and log out -- but screen continues to run in the background. When you log back in, you can re-attach to your screen session and resume your IRC session. Visit [[Screen|this page]] for the specifics on attaching and detaching sessions using <tt>screen</tt>. == Using <tt>irssi</tt> == The <tt>irssi</tt> program is a console-based IRC client. Using irssi, you can access the ##slackware IRC channel on irc.freenode.net. *WARNING*: Whenever you are using any type of IRC client on any type of machine, make sure that you are not doing so as the superuser (root). Doing so is a security risk, since if for some reason an attacker is able to successfully attack your IRC client, the attacker will have root access to your machine. To access the ##slackware channel on irc.freenode.org using <tt>irssi</tt>, perform the following steps: * Start irssi: user@slackbox:~$ irssi * At the (status) prompt, connect to irc.freenode.org: [(status)] /connect irc.freenode.org * Once connected, set your nick: [(status)] /nick Myl33tNick * Join the ##slackware channel: [(status)] /join ##slackware * To exit irssi: [(status)] /quit Visit [[Irssi|this page]] for more information on using irssi. == Using <tt>lynx</tt> and <tt>wget</tt> == You can use <tt>lynx</tt> and <tt>wget</tt> to access http (web) servers from your console session. Lynx allows you to access a web site interactively, much like using a graphical browser such as Firefox, but through a text-only console session. <tt>Wget</tt> allows you to retrieve documents from web servers non-interactively, which is handy when you need to retrieve a certain document (say a tarball or a script file) from a web server in a very quick way. To start using lynx, from a bash prompt simply type: user@slackbox:~$ lynx "http://www.slackware.com" to visit Slackware's official website. To exit lynx, use CTRL+C. In the example above, the double-quotes are not strictly required. However, many URLs contain characters which have special meaning to the bash interpreter (such as the ampersand), and the double-quotes stop bash from trying to interpret those characters. Although wget has a wide array of options (visit man wget sometime), its basic use is very simple. For example, to download the latest kernel patch (as of this writing) from kernel.org, simply do: user@slackbox:~$ wget "http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.20.3.bz2" Again, the quotes here are not strictly required for this URL, but are required for certain URLs. It's good to get in the habit of always double-quoting URLs from a bash prompt. == Using <tt>lynx</tt> in conjuction with pastebin == You may find yourself on ##slackware and another channel member may ask you to "pastebin" information to them. The purpose of pastebin is so that you can share technical information (for example, the contents of a configuration file) with the other channel members, without pasting that information directly into IRC itself (which is generally disliked by other IRC members and will get you banned if you try it). "Pastebin" is a generic term for a web site which offers this sort of service. There are many pastebin sites out there; for simplicity's sake, this tutorial uses [http://pastebin.ca pastebin.ca]. You can use lynx to access the pastebin site, but what if you need to pastebin the contents of an entire file? You can do this using the <tt>lynx</tt> program: * use <tt>lynx</tt> to access pastebin.ca: user@slackbox:~$ lynx "http://pastebin.ca" * Page down until you see the large textbox area, move your cursor to the first line (where you see the X below): Create a New Pastebin Post Welcome to the Pastebin. For information on what this is, take a look at the What is This? page. You may also want to see the most recent post to the pastebin. Please enter your new post below (or upload a file instead): paste below X_____________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ (NORMAL LINK) Use right-arrow or <return> to activate. Arrow keys: Up and Down to move. Right to follow a link; Left to go back. H)elp O)ptions P)rint G)o M)ain screen Q)uit /=search [delete]=history list * Press Ctrl+X, then i, and enter the location of the file you wish to pastebin. Enter a filename: /etc/ssh/sshd_config * Page down until you see the "Submit Post" link, select it (it will turn yellow), and press the enter key. * On the next page, scroll down until you find the URL to your pastebin file. It will look something like this: paste added to database Your paste has been accepted an added to the database. You will be redirected to it momentarily. The URL for it is: http://pastebin.ca/398871 You may use that URL for referencing your submission from now on. * Give this URL to the person who requested the information on IRC. == Using <tt>wget</tt> in conjunction with pastebin == Every pastebin site should have a way to request any pastebin file in "raw" format, meaning without the added HTML code so that the pastebin information displays properly in a browser. Accessing the "raw" format means you can access exactly what was pastebinned, with nothing else added. This is useful if you want to download a configuration file from pastebin. If you know the raw URL of the pastebin page you need, you can use wget to retrieve the file. * Find the raw URL associated with the pastebin page. For pastebin.ca, this is just the regular URL with an extra "raw" directory inserted. For example, if your regular pastebin url is http://pastebin.ca/398871, then the raw version is at http://pastebin.ca/raw/398871. * use wget to retrieve the file, but rename it so that it's not named 398871 (in this example, the output is named "this.cfg"): user@slackbox:~$ wget "http://pastebin.ca/raw/398871" -O this.cfg You'll find you'll use commands like wget over and over again this way, even when you have access to a fully graphical web browser. [[Category:Tutorials]] efcf19613488e16a82ad6d20051d7720972495f4 ACPI Modules 0 64 382 85 2010-07-22T07:14:18Z Merge-delete 261 wikitext text/x-wiki [[Category:Tips]] These are the kernel modules that need to be loaded in order to use some of the features of ACPI. * ac - AC adapter information * battery - Battery information * fan * button - Enables accesing info about ACPI-controlled buttons (like the Power button and the LID button) * video * thermal - Driver for the Thermal Zone (/proc/acpi/thermal_zone) * processor - Loads the ACPI processor driver (/proc/acpi/processor) * container - Loads the ACPI container driver * vendor-specific drivers (eg acer_acpi, [http://www.thinkwiki.org/wiki/Thinkpad-acpi thinkpad-acpi]) * [http://www.college-paper.org/custom-essay.html college essays] e92f34fb9325fbde48275aa04ab593c9145e352d 383 382 2010-07-22T08:43:49Z Erik 1 Reverted edits by [[Special:Contributions/Meghan|Meghan]] ([[User talk:Meghan|Talk]]) to last revision by [[User:Erik|Erik]] wikitext text/x-wiki [[Category:Tips]] These are the kernel modules that need to be loaded in order to use some of the features of ACPI. * ac - AC adapter information * battery - Battery information * fan * button - Enables accesing info about ACPI-controlled buttons (like the Power button and the LID button) * video * thermal - Driver for the Thermal Zone (/proc/acpi/thermal_zone) * processor - Loads the ACPI processor driver (/proc/acpi/processor) * container - Loads the ACPI container driver * vendor-specific drivers (eg acer_acpi, [http://www.thinkwiki.org/wiki/Thinkpad-acpi thinkpad-acpi]) a1f62a5b9a0a02eca3d6d924c4076b0ae8077c45 SlackRoll Tutorial 0 157 384 344 2010-07-23T10:50:35Z Merge-delete 261 wikitext text/x-wiki <strong>SlackRoll</strong> is a package or update manager for Slackware Linux. Part of this tutorial has been taken from its [http://rg3.github.com/slackroll/ official webpage] and FAQ. SlackRoll's defining points: * Its internal mechanism based on package states. * Like <em>slackpkg</em>, SlackRoll only works with official mirrors, meaning that to keep third party packages up to date you need to perform the task by hand (recommended practice, using SlackBuild scripts) or use a second different tool. * It does not try to compare package version numbers to decide if a package should be upgraded or not. * Partly as a consequence of the previous point, it has no known flaws detecting package updates (including reverts), new packages, removed packages, third party packages getting an official version and blacklisted packages (<em>frozen</em> in its terminology) being removed. * It has a broad range of operations and features. * It attempts to be fast. Most internal operations like listing available upgrades usually take less than one second on a modern computer. = Installation = == Requirements == * Python 2.4 or later (provided by package <em>python</em> starting with Slackware 10.1). * GnuPG (provided by package <em>gnupg</em> or <em>gnupg2</em>). * Vim (provided by package <em>vim</em>). * A pager which is <em>less</em> by default (provided by package <em>less</em>). == Procedure == Download the SlackRoll package from the [http://github.com/rg3/slackroll/downloads project download page] and install it in your system using <tt>installpkg</tt>. = Background Information = The majority of SlackRoll commands that receive a list of packages expect only the package names (<em>foo</em> as opposed to <em>foo-1.1-i486-3.tgz</em>). Some of them also allow using a specific version, but they are the exception. SlackRoll creates a persistent database of packages in your hard drive. Each package is in one of several possible states. Part of the initial configuration consists in deciding which states some of your packages will have. There are two types of states: states to avoid (temporary states) and normal states. When the remote Slackware official tree is updated, SlackRoll may put some packages in temporary states. By upgrading, installing, removing and marking packages your objective is to correct those packages and put them in a normal state. == States to Avoid == === New === New packages are packages present in the remote tree that weren't present before. You should decide if you want to install them or mark them as not installed. === Outdated === Outdated packages are present in your system, but the version you have does not match any relevant one in the remote tree. You should upgrade these packages. === Unavailable === Unavailable packages are packages present in your system. Previously, they probably existed in the remote tree, but now they do not seem to be available for downloading and installing. You should decide if you want to remove them or mark them as foreign. == Normal States == === Installed === Installed packages are very common. They are present in your system and in the remote tree, and both versions match. === Not Installed === Not installed packages are also very common. They are present in the remote tree but not in your system. They can be downloaded and installed if you want. === Foreign === Foreign packages are packages present in your system but not in the remote tree. However, unlike unavailable packages, they are supposed to be present in your system. No package will enter this state automatically. Only the ones you mark. It's usually reserved for third party packages and packages you build yourself. It's worth noting that if a foreign package ever appears in the remote official tree, it will be marked as installed or, probably, outdated. Thus, SlackRoll will give priority to the new official package over yours. If you still want to use your own build, mark it as frozen. === Frozen === Frozen packages are present in your system and in the remote tree. Your version may or may not match the ones from the remote tree, but SlackRoll will not tell you they need to be upgraded. No package will enter this state automatically. It's usually reserved for packages that shouldn't be upgraded automatically or ever (<em>aaa_elflibs</em>, kernels, etc) and sometimes for customized versions of official packages. It's also worth mentioning that a frozen package will be moved to unavailable if it disappears from the remote tree. It that happens and you want to continue using it, you'll need to mark it as foreign. = Initial Configuration = Word of warning: it's highly recommended to do the initial configuration from an up-to-date and controlled system. This will avoid confusion and helps preventing mistakes setting the initial package states. == Preparing Your System == Choose a Slackware mirror for your Slackware version. Use the <em>set-mirror</em> operation to select one mirror. SlackRoll can work with stable trees as well as the <em>current</em> tree. Example: # slackroll set-mirror 'http://slackware.example.org/slackware-current/' Do not forget to include the trailing slash in the mirror URL. Import, to your keyring, the GnuPG key used to sign the official Slackware packages. This key can be found in Slackware CDs and DVDs as the file GPG-KEY, and you can import the key to your keyring using the command <em>gpg --import</em>, but SlackRoll is able to download the key from the mirror and importing it automatically, if you trust the mirror. # slackroll import-key Finally, retrieve the mirror information for the first time. This will download a few metadata files, and this is what you need to do when you're going to handle a new round of updates. # slackroll update == Going Over Package States for The First Time == When you run SlackRoll for the first times, it will put every remote package not present in your system in the state New. When your system is up to date and under control, you can blindly mark every new package as not installed with the following command: # slackroll new-not-installed Any third party package present in your system will be put in the state Unavailable. When your system is up to date and under control you can blindly mark all unavailable packages as foreign. <em>However</em>, the number of foreign packages is usually not very high and forgetting to remove from your system a package that was removed from the remote tree is a common mistake. The Book of Best Practices would suggest that you review the list of unavailable packages once and carefully in order to detect packages that should not be present in your system. To print the list run: # slackroll list-unavailable If you locate any package that needs to be removed, you can remove them using <em>removepkg</em> or the <em>remove</em> operation. The later has additional functionality so it's recommended: # slackroll remove foo bar Now you can mark the rest as foreign packages. # slackroll unavailable-foreign Finally, you probably want to mark some packages as frozen. It's usually a good idea to do this with <em>aaa_elflibs</em>, kernel packages and others. # slackroll frozen aaa_elflibs foo bar = Day to Day Usage = Apart from the operations listed here, you can run the <em>help</em> operation to get the full list of supported operations, along with a brief description of each one. A more detailed description can be found in the [http://wiki.github.com/rg3/slackroll/operations-guide operations guide]. == New Round of Updates == What to do when there is a new round of updates? The Book of Best Practices suggests taking care of different events in a specific order: * Updates to glibc-solibs, sed and pkgtools need to be handled first, in that order. * If there are new packages, handle them second. * Then, it's time to upgrade outdated packages. * If packages have been deleted from the remote tree, handle them last. This is the correct order in 99% of the cases. SlackRoll will attempt to warn you and ask for confirmation if it detects you may be breaking this order. However, <strong>you</strong> have the last word on what to do, so proceed with caution and don't break your system. First, update the remote mirror information with the <em>update</em> operation we mentioned before. New changelog entries will be saved to your hard drive. It's recommended that you take a look at the changelog at this point, using the <em>changelog</em> operation. Then, get an overview of the events using the <em>list-transient</em> operation, which will list the new, outdated and unavailable packages along with a big fat warning message if activity in key system packages is detected. The best way to deal with glibc-solibs, sed and pkgtool updates is to use the <em>upgrade-key-packages</em> operation. # slackroll upgrade-key-packages You could also use the <em>install</em> operation. Despite its name, it can be used to both install and upgrade individual packages. Let's suppose packages <em>glibc-solibs</em> and <em>sed</em> where updated: # slackroll install glibc-solibs sed The <em>install</em> operation is one of the few operations allowing you to pass specific package versions. It will proceed in the order you indicate, so remember to give the packages in the correct order if you use this method. Second, you should handle new packages. You can clearly get a list of new packages with the <em>list-new</em> operation. New packages can be installed with the <em>install</em> operation as we just showed. When installing a remote package, SlackRoll will give you the opportunity of selecting the version to install if there are several available in the remote tree. Or, if you are not interested in installing a new package, mark it as not installed: # slackroll not-installed foo bar If the package names are not enough for you to decide if you want to install it or not, you can always use the <em>info</em> operation and SlackRoll will download and display the package info file (small <em>txt</em> files in the remote tree). And, of course, be carefull with new libraries as they may have been included to extend the functionality of an existing package you may have installed. The third step is taking care of outdated packages. For that, a few operations are available. <em>list-upgrades</em> lets you see a summary of the available upgrades. You can download and install them with <em>upgrade</em> or download them with <em>download-upgrades</em> or even print their URLs with <em>urls-upgrades</em>. And, finally, review the list of unavailable packages. Be careful with unavailable packages. Sometimes you install a foreign package but forget to mark it as such in SlackRoll. To avoid that problem, it's better to install them with the <em>install-foreign</em> operation. Individual unavailable packages can be removed with the <em>remove</em> operation as we showed before, and also all of them at the same time with the <em>remove-unavailable</em> operation. == Installing and Removing Individual Packages == There are a few operations related to installing and getting some information about individual packages. The most common ones are <em>install</em> to upgrade or install packages, <em>info</em> to maybe download and display package info files, <em>urls</em> to get a list of URLs and <em>remove</em> to remove individual packages. Operations that install packages let you manage <em>.new</em> files after the installation is completed, in a similar way to <em>slackpkg</em>. You can view the differences between the <em>.new</em> file and its counterparts with <em>vimdiff</em> (which provides a nice and colorized way of spotting the differences and maybe porting the old configuration to the new file), you can overwrite the old file with the <em>.new</em> file, delete the <em>.new</em> file directly, etc. Additionally, removal operations also track pairs of <em>.new</em> files and give you the opportunity of deleting configuration files that have been left behind. You are not forced to remove the files left behind, of course. Upgrade operations will perform both tasks. First, they will let you review the <em>.new</em> files and then they will give you the opportunity of deleting obsolete configuration files left behind. While using <em>vimdiff</em>, turning off syntax highlighting is recommended. <em>Vim</em> uses colors to highlight file differences and those can interfere with syntax highlighting colors, making text invisible or hard to read. Syntax highlighting can be turned off temporarily by using "<tt>:syntax off</tt>" in command mode, or you can disable it permanently putting "<tt>syntax off</tt>" in your <tt>~/.vimrc</tt> file (noting that usually you run SlackRoll as the superuser). == Managing Customized Versions of Official Packages == There are at least three ways of dealing with customized versions of official packages. These are custom versions or compilations of packages present in the remote official tree. They are normally used to add or remove features, or activate or apply patches that are disabled by default. For example, if you want to activate the <em>freetype</em> bytecode interpreter, you need to rebuild that package. The simplest way of dealing with these packages is to give them the same name and version as the official packages. When they are upgraded in the remote tree, however, SlackRoll will want to upgrade them. You can mark them as frozen before upgrading and only unfreeze them after you have rebuilt the new version, if you want to avoid SlackRoll replacing them with the new official version. Second, you can give them the same name and version as the official package, <strong>but</strong> keep them frozen all the time. How would you know then if they need to be rebuilt? With the <em>list-outdated-frozen</em> operation. Take into account the information given by <em>list-outdated-frozen</em> is not reflected by any other command. Specifically, it's not reflected as part of <em>list-transient</em> and friends. Third, you can give them a name or version different to the official package. Typically this means adding a custom build suffix and marking the package as frozen. How would you know if you need to rebuild it? Paying attention to the changelog specifically searching for upgrades in those packages and also using the <em>list-versions</em> operation, that lets you view the different known versions of a package, including local and remote ones. == Maintenance == SlackRoll barely requires maintenance. It keeps all downloaded packages in its package cache, located in the <em>/var/slackroll/packages</em> directory. When downloading files, it keeps them in a temporary directory until they're fully downloaded. If you want to remove every downloaded package, you can simply perform <code>slackroll erase-cache</code>. There is, however, a <em>clean-cache</em> operation which does <strong>not</strong> remove every downloaded package, but only those that are no longer present in the remote tree. Running that operation from time to time keeps your package cache sane and controlled. It may also be a good idea to delete the temporary directory contents from time to time, with <code>slackroll erase-tmp</code>, but it should be empty unless you interrupt SlackRoll while downloading stuff and never attempt to complete the download. == Other Operations == If you run the <em>help</em> operation you will see SlackRoll has many other operations, including operations to list packages by state, list local packages, list remote packages and list all known packages. It has operations to put packages in specific states and checking the state of packages. You can also download, install, display info or remove new or unavailable packages or packages with a matching path (like <em>/slackware/kde/</em>). Finally, there are search operations, to search for packages by name or path, search for files in your local system (like running <em>grep</em> on the contents of <em>/var/log/packages</em>), query the Slackware Package Browser, and finally a few very slow but sometimes useful operations to search for broken symlinks under a specific hierarchy and the same for orphan files (files not belonging to any package), as well as searching for missing files. As a general rule, every operation either does not accept arguments or allows a list of them. Operations accepting packages as arguments expect the package name only unless the help text mentions that they also accept specific package versions. Some operations need regular expressions. For the most part they have the same syntax as they have in <em>grep</em> or <em>Perl</em>, but you can read the [http://docs.python.org/lib/re-syntax.html Python regular expressions syntax reference] if you want to perform an unusually complex search. [[Category:Tutorials]] ==Related Links== [http://www.cellulite.co.uk/ '''cellulite'''] 9692a3579942fa63a5c2b79239e42c7e13fd38a5 385 384 2010-07-23T19:38:20Z Erik 1 Reverted edits by [[Special:Contributions/Jheena789|Jheena789]] ([[User talk:Jheena789|Talk]]) to last revision by [[User:Johnbristol|Johnbristol]] wikitext text/x-wiki <strong>SlackRoll</strong> is a package or update manager for Slackware Linux. Part of this tutorial has been taken from its [http://rg3.github.com/slackroll/ official webpage] and FAQ. SlackRoll's defining points: * Its internal mechanism based on package states. * Like <em>slackpkg</em>, SlackRoll only works with official mirrors, meaning that to keep third party packages up to date you need to perform the task by hand (recommended practice, using SlackBuild scripts) or use a second different tool. * It does not try to compare package version numbers to decide if a package should be upgraded or not. * Partly as a consequence of the previous point, it has no known flaws detecting package updates (including reverts), new packages, removed packages, third party packages getting an official version and blacklisted packages (<em>frozen</em> in its terminology) being removed. * It has a broad range of operations and features. * It attempts to be fast. Most internal operations like listing available upgrades usually take less than one second on a modern computer. = Installation = == Requirements == * Python 2.4 or later (provided by package <em>python</em> starting with Slackware 10.1). * GnuPG (provided by package <em>gnupg</em> or <em>gnupg2</em>). * Vim (provided by package <em>vim</em>). * A pager which is <em>less</em> by default (provided by package <em>less</em>). == Procedure == Download the SlackRoll package from the [http://github.com/rg3/slackroll/downloads project download page] and install it in your system using <tt>installpkg</tt>. = Background Information = The majority of SlackRoll commands that receive a list of packages expect only the package names (<em>foo</em> as opposed to <em>foo-1.1-i486-3.tgz</em>). Some of them also allow using a specific version, but they are the exception. SlackRoll creates a persistent database of packages in your hard drive. Each package is in one of several possible states. Part of the initial configuration consists in deciding which states some of your packages will have. There are two types of states: states to avoid (temporary states) and normal states. When the remote Slackware official tree is updated, SlackRoll may put some packages in temporary states. By upgrading, installing, removing and marking packages your objective is to correct those packages and put them in a normal state. == States to Avoid == === New === New packages are packages present in the remote tree that weren't present before. You should decide if you want to install them or mark them as not installed. === Outdated === Outdated packages are present in your system, but the version you have does not match any relevant one in the remote tree. You should upgrade these packages. === Unavailable === Unavailable packages are packages present in your system. Previously, they probably existed in the remote tree, but now they do not seem to be available for downloading and installing. You should decide if you want to remove them or mark them as foreign. == Normal States == === Installed === Installed packages are very common. They are present in your system and in the remote tree, and both versions match. === Not Installed === Not installed packages are also very common. They are present in the remote tree but not in your system. They can be downloaded and installed if you want. === Foreign === Foreign packages are packages present in your system but not in the remote tree. However, unlike unavailable packages, they are supposed to be present in your system. No package will enter this state automatically. Only the ones you mark. It's usually reserved for third party packages and packages you build yourself. It's worth noting that if a foreign package ever appears in the remote official tree, it will be marked as installed or, probably, outdated. Thus, SlackRoll will give priority to the new official package over yours. If you still want to use your own build, mark it as frozen. === Frozen === Frozen packages are present in your system and in the remote tree. Your version may or may not match the ones from the remote tree, but SlackRoll will not tell you they need to be upgraded. No package will enter this state automatically. It's usually reserved for packages that shouldn't be upgraded automatically or ever (<em>aaa_elflibs</em>, kernels, etc) and sometimes for customized versions of official packages. It's also worth mentioning that a frozen package will be moved to unavailable if it disappears from the remote tree. It that happens and you want to continue using it, you'll need to mark it as foreign. = Initial Configuration = Word of warning: it's highly recommended to do the initial configuration from an up-to-date and controlled system. This will avoid confusion and helps preventing mistakes setting the initial package states. == Preparing Your System == Choose a Slackware mirror for your Slackware version. Use the <em>set-mirror</em> operation to select one mirror. SlackRoll can work with stable trees as well as the <em>current</em> tree. Example: # slackroll set-mirror 'http://slackware.example.org/slackware-current/' Do not forget to include the trailing slash in the mirror URL. Import, to your keyring, the GnuPG key used to sign the official Slackware packages. This key can be found in Slackware CDs and DVDs as the file GPG-KEY, and you can import the key to your keyring using the command <em>gpg --import</em>, but SlackRoll is able to download the key from the mirror and importing it automatically, if you trust the mirror. # slackroll import-key Finally, retrieve the mirror information for the first time. This will download a few metadata files, and this is what you need to do when you're going to handle a new round of updates. # slackroll update == Going Over Package States for The First Time == When you run SlackRoll for the first times, it will put every remote package not present in your system in the state New. When your system is up to date and under control, you can blindly mark every new package as not installed with the following command: # slackroll new-not-installed Any third party package present in your system will be put in the state Unavailable. When your system is up to date and under control you can blindly mark all unavailable packages as foreign. <em>However</em>, the number of foreign packages is usually not very high and forgetting to remove from your system a package that was removed from the remote tree is a common mistake. The Book of Best Practices would suggest that you review the list of unavailable packages once and carefully in order to detect packages that should not be present in your system. To print the list run: # slackroll list-unavailable If you locate any package that needs to be removed, you can remove them using <em>removepkg</em> or the <em>remove</em> operation. The later has additional functionality so it's recommended: # slackroll remove foo bar Now you can mark the rest as foreign packages. # slackroll unavailable-foreign Finally, you probably want to mark some packages as frozen. It's usually a good idea to do this with <em>aaa_elflibs</em>, kernel packages and others. # slackroll frozen aaa_elflibs foo bar = Day to Day Usage = Apart from the operations listed here, you can run the <em>help</em> operation to get the full list of supported operations, along with a brief description of each one. A more detailed description can be found in the [http://wiki.github.com/rg3/slackroll/operations-guide operations guide]. == New Round of Updates == What to do when there is a new round of updates? The Book of Best Practices suggests taking care of different events in a specific order: * Updates to glibc-solibs, sed and pkgtools need to be handled first, in that order. * If there are new packages, handle them second. * Then, it's time to upgrade outdated packages. * If packages have been deleted from the remote tree, handle them last. This is the correct order in 99% of the cases. SlackRoll will attempt to warn you and ask for confirmation if it detects you may be breaking this order. However, <strong>you</strong> have the last word on what to do, so proceed with caution and don't break your system. First, update the remote mirror information with the <em>update</em> operation we mentioned before. New changelog entries will be saved to your hard drive. It's recommended that you take a look at the changelog at this point, using the <em>changelog</em> operation. Then, get an overview of the events using the <em>list-transient</em> operation, which will list the new, outdated and unavailable packages along with a big fat warning message if activity in key system packages is detected. The best way to deal with glibc-solibs, sed and pkgtool updates is to use the <em>upgrade-key-packages</em> operation. # slackroll upgrade-key-packages You could also use the <em>install</em> operation. Despite its name, it can be used to both install and upgrade individual packages. Let's suppose packages <em>glibc-solibs</em> and <em>sed</em> where updated: # slackroll install glibc-solibs sed The <em>install</em> operation is one of the few operations allowing you to pass specific package versions. It will proceed in the order you indicate, so remember to give the packages in the correct order if you use this method. Second, you should handle new packages. You can clearly get a list of new packages with the <em>list-new</em> operation. New packages can be installed with the <em>install</em> operation as we just showed. When installing a remote package, SlackRoll will give you the opportunity of selecting the version to install if there are several available in the remote tree. Or, if you are not interested in installing a new package, mark it as not installed: # slackroll not-installed foo bar If the package names are not enough for you to decide if you want to install it or not, you can always use the <em>info</em> operation and SlackRoll will download and display the package info file (small <em>txt</em> files in the remote tree). And, of course, be carefull with new libraries as they may have been included to extend the functionality of an existing package you may have installed. The third step is taking care of outdated packages. For that, a few operations are available. <em>list-upgrades</em> lets you see a summary of the available upgrades. You can download and install them with <em>upgrade</em> or download them with <em>download-upgrades</em> or even print their URLs with <em>urls-upgrades</em>. And, finally, review the list of unavailable packages. Be careful with unavailable packages. Sometimes you install a foreign package but forget to mark it as such in SlackRoll. To avoid that problem, it's better to install them with the <em>install-foreign</em> operation. Individual unavailable packages can be removed with the <em>remove</em> operation as we showed before, and also all of them at the same time with the <em>remove-unavailable</em> operation. == Installing and Removing Individual Packages == There are a few operations related to installing and getting some information about individual packages. The most common ones are <em>install</em> to upgrade or install packages, <em>info</em> to maybe download and display package info files, <em>urls</em> to get a list of URLs and <em>remove</em> to remove individual packages. Operations that install packages let you manage <em>.new</em> files after the installation is completed, in a similar way to <em>slackpkg</em>. You can view the differences between the <em>.new</em> file and its counterparts with <em>vimdiff</em> (which provides a nice and colorized way of spotting the differences and maybe porting the old configuration to the new file), you can overwrite the old file with the <em>.new</em> file, delete the <em>.new</em> file directly, etc. Additionally, removal operations also track pairs of <em>.new</em> files and give you the opportunity of deleting configuration files that have been left behind. You are not forced to remove the files left behind, of course. Upgrade operations will perform both tasks. First, they will let you review the <em>.new</em> files and then they will give you the opportunity of deleting obsolete configuration files left behind. While using <em>vimdiff</em>, turning off syntax highlighting is recommended. <em>Vim</em> uses colors to highlight file differences and those can interfere with syntax highlighting colors, making text invisible or hard to read. Syntax highlighting can be turned off temporarily by using "<tt>:syntax off</tt>" in command mode, or you can disable it permanently putting "<tt>syntax off</tt>" in your <tt>~/.vimrc</tt> file (noting that usually you run SlackRoll as the superuser). == Managing Customized Versions of Official Packages == There are at least three ways of dealing with customized versions of official packages. These are custom versions or compilations of packages present in the remote official tree. They are normally used to add or remove features, or activate or apply patches that are disabled by default. For example, if you want to activate the <em>freetype</em> bytecode interpreter, you need to rebuild that package. The simplest way of dealing with these packages is to give them the same name and version as the official packages. When they are upgraded in the remote tree, however, SlackRoll will want to upgrade them. You can mark them as frozen before upgrading and only unfreeze them after you have rebuilt the new version, if you want to avoid SlackRoll replacing them with the new official version. Second, you can give them the same name and version as the official package, <strong>but</strong> keep them frozen all the time. How would you know then if they need to be rebuilt? With the <em>list-outdated-frozen</em> operation. Take into account the information given by <em>list-outdated-frozen</em> is not reflected by any other command. Specifically, it's not reflected as part of <em>list-transient</em> and friends. Third, you can give them a name or version different to the official package. Typically this means adding a custom build suffix and marking the package as frozen. How would you know if you need to rebuild it? Paying attention to the changelog specifically searching for upgrades in those packages and also using the <em>list-versions</em> operation, that lets you view the different known versions of a package, including local and remote ones. == Maintenance == SlackRoll barely requires maintenance. It keeps all downloaded packages in its package cache, located in the <em>/var/slackroll/packages</em> directory. When downloading files, it keeps them in a temporary directory until they're fully downloaded. If you want to remove every downloaded package, you can simply perform <code>slackroll erase-cache</code>. There is, however, a <em>clean-cache</em> operation which does <strong>not</strong> remove every downloaded package, but only those that are no longer present in the remote tree. Running that operation from time to time keeps your package cache sane and controlled. It may also be a good idea to delete the temporary directory contents from time to time, with <code>slackroll erase-tmp</code>, but it should be empty unless you interrupt SlackRoll while downloading stuff and never attempt to complete the download. == Other Operations == If you run the <em>help</em> operation you will see SlackRoll has many other operations, including operations to list packages by state, list local packages, list remote packages and list all known packages. It has operations to put packages in specific states and checking the state of packages. You can also download, install, display info or remove new or unavailable packages or packages with a matching path (like <em>/slackware/kde/</em>). Finally, there are search operations, to search for packages by name or path, search for files in your local system (like running <em>grep</em> on the contents of <em>/var/log/packages</em>), query the Slackware Package Browser, and finally a few very slow but sometimes useful operations to search for broken symlinks under a specific hierarchy and the same for orphan files (files not belonging to any package), as well as searching for missing files. As a general rule, every operation either does not accept arguments or allows a list of them. Operations accepting packages as arguments expect the package name only unless the help text mentions that they also accept specific package versions. Some operations need regular expressions. For the most part they have the same syntax as they have in <em>grep</em> or <em>Perl</em>, but you can read the [http://docs.python.org/lib/re-syntax.html Python regular expressions syntax reference] if you want to perform an unusually complex search. [[Category:Tutorials]] bb5d923e18915f5fde77baf9bd05011095b6308d Kernel-packaging 0 213 386 342 2010-07-25T19:42:37Z Dive 19 /* Making the Package */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6-i686-1_tag.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source .config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##") do mkdir -p $MODDDIR/$(dirname $i) install -m 644 -v $i $MODDDIR/$(dirname $i) done mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME mkdir $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) EOF cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules 2.6.29.6-jabberwok $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$LOCALNAME-$VERSION$TAG-$KARCH-$BUILD.${PKGTYPE:-tgz} And here's a downloadable version: http://www.dawoodfall.net/slackbuilds/13.0/kernel/kernel-jabberwok.SlackBuild = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 9dc128fc20b238bcb417cfc341fcb10304885601 387 386 2010-07-25T19:44:11Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6-i686-1_tag.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source ./.config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##" ) do mkdir -p $MODDIR/$(dirname $i) install -m 644 -v $i $MODDIR/$(dirname $i) let nummods=$nummods+1 done mkdir -p $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) EOF cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules for $LOCALNAME-$VERSION $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME ksize=$(ls -l arch/x86/boot/bzImage | awk '{print $5}') cd $PKG PACKAGE=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION-$KARCH-$BUILD-$TAG.${PKGTYPE:-tgz} /sbin/makepkg -l y -c n $PACKAGE echo -ne '\e[01;34m' printf "$nummods Modules Built\n" printf "Kernel Size: $ksize\n" printf "Package Size: $(ls -l $PACKAGE | awk '{print $5}')\n\n" echo -ne '\e[m\017' = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 25fc3974e980411e31b7e1791cea49a289e996df 388 387 2010-07-25T19:52:39Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6-i686-1_tag.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009-2010 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source ./.config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} KARCH=${ARCH:-i486} ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##" ) do mkdir -p $MODDIR/$(dirname $i) install -m 644 -v $i $MODDIR/$(dirname $i) let nummods=$nummods+1 done mkdir -p $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) EOF cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules for $LOCALNAME-$VERSION $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME ksize=$(ls -l arch/x86/boot/bzImage | awk '{print $5}') cd $PKG PACKAGE=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION-$KARCH-$BUILD-$TAG.${PKGTYPE:-tgz} /sbin/makepkg -l y -c n $PACKAGE echo -ne '\e[01;34m' printf "$nummods Modules Built\n" printf "Kernel Size: $ksize\n" printf "Package Size: $(ls -l $PACKAGE | awk '{print $5}')\n\n" echo -ne '\e[m\017' = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) ca1b0e453f41752fbead1c21f042110d98758f8c 389 388 2010-07-25T20:03:57Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] *Note2: I will be assuming x86 here, but if anyone wants to contribute some notes on x86_64 until I can get a machine setup, please do. == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6-i686-1_tag.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009-2010 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source ./.config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi KARCH=$ARCH ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##" ) do mkdir -p $MODDIR/$(dirname $i) install -m 644 -v $i $MODDIR/$(dirname $i) let nummods=$nummods+1 done mkdir -p $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) EOF cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules for $LOCALNAME-$VERSION $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME ksize=$(ls -l arch/x86/boot/bzImage | awk '{print $5}') cd $PKG PACKAGE=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION-$KARCH-$BUILD-$TAG.${PKGTYPE:-tgz} /sbin/makepkg -l y -c n $PACKAGE echo -ne '\e[01;34m' printf "$nummods Modules Built\n" printf "Kernel Size: $ksize\n" printf "Package Size: $(ls -l $PACKAGE | awk '{print $5}')\n\n" echo -ne '\e[m\017' = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 3da38731c8d102c5ac10d14868161e600c2a81fe 390 389 2010-07-25T20:07:37Z Dive 19 /* Creating a Custom Package of Kernel and Modules */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6-i686-1_tag.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009-2010 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source ./.config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi KARCH=$ARCH ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##" ) do mkdir -p $MODDIR/$(dirname $i) install -m 644 -v $i $MODDIR/$(dirname $i) let nummods=$nummods+1 done mkdir -p $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) EOF cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules for $LOCALNAME-$VERSION $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME ksize=$(ls -l arch/x86/boot/bzImage | awk '{print $5}') cd $PKG PACKAGE=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION-$KARCH-$BUILD-$TAG.${PKGTYPE:-tgz} /sbin/makepkg -l y -c n $PACKAGE echo -ne '\e[01;34m' printf "$nummods Modules Built\n" printf "Kernel Size: $ksize\n" printf "Package Size: $(ls -l $PACKAGE | awk '{print $5}')\n\n" echo -ne '\e[m\017' = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 1b23ba30f539c82c6fec8f58cefd7be72052b93c 391 390 2010-07-25T20:08:30Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(cat modules.order | sed "s#^kernel/##") do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6-i686-1_tag.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009-2010 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source ./.config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi KARCH=$ARCH ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##" ) do mkdir -p $MODDIR/$(dirname $i) install -m 644 -v $i $MODDIR/$(dirname $i) let nummods=$nummods+1 done mkdir -p $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) EOF cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules for $LOCALNAME-$VERSION $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME ksize=$(ls -l arch/x86/boot/bzImage | awk '{print $5}') cd $PKG PACKAGE=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION-$KARCH-$BUILD-$TAG.${PKGTYPE:-tgz} /sbin/makepkg -l y -c n $PACKAGE echo -ne '\e[01;34m' printf "$nummods Modules Built\n" printf "Kernel Size: $ksize\n" printf "Package Size: $(ls -l $PACKAGE | awk '{print $5}')\n\n" echo -ne '\e[m\017' Downloadable version: http://www.dawoodfall.net/slackbuilds/noversion/kernel/ = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 3815c975fba8351ca8dc0134a9d916e962be74c5 399 391 2010-08-16T22:01:10Z Dive 19 /* Installing Modules and Kernel to our Package Directory */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(sed "s#^kernel/##" modules.order) do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6-i686-1_tag.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009-2010 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source ./.config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi KARCH=$ARCH ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(cat $MODULELIST | sed "s#^kernel/##" ) do mkdir -p $MODDIR/$(dirname $i) install -m 644 -v $i $MODDIR/$(dirname $i) let nummods=$nummods+1 done mkdir -p $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) EOF cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules for $LOCALNAME-$VERSION $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME ksize=$(ls -l arch/x86/boot/bzImage | awk '{print $5}') cd $PKG PACKAGE=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION-$KARCH-$BUILD-$TAG.${PKGTYPE:-tgz} /sbin/makepkg -l y -c n $PACKAGE echo -ne '\e[01;34m' printf "$nummods Modules Built\n" printf "Kernel Size: $ksize\n" printf "Package Size: $(ls -l $PACKAGE | awk '{print $5}')\n\n" echo -ne '\e[m\017' Downloadable version: http://www.dawoodfall.net/slackbuilds/noversion/kernel/ = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 03403ba08b5ea4c609287459d86a2a645ebecb61 400 399 2010-08-16T22:04:03Z Dive 19 /* A Little Automation */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(sed "s#^kernel/##" modules.order) do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6-i686-1_tag.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009-2010 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source ./.config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi KARCH=$ARCH ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(sed "s#^kernel/##" $MODULELIST) do mkdir -p $MODDIR/$(dirname $i) install -m 644 -v $i $MODDIR/$(dirname $i) let nummods=$nummods+1 done mkdir -p $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) EOF cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules for $LOCALNAME-$VERSION $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME ksize=$(ls -l arch/x86/boot/bzImage | awk '{print $5}') cd $PKG PACKAGE=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION-$KARCH-$BUILD-$TAG.${PKGTYPE:-tgz} /sbin/makepkg -l y -c n $PACKAGE echo -ne '\e[01;34m' printf "$nummods Modules Built\n" printf "Kernel Size: $ksize\n" printf "Package Size: $(ls -l $PACKAGE | awk '{print $5}')\n\n" echo -ne '\e[m\017' Downloadable version: http://www.dawoodfall.net/slackbuilds/noversion/kernel/ = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) b0ea2d79b51652fa2b81632457e25973fa068c69 Kernel Checklist 0 101 392 123 2010-07-28T00:45:20Z Merge-delete 261 just fixed a couple of spelling typos wikitext text/x-wiki # [&radic;] Make sure the filesystem type of your root partition is compiled into the kernel. To check what your root filesystem is type "mount". # [&radic;] Check that your networking card is compiled as a module or compiled into the kernel. # [&radic;] If you are using NVIDIA video card make sure you compile the AGP as a module # [&radic;] The sound card is important for listening to music; module it, or compile it in. # [&radic;] Another important thing that people miss out is the IDE chipset. This is important because you want to enable DMA on drives, and other important speed enhancements. # [&radic;] If you are going to use a camera that requires usb mass storage compile in SCSI Generic and USB-Mass storage. # [&radic;] Compile the sysfs feature in the kernel as that is an important for /sys. It is important for the 2.6 kernel. # [&radic;] If you must have framebuffer make sure you compile it in with the appropriate things. If you get a black screen set lilo.conf to vga = normal, then mess with it later. Also for nvidia users the rivafb is broken on many cards, so do not compile it in because it effects the nvidia driver for X. So use the vesafb instead. # [&radic;] Another useful tool that i use is the .config in /proc (A must have I think) # [&radic;] ATA/ATAPI settings are also useful for people, might want to make sure your kernel has that. # [&radic;] SATA/SCSI Make SURE YOU COMPILE it into the kernel and make sure you actually compile it in. If you have a SATA or SCSI hardware. # [&radic;] Iptables modules if you are going to use iptables or make a firewall. I use modules:) # [&radic;] I always recommend that in ALSA you compile or module OSS Emulation API # [&radic;] APM or ACPI is always something you might want to enable. This is not a feature needed by the kernel but, some people might need its features. Just a reminder that the root filesystem (SCSI/SATA/etc) should be compiled into the kernel for obvious reasons. [[Category:Tips]] d0efedcf61c6df9cefb729deb09897caecee9ba9 Main Page 0 1 393 364 2010-07-28T23:12:30Z Erik 1 Updated wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 0825ec3bdcfd6cc8db77ecbd7fa92b94b1009f73 Multilib 0 228 396 2010-08-05T21:03:37Z Merge-delete 261 Link to alienBOB's multilib tutorial and a detail about not using SBo packages for display drivers. wikitext text/x-wiki There's a good tutorial (and packages) on how to set up multilib support (32-bit programs on Slackware64) at [http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:multilib AlienBOB's site]. You'd do well to go there next. ''However'', as that's not complete and clear on all points, here are some details: ==Binary display drivers== You need to reinstall binary drivers. ATI and Nvidia driver packages contain both 64bit and 32bit libraries to be maximally useful on a 64bit multilib OS. However, the slackbuild scripts available at slackbuilds.org are not up to this task, so if you already installed 64-bit binary drivers from slackbuilds.org, you should remove these and then use ATI's or Nvidia's driver installer. [[Category:Tutorials]] c1907982c750d717ec701e87c90a4923a26cebc4 NVIDIA Graphics 0 123 397 146 2010-08-06T14:47:03Z Ariarat 99 Add translation section wikitext text/x-wiki [[Category:Hardware]] = Introduction = There are three main drivers for nvidia graphics card on linux, one of which is shipped with slackware: * nv (shipped with slackware) - this provides basic 2d acceleration, not 3d * nvidia (NVidia's proprietary driver) - this is the generally recommended driver, providing good 2d and 3d performance * nouveau - an attempt to reverse-engineer the nvidia driver; not particular usable or stable This article assumes you want the 'nvidia' driver; if you do not, generic (IE not slackware-specific) documentation available. = Obtaining the driver = The driver can be found at [http://www.nvidia.com/object/unix.html]. = Installing the driver = The driver must not be installed while X is running; if X is running, stop X, install the driver, then start X again how you normally would (eg "telinit 4", or "startx"). Download the driver, then "sh FILENAME.run" in the directory you downloaded it do, replacing "FILENAME" with the name of the file you downloaded. == XOrg config == There are two options: === nvidia-xconfig === This is an automated tool, that the above installer offers to run for you. It attempts to modify your XOrg.conf automatically to use the nvidia driver. === Manual Editing === Find the section relating to your graphics card in /etc/X11/xorg.conf, and change the driver to "nvidia". If you want to change the default settings, for example, add dual-head support, see the readme installed into /usr/doc/NVIDIA_GLX-1.0/. = Checking It's Working = * Check "nvidia-settings" runs in X * Check "glxinfo | grep direct" returns "direct rendering: Yes" * Check "glxgears" gives a reasonable result (google for comparisons) Pay close attention to specific model of graphics card when checking for suitable glxgears results; keep in mind that glxgears isn't really a good 'benchmark', but should indicate if DRI is working properly or not. For example: * On an Intel X3100, a good result is somewhere around 1000 FPS * On an NVidia 7800GTX, a good result is somewhere above 12000 (though 15k is fairly normal) = Translations = Mehdi Esmaeelpour translate this article to persian - [http://www.slack-world.com/index.php/articles/43-general-system/107-nvidia-driver-installation article link] f607a51708526096f5edf1dbcbde67bbd2772f5b 398 397 2010-08-10T11:31:26Z Ariarat 99 /* Translations */ wikitext text/x-wiki [[Category:Hardware]] = Introduction = There are three main drivers for nvidia graphics card on linux, one of which is shipped with slackware: * nv (shipped with slackware) - this provides basic 2d acceleration, not 3d * nvidia (NVidia's proprietary driver) - this is the generally recommended driver, providing good 2d and 3d performance * nouveau - an attempt to reverse-engineer the nvidia driver; not particular usable or stable This article assumes you want the 'nvidia' driver; if you do not, generic (IE not slackware-specific) documentation available. = Obtaining the driver = The driver can be found at [http://www.nvidia.com/object/unix.html]. = Installing the driver = The driver must not be installed while X is running; if X is running, stop X, install the driver, then start X again how you normally would (eg "telinit 4", or "startx"). Download the driver, then "sh FILENAME.run" in the directory you downloaded it do, replacing "FILENAME" with the name of the file you downloaded. == XOrg config == There are two options: === nvidia-xconfig === This is an automated tool, that the above installer offers to run for you. It attempts to modify your XOrg.conf automatically to use the nvidia driver. === Manual Editing === Find the section relating to your graphics card in /etc/X11/xorg.conf, and change the driver to "nvidia". If you want to change the default settings, for example, add dual-head support, see the readme installed into /usr/doc/NVIDIA_GLX-1.0/. = Checking It's Working = * Check "nvidia-settings" runs in X * Check "glxinfo | grep direct" returns "direct rendering: Yes" * Check "glxgears" gives a reasonable result (google for comparisons) Pay close attention to specific model of graphics card when checking for suitable glxgears results; keep in mind that glxgears isn't really a good 'benchmark', but should indicate if DRI is working properly or not. For example: * On an Intel X3100, a good result is somewhere around 1000 FPS * On an NVidia 7800GTX, a good result is somewhere above 12000 (though 15k is fairly normal) = Translations = Mehdi Esmaeelpour translated this article to persian - [http://www.slack-world.com/index.php/articles/43-general-system/107-nvidia-driver-installation article link] f4be427d89c06ab03f6212a7d14314e9ca1524ff Talk:Editors 1 229 401 2010-08-21T13:54:51Z Dengel 134 mc wikitext text/x-wiki Midnight Commander includes mcedit. 0a169821fbe8907192e6cf48abc6bef4c56466bd SlackWiki:Community Portal 4 226 402 371 2010-08-21T20:32:16Z Sombriks 109 /* GUS-BR */ wikitext text/x-wiki ====[http://www.slackwarebrasil.org GUS-BR]==== Brazilian Slackware User Group (Grupo de Usuários Slackware Brasil)<BR> [http://www.slackwarebrasil.org www.slackwarebrasil.org ] pt-br Wiki [http://wiki.slackwarebrasil.org/ wiki.slackwarebrasil.org] <BR> ====[http://slacky.eu/ Slacky.eu]==== The Italian Slackware Community<BR> [http://slacky.eu/ http://slacky.eu] <BR> ====[http://slackware.linux.or.id Indonesian Slackware Community]==== [http://slackware.linux.or.id http://slackware.linux.or.id] f6372a2df06dff6784982ed5a3769a8f3df3f0b6 403 402 2010-08-21T20:32:48Z Sombriks 109 wikitext text/x-wiki ====[http://www.slackwarebrasil.org GUS-BR]==== Brazilian Slackware User Group (Grupo de Usuários Slackware Brasil)<BR> [http://www.slackwarebrasil.org www.slackwarebrasil.org ] pt-br Wiki [http://wiki.slackwarebrasil.org/ wiki.slackwarebrasil.org] <BR> ====[http://slacky.eu/ Slacky.eu]==== The Italian Slackware Community<BR> [http://slacky.eu/ http://slacky.eu] <BR> ====[http://slackware.linux.or.id Indonesian Slackware Community]==== [http://slackware.linux.or.id http://slackware.linux.or.id] ef4e5ae96ab304db049544f4a1e880bb1cdb1b9a 404 403 2010-08-23T09:08:28Z Ariarat 99 wikitext text/x-wiki ====[http://www.slackwarebrasil.org GUS-BR]==== Brazilian Slackware User Group (Grupo de Usuários Slackware Brasil)<BR> [http://www.slackwarebrasil.org www.slackwarebrasil.org ] pt-br Wiki [http://wiki.slackwarebrasil.org/ wiki.slackwarebrasil.org] <BR> ====[http://slacky.eu/ Slacky.eu]==== The Italian Slackware Community<BR> [http://slacky.eu/ http://slacky.eu] <BR> ====[http://slackware.linux.or.id Indonesian Slackware Community]==== [http://slackware.linux.or.id http://slackware.linux.or.id] <BR> ====[http://www.slack-world.com Iranian Slackware Community]==== [http://www.slack-world.com http://www.slack-world.com] 1008c600713017e25327dd3edb510660a8d99d96 405 404 2010-08-23T09:10:05Z Ariarat 99 wikitext text/x-wiki ====[http://www.slackwarebrasil.org GUS-BR]==== Brazilian Slackware User Group (Grupo de Usuários Slackware Brasil)<BR> [http://www.slackwarebrasil.org www.slackwarebrasil.org ] pt-br Wiki [http://wiki.slackwarebrasil.org/ wiki.slackwarebrasil.org] <BR> ====[http://slacky.eu/ Slacky.eu]==== The Italian Slackware Community<BR> [http://slacky.eu/ http://slacky.eu] <BR> ====[http://slackware.linux.or.id Indonesian Slackware Community]==== [http://slackware.linux.or.id http://slackware.linux.or.id] <BR> ====[http://www.slack-world.com Iranian's Slackers World]==== Iranian Slackware Cummunity [http://www.slack-world.com http://www.slack-world.com] fdda82e042397688066ecbf63a18744d15592d99 406 405 2010-08-23T09:10:45Z Ariarat 99 wikitext text/x-wiki ====[http://www.slackwarebrasil.org GUS-BR]==== Brazilian Slackware User Group (Grupo de Usuários Slackware Brasil)<BR> [http://www.slackwarebrasil.org www.slackwarebrasil.org ] pt-br Wiki [http://wiki.slackwarebrasil.org/ wiki.slackwarebrasil.org] <BR> ====[http://slacky.eu/ Slacky.eu]==== The Italian Slackware Community<BR> [http://slacky.eu/ http://slacky.eu] <BR> ====[http://slackware.linux.or.id Indonesian Slackware Community]==== [http://slackware.linux.or.id http://slackware.linux.or.id] <BR> ====[http://www.slack-world.com Iranian's Slackers World]==== Iranian Slackware Community [http://www.slack-world.com http://www.slack-world.com] 2edc3acf820fdf4a906231a353a762ec8118d120 410 406 2010-09-15T21:03:41Z Unixfool 141 added ##slackware info wikitext text/x-wiki ====[http://www.slackwarebrasil.org GUS-BR]==== Brazilian Slackware User Group (Grupo de Usuários Slackware Brasil)<BR> [http://www.slackwarebrasil.org www.slackwarebrasil.org ] pt-br Wiki [http://wiki.slackwarebrasil.org/ wiki.slackwarebrasil.org] <BR> ====[http://slacky.eu/ Slacky.eu]==== The Italian Slackware Community<BR> [http://slacky.eu/ http://slacky.eu] <BR> ====[http://slackware.linux.or.id Indonesian Slackware Community]==== [http://slackware.linux.or.id http://slackware.linux.or.id] <BR> ====[http://www.slack-world.com Iranian's Slackers World]==== Iranian Slackware Community [http://www.slack-world.com http://www.slack-world.com] <BR> ====##slackware, irc.freenode.net==== Channel site [http://freenodeslack.blogspot.com/] Channel logs [http://wigglit.ath.cx/slackware_botlogs/] Channel stats [http://wigglit.ath.cx/slackware_stats2/] d8d56d257b1c6fafa455b9f7aa8727fea1dd0ed0 411 410 2010-09-15T21:04:54Z Unixfool 141 wikitext text/x-wiki ====[http://www.slackwarebrasil.org GUS-BR]==== Brazilian Slackware User Group (Grupo de Usuários Slackware Brasil)<BR> [http://www.slackwarebrasil.org www.slackwarebrasil.org ] pt-br Wiki [http://wiki.slackwarebrasil.org/ wiki.slackwarebrasil.org] <BR> ====[http://slacky.eu/ Slacky.eu]==== The Italian Slackware Community<BR> [http://slacky.eu/ http://slacky.eu] <BR> ====[http://slackware.linux.or.id Indonesian Slackware Community]==== [http://slackware.linux.or.id http://slackware.linux.or.id] <BR> ====[http://www.slack-world.com Iranian's Slackers World]==== Iranian Slackware Community [http://www.slack-world.com http://www.slack-world.com] <BR> ====##slackware, irc.freenode.net==== [Channel site http://freenodeslack.blogspot.com/] [Channel logs http://wigglit.ath.cx/slackware_botlogs/] [Channel stats http://wigglit.ath.cx/slackware_stats2/] 7dfced39ba003752053be1de6d6e1f6f1b6cffba 412 411 2010-09-15T21:06:02Z Unixfool 141 /* ##slackware, irc.freenode.net */ wikitext text/x-wiki ====[http://www.slackwarebrasil.org GUS-BR]==== Brazilian Slackware User Group (Grupo de Usuários Slackware Brasil)<BR> [http://www.slackwarebrasil.org www.slackwarebrasil.org ] pt-br Wiki [http://wiki.slackwarebrasil.org/ wiki.slackwarebrasil.org] <BR> ====[http://slacky.eu/ Slacky.eu]==== The Italian Slackware Community<BR> [http://slacky.eu/ http://slacky.eu] <BR> ====[http://slackware.linux.or.id Indonesian Slackware Community]==== [http://slackware.linux.or.id http://slackware.linux.or.id] <BR> ====[http://www.slack-world.com Iranian's Slackers World]==== Iranian Slackware Community [http://www.slack-world.com http://www.slack-world.com] <BR> ====##slackware, irc.freenode.net==== [http://freenodeslack.blogspot.com/ Channel site] [http://wigglit.ath.cx/slackware_botlogs/Channel logs] [http://wigglit.ath.cx/slackware_stats2/ Channel stats] d1e133776882a0f968e0bc9fa15dce4584535538 413 412 2010-09-17T13:48:43Z Unixfool 141 /* ##slackware, irc.freenode.net */ wikitext text/x-wiki ====[http://www.slackwarebrasil.org GUS-BR]==== Brazilian Slackware User Group (Grupo de Usuários Slackware Brasil)<BR> [http://www.slackwarebrasil.org www.slackwarebrasil.org ] pt-br Wiki [http://wiki.slackwarebrasil.org/ wiki.slackwarebrasil.org] <BR> ====[http://slacky.eu/ Slacky.eu]==== The Italian Slackware Community<BR> [http://slacky.eu/ http://slacky.eu] <BR> ====[http://slackware.linux.or.id Indonesian Slackware Community]==== [http://slackware.linux.or.id http://slackware.linux.or.id] <BR> ====[http://www.slack-world.com Iranian's Slackers World]==== Iranian Slackware Community [http://www.slack-world.com http://www.slack-world.com] <BR> ====##slackware, irc.freenode.net==== [http://freenodeslack.blogspot.com/ Channel site] [http://wigglit.ath.cx/slackware_botlogs/ Channel logs] [http://wigglit.ath.cx/slackware_stats2/ Channel stats] 30b794518e4a693baa683d07aaf14297c822d9c7 Links 0 3 407 242 2010-08-23T09:17:19Z Ariarat 99 /* Slackware Links */ wikitext text/x-wiki [[Category:Information]] ==Slackware Links== * http://www.slackware.com - the home of Slackware * http://www.slackwaregallery.org - our ugly mugs :) * http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ - Slackware FAQ by [[User:juhl|juhl]] (Jesper Juhl) * http://slackware.wordpress.com - Slackware Blog by [[User:Tyler|Tyler]] * http://www.slackbook.org - updated version of the slackware book * http://userlocal.com/ - A focal point for the online Slackware Linux community * http://www.slackware.com/getslack - Extensive listing of Slackware mirrors * http://www.slackbasics.org/ - "Slackware Linux Basics" by Daniel de Kok * http://www.linuxquestions.org/questions/slackware-14/ - Slackware forum * http://www.kde-look.org/content/show.php?content=23384 - Slack-Track - a superkaramba theme to track the slackware-current changelog on your desktop, created by [[User:omal|omal]] * http://www.slacklife.com.br - Slackware Brazillian Community - by [[User:Redhate|redhate]] * http://slackware.linux.or.id - Indonesian Slackware Community - by [[User:Willysr|Willysr]] * http://open-eslack.org/ - Spanish Slackware community * http://jtgzmanager.sf.net/ - A new frontend to pkgtools built with Qt4 C++ libs - by Alexandre Arnt * http://sbopkg.org - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository * http://slackbot.sourceforge.net - Buildsystem and buildtools for Slackware * http://www.slack-world.com - Iranian Slackware Community ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==Free packages== * [http://slackware.com/~alien/ http://slackware.com/~alien/] Eric Hameleers' packages * [http://rlworkman.net/pkgs/ http://rlworkman.net/pkgs/] rworkman's packages * http://www.linuxpackages.net/ * [http://www.slacky.eu/repository/slackware-11.0/ Slacky.eu] Italian Slackware site * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware * [http://scxd.info/en/ Slackware Current eXtended Desktop] Packages for Slackware Current ==.SlackBuild Repositories== * http://slackbuilds.org - The SlackBuilds.org Project * http://slackbuilds.net - The French SlackBuilds Repository * http://www.slackware.com/~alien/slackbuilds/ - Eric "Alien" Hameleer's SlackBuilds * http://slackbuild.strangeworlds.co.uk - cathectic's SlackBuilds * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. * http://scxd.info/pub/slackbuilds/ - Slackware Current eXtended Desktop's SlackBuilds ==Live CD's based on Slackware== * [http://www.remote-exploit.org/ BackTrack] The result of the merging of two Innovative Penetration Testing live Linux distributions: Whax and Auditor * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://alien.slackbook.org/ Alien Bob's Wiki] * http://open-eslack.org/wiki/ - Wiki of the Slackware spanish community * http://slackware.linux.or.id/wiki/ - Indonesian Slackware Wiki ==RSS Feeds== * http://dev.slackware.it/rss/ - RSS feeds for stable Slackware release and -current ChangeLog * http://slackbuilds.org/mirror/rss/ - ChangeLog RSS feeds for 8.1 through -current d252021f8fceddcf34eb340fcd91fea9c1f86bed 417 407 2010-10-05T17:39:11Z Rworkman 13 Removed some dead and unmaintained links and a bit of reorg wikitext text/x-wiki [[Category:Information]] ==Slackware Links== * http://www.slackware.com - the home of Slackware * http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ - Slackware FAQ by [[User:juhl|juhl]] (Jesper Juhl) * http://www.slackbook.org - updated version of the slackware book * http://www.slackware.com/getslack - Extensive listing of Slackware mirrors * http://www.linuxquestions.org/questions/slackware-14/ - Slackware forum * http://slackbuilds.org/ - Build scripts for additional software * http://sbopkg.org - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository * http://www.kde-look.org/content/show.php?content=23384 - Slack-Track - a superkaramba theme to track the slackware-current changelog on your desktop, created by [[User:omal|omal]] * http://jtgzmanager.sf.net/ - A new frontend to pkgtools built with Qt4 C++ libs - by Alexandre Arnt * http://slackbot.sourceforge.net - Buildsystem and buildtools for Slackware * http://slackware.linux.or.id - Indonesian Slackware Community - by [[User:Willysr|Willysr]] * http://open-eslack.org/ - Spanish Slackware community * http://www.slack-world.com - Iranian Slackware Community ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==Free packages== * [http://slackware.com/~alien/ http://slackware.com/~alien/] Eric Hameleers' packages * [http://rlworkman.net/pkgs/ http://rlworkman.net/pkgs/] rworkman's packages * http://www.linuxpackages.net/ * [http://www.slacky.eu/repository/slackware-11.0/ Slacky.eu] Italian Slackware site * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware * [http://scxd.info/en/ Slackware Current eXtended Desktop] Packages for Slackware Current ==.SlackBuild Repositories== * http://slackbuilds.org - The SlackBuilds.org Project * http://slackbuilds.net - The French SlackBuilds Repository * http://www.slackware.com/~alien/slackbuilds/ - Eric "Alien" Hameleer's SlackBuilds * http://slackbuild.strangeworlds.co.uk - cathectic's SlackBuilds * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. * http://scxd.info/pub/slackbuilds/ - Slackware Current eXtended Desktop's SlackBuilds ==Live CD's based on Slackware== * [http://www.remote-exploit.org/ BackTrack] The result of the merging of two Innovative Penetration Testing live Linux distributions: Whax and Auditor * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://alien.slackbook.org/ Alien Bob's Wiki] * http://open-eslack.org/wiki/ - Wiki of the Slackware spanish community * http://slackware.linux.or.id/wiki/ - Indonesian Slackware Wiki ==RSS Feeds== * http://dev.slackware.it/rss/ - RSS feeds for stable Slackware release and -current ChangeLog * http://slackbuilds.org/mirror/rss/ - ChangeLog RSS feeds for 8.1 through -current 5383bb1f7dfe6d0a453676e1d2ce15822cb21021 418 417 2010-10-05T17:40:36Z Rworkman 13 Removed backtrack from the list wikitext text/x-wiki [[Category:Information]] ==Slackware Links== * http://www.slackware.com - the home of Slackware * http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ - Slackware FAQ by [[User:juhl|juhl]] (Jesper Juhl) * http://www.slackbook.org - updated version of the slackware book * http://www.slackware.com/getslack - Extensive listing of Slackware mirrors * http://www.linuxquestions.org/questions/slackware-14/ - Slackware forum * http://slackbuilds.org/ - Build scripts for additional software * http://sbopkg.org - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository * http://www.kde-look.org/content/show.php?content=23384 - Slack-Track - a superkaramba theme to track the slackware-current changelog on your desktop, created by [[User:omal|omal]] * http://jtgzmanager.sf.net/ - A new frontend to pkgtools built with Qt4 C++ libs - by Alexandre Arnt * http://slackbot.sourceforge.net - Buildsystem and buildtools for Slackware * http://slackware.linux.or.id - Indonesian Slackware Community - by [[User:Willysr|Willysr]] * http://open-eslack.org/ - Spanish Slackware community * http://www.slack-world.com - Iranian Slackware Community ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==Free packages== * [http://slackware.com/~alien/ http://slackware.com/~alien/] Eric Hameleers' packages * [http://rlworkman.net/pkgs/ http://rlworkman.net/pkgs/] rworkman's packages * http://www.linuxpackages.net/ * [http://www.slacky.eu/repository/slackware-11.0/ Slacky.eu] Italian Slackware site * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware * [http://scxd.info/en/ Slackware Current eXtended Desktop] Packages for Slackware Current ==.SlackBuild Repositories== * http://slackbuilds.org - The SlackBuilds.org Project * http://slackbuilds.net - The French SlackBuilds Repository * http://www.slackware.com/~alien/slackbuilds/ - Eric "Alien" Hameleer's SlackBuilds * http://slackbuild.strangeworlds.co.uk - cathectic's SlackBuilds * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. * http://scxd.info/pub/slackbuilds/ - Slackware Current eXtended Desktop's SlackBuilds ==Live CD's based on Slackware== * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://alien.slackbook.org/ Alien Bob's Wiki] * http://open-eslack.org/wiki/ - Wiki of the Slackware spanish community * http://slackware.linux.or.id/wiki/ - Indonesian Slackware Wiki ==RSS Feeds== * http://dev.slackware.it/rss/ - RSS feeds for stable Slackware release and -current ChangeLog * http://slackbuilds.org/mirror/rss/ - ChangeLog RSS feeds for 8.1 through -current 1855b6041c051c8452e4a01fa0e409e7f237bc15 User:Unixfool 2 230 408 2010-09-09T19:08:09Z Unixfool 141 added URLs wikitext text/x-wiki http://slackfiles.blogspot.com/ <br> http://freenodeslack.blogspot.com/ <br> http://wigglit.ath.cx/ <br> http://www.unixfool.com/ <br> c6c68f3e4cfb7c57ea08ead7cf6b78616c613f56 Security Assessment using Nmap 0 148 414 176 2010-09-23T19:38:10Z Unixfool 141 slight edits made wikitext text/x-wiki [[Category:Tutorials]] This tutorial will be a general guide on how to determine what ports have listening services and how to assess if those ports are available to the world wide web. We will be using Nmap, netstat, and telnet. We are concerned with three different things: 1. Assessing localhost (127.0.0.1) on a given machine. 2. Assessing the machine's IP from another machine within the LAN. 3. Assessing the machine from the internet. Running Nmap against localhost can be deceiving, as the ports that are listening on the machine may not actually be available to another machine, on or off the LAN. Note that 127.0.0.1 only pertains to the local machine. This is the loopback address that every machine uses to communicate to itself. I'll compare a localhost scan against a scan that was conducted from another machine on the LAN. I'll scan localhost first: -su-2.05b# nmap localhost Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2007-09-12 17:20 EDT Interesting ports on localhost.home (127.0.0.1): Not shown: 1674 closed ports PORT STATE SERVICE 22/tcp open ssh 25/tcp open smtp 3306/tcp open mysql 5801/tcp open vnc-http-1 5901/tcp open vnc-1 6001/tcp open X11:1 Nmap finished: 1 IP address (1 host up) scanned in 10.662 seconds Now, I'll scan the machine's IP from another machine: root@slackbox:~# nmap 10.150.1.103 Starting Nmap 4.20 ( http://insecure.org ) at 2007-09-12 17:36 EDT Interesting ports on delly (10.150.1.103): Not shown: 1693 filtered ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 3306/tcp open mysql 5900/tcp closed vnc MAC Address: 00:C0:4F:61:28:1F (Dell Computer) Nmap finished: 1 IP address (1 host up) scanned in 22.277 seconds Comparing the two scans, some things are readily apparent: port 25/tcp and 5801/tcp, 5901/tcp, and 6001/tcp aren't as exposed as the other services are. Also, note that certain ports are possibly bound to the IP but not the loopback. The more important aspect of these two scans is the services listening on a non-loopback address, because services use IPs to communicate to other machines, not loopback devices. So, TCP ports 25, 5801, 5901, and 6001 appear to be open. We can test this. Remember, we're concerned about whether these ports can be seen as open to the internet. We'll test this by using telnet. Below, I'm logged into another machine and attempting to telnet on port 25 to the machine we Nmap'd on localhost: root@slackbox:~# telnet 10.150.1.103 25 Trying 10.150.1.103... telnet: connect to address 10.150.1.103: Connection timed out The connection timed out. This is proof this service isn't exposed beyond the local machine. It is proof that this machine doesn't have SMTP services linked to the network interface that is assigned the IP of 10.150.1.103. We can also test by running 'netstat -an' on the machine. While netstat doesn't connect to the port in question, it does indicate what interface services are using: -su-2.05b# netstat -an | grep -i listen tcp4 0 0 *.5801 *.* LISTEN tcp4 0 0 *.5901 *.* LISTEN tcp4 0 0 *.6001 *.* LISTEN tcp4 0 0 *.3306 *.* LISTEN tcp4 0 0 10.150.1.103.8118 *.* LISTEN tcp4 0 0 10.150.1.103.80 *.* LISTEN tcp4 0 0 127.0.0.1.25 *.* LISTEN tcp4 0 0 *.22 *.* LISTEN tcp6 0 0 *.22 *.* LISTEN See port 25? What IP address is assigned to the service? Loopback! This means that this service isn't exposed to any other machine on the LAN or internet. It is a local service (local only internally to the operating system). The other services are listening (for example, *.22) but the '*' usually means that the service is assigned to an interface (which may have a number of IPs assigned to it). Ports 80 and 8118 have an IP assigned to the service, instead of '*'. This means that only IP 10.150.1.103 is assigned to that interface. Ports 80 and 8118 also do not show up when scanning localhost, but yet I can telnet to port 80 and 8118 when using the telnet command (and also browser), using 'telnet localhost 80' or 'telnet localhost 8118'. Port 80 is a web server. Port 8118 is a Privoxy proxy. The reason is probably because my PF install on that machine filters some loopback traffic. If I scan the IP of the machine, port 80 is then detected. The reason is because PF is configured to allow port 80 traffic to/from 'slackbox' from/to 10.150.1.103. What's curious is the fact that the VNC ports (5801, 5901) are showing as assigned to an interface, but not 127.0.0.1 and they aren't reachable from the outside of the machine (so sayeth nmap). They may well be assigned to the 'lo' interface or iptables/pf may be filtering this traffic...this is worth checking out at a later time. All of this is very elaborate. Everything has to be taken into consideration: what the firewall does/doesn't allow; what services run on 127.0.0.x; what services run on interfaces; what services run on IP addresses. The last thing we'll do is scan the LAN from the internet. The results will be determined by what ports the gateway router/firewall are forwarding to machines within the LAN. For example, I know I've port 22/tcp open to the world because I've told my gateway firewall to forward any traffic on 22/tcp to 10.150.1.103. I also don't allow much else and also allow some traffic to be forwarded to different machines within the LAN. So, when a scan is being conducted from the outside, the whole LAN's security posture is taken into account. Now, let us scan from the internet: Starting nmap V. 3.00 ( www.insecure.org/nmap/ ) Interesting ports on pool-xx-xxx-xx-xx.washdc.fios.verizon.net xx.xxx.xx.xxx): (The 1599 ports scanned but not shown below are in state: filtered) Port State Service 22/tcp open ssh 3306/tcp open mysql NICE! Of all the scans we've conducted thus far, this is the one that is most important. The other scans paint the smaller picture, but this one puts it all together and is THE security assessment that one wants to conduct. So, you can see, ports 22 and 3306 are open to the world. This could be two different machines that need those ports open to the internet, or this could be one machine that has those two ports open to the world wide web. While I can reach those ports, my firewall is configured to allow communication from the machine I scanned from. If a machine, from Google.com or any other IP/domain that is not accounted for within the FW policy, attempted the same thing, those ports wouldn't show as opened, as the firewall would drop the traffic. So, while the two ports appear to be open to the world in the above results, they actually aren't, as the traffic is being filtered. I hope all of this has helped some in understanding security and how to assess your LAN gateway and hosts within the LAN. We've used Nmap, telnet, and netstat to determine the security posture of a given machine. There are other tools that I didn't mention for brevity, (such as socklist, tcpdump, snort, for example) but Unix and Linux machines offer much in the way of testing security of a machine. ''This tutorial is mirrored [http://slackfiles.blogspot.com/2007/09/assessment-of-hardened-box.html here]'' --[[User:Unixfool|Ron]] 00:44, 16 September 2007 (EDT) 357f961281b7ccfb669b53ec503fc7ae6190645e Utf-8 linux console 0 177 415 365 2010-09-27T10:20:05Z Dive 19 /* Keyboard */ wikitext text/x-wiki [[Category:Tutorials]] ''by Dive'' == A Quick Look at Using UTF-8 in the Linux Console (without X) == A few people have asked about this in #slackware lately so I though I'd put down a few notes on how I got utf-8 up and running. Feel free to add any further info. In these days of high powered X desktop environments with all their flashy composite bells and whistles it may seem strange to worry about how the plain Linux console behaves, but we need to remember that there are some very nice applications that live in the console and can be just as (or even more) productive than the X Windows counterparts. I'm thinking of screen, irssi, mutt, elinks, vim/vi, mplayer (using svga), links, zgv and slrn to name but a few. And of course we have to mention Slackware tools like pgktool, slackpkg and sbopkg. Once you get hooked on using the console it is hard to go back. Anyway here we go ... == The Console == The first thing to do is configure the console. There is a kernel parameter we can add to /etc/lilo.conf to do this: append="vt.default_utf8=1" Here's an example from mine: # Linux bootable partition config begins image = /boot/vmlinuz-2.6.27.7-custom root = /dev/hda1 label = Linux-custom append="resume=/dev/hda2 vt.default_utf8=1" read-only # Linux bootable partition config ends Once you have saved lilo.conf and run '''lilo''' a quick reboot is needed. == LANG environment variable == I find that typing multibyte characters like "ä" and erasing them with backspace, I can erase much more than what I wrote. It helps to set the LANG variable, preferably by editing /etc/profile.d/lang.sh (or lang.csh) to set it to en_US.UTF-8 or similar. == Fonts == After that we need to find a font that actually contains the characters you want to see. My 'font of the moment' is lat9w-16. This contains the British £ (pound) and € (euro) symbols that I need, plus a lot of useful accented characters. But what is just as important are the correct drawing characters so that curses programs like pkgtool and sbopkg are printed on the screen correctly. If you experiment with the '''setconsolefont''' command you will find that some fonts draw curses box borders as squares or question marks, so check out some fonts and see which ones work and which don't. The '''setconsolefont''' command will put your chosen font into /etc/rc.d/rc.font so it will load at bootup. == Keyboard == Ok, great you can now read characters correctly, but you need the correct keymap to be able to type them. That's a little harder. If you can find a utf-8 keymap for your locale/hardware then that's fine. Personally I didn't find any of the installed keymaps suitable so I looked around for an alternative. I found a uk-utf8 keymap on the intertubes, but this was unfortunately missing all the Ctrl+[a-z] keys so I edited it and added my own. I also added some AltGr+[a-z] (well not all of those) for accented characters. You may find this keymap useful as a starting point to create your own if you cannot find a more suitable one. Have a look through the comments and the codes and you should pick up the method. To add your own combinations you will need to know the correct codes for the characters you need. You can find a table of utf-8 characters here: [http://home.tiscali.nl/t876506/utf8tbl.html]http://home.tiscali.nl/t876506/utf8tbl.html Look up the code in that table and convert it to hex. E.G. è is 232 in decimal, E8 in hex; é is code 233 in decimal, E9 in hex, so the entry in your keymap should be: # key = normal shifted AltGr+e AltGr+shift+e keycode 18 = e E U+00E8 U+00E9 # prints: e E è é You can find the keycodes with the '''showkey''' program. Once edited you can load the map with the '''loadkeys''' program. Loadkeys will update /etc/rc.d/rc.keymap but you will need to copy the keymap to /usr/share/kbd/keymaps/i386/qwerty/ so it is found on bootup. Here is a link to my updated uk-utf8 map: [http://www.unrealize.co.uk/source/uk-utf.map.gz]http://www.unrealize.co.uk/source/uk-utf.map.gz You can load this ungzipped but it's better to gzip it back after editing to keep things consistent. == Conclusion == By now you should have a fully usable keyboard/console correctly printing unicode characters. You will probably need to tell some programs like mutt and irrsi that you are using a utf-8 system. Note: There exists two shell scripts - '''unicode_start''' and '''unicode_stop'''. Typing '''unicode_start [font]''' will load the required font and set up keyboard correctly for unicode input. Bye for now, [[User:Dive|Dive]] 02:33, 20 March 2009 (UTC) 7fe3881f5bb547a3a55729d6ecb0f75fa6b318a3 User:Dive 2 232 416 2010-10-04T14:36:47Z Dive 19 Created page with 'Homepage: http://dawoodfall.net Email: dave@dawoodfall.net' wikitext text/x-wiki Homepage: http://dawoodfall.net Email: dave@dawoodfall.net f715beff7072fa6e9a5bc5b0aa2fa6abb950e250 Basic Security Fixes 0 69 419 90 2010-10-05T17:43:04Z Rworkman 13 s/too/to/ wikitext text/x-wiki Small tips to increase the security of your Slackware box: * Use strong passwords! The most common way Linux systems get hacked is through weak user passwords and SSH. * Use a firewall! [http://www.freshmeat.net Freshmeat.net] has lots of automatic tools to help with configuration, and we have some example scripts posted [[Iptables_Scripts|here]]. * Tell X not to listen for TCP connections: ** KDM: Add "ServerArgsLocal=-nolisten tcp" under section [X-:*-Core] to /opt/kde/share/config/kdm/kdmrc ** XDM: Add "-nolisten tcp" to the line calling X in /etc/X11/xdm/Xservers. ** Console: Use 'startx -- -nolisten tcp' rather than 'startx', possibly with the aid of an alias. ***: You can also edit startx and, at line 168 (where it calls xinit), append '-nolisten tcp' at the end, but this is a dirty hack. * Close any services you do not require, especially since most run as root. Think about what you will use them for. For instance, would you really want to run an sshd 24/7 when you will only perhaps access it remotely once in a blue moon, of which you will most likely know about in advance at which point you can run the required deamon prior to accessing remotely. ** To disable startup services in /etc/rc.d, unset the executable bit of the rc script. You can still start and stop services by executing the rc script later using 'sh'. ** You can also edit /etc/rc.d/rc.M directly and comment out lines that calls the other rc scripts. * Disable the "time" service, by commenting out lines 22 and 23 in /etc/inetd.conf - you will need to restart inetd after making the changes. (If you need to run inetd at all!) * Look for any services/daemons that you don't know about by running "netstat -luntp". * Run 'ps -e u' several times and become familiar with your usual processes to establish a "baseline". Then keep monitoring regularly to spot when something doesn't seem right. * If you suspect intrusion or have suspicious files, scan your system for rootkits with 'chkrootkit'. You can also scan for win32 "malware" with 'clamav' for instance if you're using your system as a mail/ftp server. * Add the following line to hosts.deny to disallow access by any host to your system... 'ALL: ALL' - note that this only affects services built with libwrap (tcpwrappers), but it's one layer of security. A further layer would be to add the following to /etc/hosts.allow... 'ALL: ALL: DENY' * Fine tune logrotate by editing /etc/logrotate.conf and add more log rotations in /etc/logrotate.d/ * If you want to restrict who is able to use the su command to switch to certain users, you can use /etc/suauth. The basic format for /etc/suauth is "to-id:from-id:ACTION" :Example: root:foobar:DENY :would stop the user foobar from using su to become root. :Another example: root:ALL EXCEPT GROUP wheel:DENY :would only allow users in the wheel group to su to root. :You can also allow users to su with no password required (why you would do this is beyond me), and can require that a user enter their OWN password before switching users. For more information, please consult the man page for /etc/suauth. :(Thanks to cubicool for informing me of the existence of /etc/suauth) :A similar, though perhaps not as fine-grained, way to control who can use su is to change ownership and permissions of /bin/su. First, add the user(s) that you want to be able to use su to the wheel group in /etc/passwd. Next, change the ownership of /bin/su to group wheel, and change its permissions to 4750. chown root:wheel /bin/su chmod 4750 /bin/su :This makes /bin/su executable *only* by members of the wheel group. * Another way to restrict the users who can become root is to edit the file /etc/login.defs and change the value of SU_WHEEL_ONLY to yes. [[Category:Tips]] [[Category:Security]] 17b4b389942c492b4322ef282a428fd47de6ad56 ALSA 0 35 420 56 2010-10-06T14:18:08Z Rworkman 13 Modernization wikitext text/x-wiki [[Category:Tutorials]] Sound problems *should* be rare these days, and of the ones that still exist, they are likely related to suspend/resume. Those are driver issues which are largely out of your control, but see the documentation with the pm-utils package for details on handling those issues. : <code>alsaconf</code> used to be needed to set up sound cards in linux, but even that shouldn't be needed in recent linux distributions - everything should be handled automatically. : <code>alsamixer</code> can be used to change the volume. : <code>alsactl store</code> is used to save the volume settings. : <code>alsactl restore</code> is used to restore the volume settings. This is automatically run on boot, so you usually won't need to run this command. There is one tip for the Sound Baster 5.1 cards: sometimes you want to MUTE digital out so you can hear on all the speakers; in alsamixer, you just press M on the <tt>Analog/Digital Output Jack</tt> item. ccf2823bf01fa3c8f6a7ea8413679d96cbcfe20c Install Slackware Using A USB Flash Drive 0 233 421 2010-11-17T23:42:42Z Sahko 43 Created page with '[[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official insta…' wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image doesnt work for you out of the box. Additionally AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document will demonstrate yet another way of doing this, which from my experience is easier and often more convenient than all of the above. This document will describe how to create a Hybrid Slackware ISO with [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == Syslinux >=3.72 is required Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror. or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even one the tree of the -current Slackware development cycle. If you choose to go with b) you should be able to create your own ISO images using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script] Pat's [http://slackware.osuosl.org/slackware/isolinux/README_SPLIT.TXT split to 3 CDs script] AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == Now all that is left to do is copy the ISO to the USB flash drive. That can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive. <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS. dd expects the name of the device, not the partition, so you should should eg. /dev/sdb and not /dev/sdb1. 2fd8fa10ff6e718b2c9310a65000050e5fd8bc04 422 421 2010-11-17T23:45:26Z Sahko 43 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image doesnt work for you out of the box. Additionally AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document will demonstrate yet another way of doing this, which from my experience is easier and often more convenient than all of the above. This document will describe how to create a Hybrid Slackware ISO with [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == Syslinux >=3.72 is required Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror. or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even one the tree of the -current Slackware development cycle. If you choose to go with b) you should be able to create your own ISO images using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script] Pat's [http://slackware.osuosl.org/slackware/isolinux/README_SPLIT.TXT split to 3 CDs script] AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == Now all that is left to do is copy the ISO to the USB flash drive. That can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive. <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS. dd expects the name of the device, not the partition, so you should should eg. /dev/sdb and not /dev/sdb1. Boot the computer using the USB drive. Experience should be no different than using the official installation media. 3ac08777daa5639800a7aa9fc538087b83d410c3 423 422 2010-11-17T23:46:56Z Sahko 43 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image doesnt work for you out of the box. Additionally AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document will demonstrate yet another way of doing this, which from my experience is easier and often more convenient than all of the above. This document will describe how to create a Hybrid Slackware ISO with [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == Syslinux >=3.72 is required Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror. or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even one the tree of the -current Slackware development cycle. If you choose to go with b) you should be able to create your own ISO images using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script] Pat's [http://slackware.osuosl.org/slackware/isolinux/README_SPLIT.TXT split to 3 CDs script] AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == Now all that is left to do is copy the ISO to the USB flash drive. That can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive. <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS. dd expects the name of the device, not the partition, so you should should eg. /dev/sdb and not /dev/sdb1. == Epilogue == Boot the computer using the USB drive. Experience should be no different than using the official installation media. 2a791a6b853031e7f285e00fa5c4a28cd15f1303 424 423 2010-11-17T23:47:51Z Sahko 43 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image doesnt work for you out of the box. Additionally AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document will demonstrate yet another way of doing this, which from my experience is easier and often more convenient than all of the above. This document will describe how to create a Hybrid Slackware ISO with [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == Syslinux >=3.72 is required Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror. or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even one the tree of the -current Slackware development cycle. If you choose to go with b) you should be able to create your own ISO images using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script] Pat's [http://slackware.osuosl.org/slackware/isolinux/README_SPLIT.TXT split to 3 CDs script] AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == Now all that is left to do is copy the ISO to the USB flash drive. That can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive. <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS. dd expects the name of the device, not the partition, so you should use eg. /dev/sdb and not /dev/sdb1. == Epilogue == Boot the computer using the USB drive. Experience should be no different than using the official installation media. b9e3eb8d880da8212c2efde52aea6931d60a31ea 425 424 2010-11-17T23:49:00Z Sahko 43 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image doesnt work for you out of the box. Additionally AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document will demonstrate yet another way of doing this, which from my experience is easier and often more convenient than all of the above. This document will describe how to create a Hybrid Slackware ISO with [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == Syslinux >=3.72 is required Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror. or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even one the tree of the -current Slackware development cycle. If you choose to go with b) you should be able to create your own ISO images using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script] Pat's [http://slackware.osuosl.org/slackware/isolinux/README_SPLIT.TXT split to 3 CDs script] AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == Now all that is left to do is copy the ISO to the USB flash drive. That can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive: <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS. dd expects the name of the device, not the partition, so you should use eg. /dev/sdb and not /dev/sdb1. == Epilogue == Boot the computer using the USB drive. Experience should be no different than using the official installation media. 87b5661349d54a7fc6ae1532f0286bd9f9a5c7a8 Install Slackware Using A USB Flash Drive 0 233 426 425 2010-11-17T23:50:39Z Sahko 43 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image doesnt work for you out of the box. Additionally AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document will demonstrate yet another way of doing this, which from my experience is easier and often more convenient than all of the above. This document will describe how to create a Hybrid Slackware ISO with [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == Syslinux >=3.72 is required Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror. or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even one the tree of the -current Slackware development cycle. If you choose to go with b) you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script] Pat's [http://slackware.osuosl.org/slackware/isolinux/README_SPLIT.TXT split to 3 CDs script] AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == Now all that is left to do is copy the ISO to the USB flash drive. That can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive: <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS. dd expects the name of the device, not the partition, so you should use eg. /dev/sdb and not /dev/sdb1. == Epilogue == Boot the computer using the USB drive. Experience should be no different than using the official installation media. 2dd2a272eeb4e7661774abe16c2b51dfce74a2cb 427 426 2010-11-18T00:26:46Z Sahko 43 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image doesnt work for you out of the box. Additionally AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document will demonstrate yet another way of doing this, which from my experience is easier and often more convenient than all of the above. This document will describe how to create a Hybrid Slackware ISO with [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == Syslinux >=3.72 is required Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror. or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the -current Slackware development cycle. If you choose to go with b) you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script] Pat's [http://slackware.osuosl.org/slackware/isolinux/README_SPLIT.TXT split to 3 CDs script] AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == Now all that is left to do is copy the ISO to the USB flash drive. That can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive: <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS. dd expects the name of the device, not the partition, so you should use eg. /dev/sdb and not /dev/sdb1. == Epilogue == Boot the computer using the USB drive. Experience should be no different than using the official installation media. 6aa5cd35bff95c6d0015d0720c0b72c9420b10d2 428 427 2010-11-18T00:27:33Z Sahko 43 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image doesnt work for you out of the box. Additionally AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document will demonstrate yet another way of doing this, which from my experience is easier and often more convenient than all of the above. This document will describe how to create a Hybrid Slackware ISO with [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == Syslinux >=3.72 is required Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror. or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to go with b) you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script] Pat's [http://slackware.osuosl.org/slackware/isolinux/README_SPLIT.TXT split to 3 CDs script] AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == Now all that is left to do is copy the ISO to the USB flash drive. That can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive: <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS. dd expects the name of the device, not the partition, so you should use eg. /dev/sdb and not /dev/sdb1. == Epilogue == Boot the computer using the USB drive. Experience should be no different than using the official installation media. 4131eed5da4adde061821d875a7ab277dcd299fd 429 428 2010-11-18T00:44:02Z Sahko 43 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document will describe yet another way of doing this, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == Syslinux >=3.72 is required Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive: <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS. dd expects the name of the device, not the partition, so you should be using eg. /dev/sdb and not /dev/sdb1. == Epilogue == Boot the machine using the USB drive. Experience should be no different than using the official installation media. 9090cb98fadf367b49442dcfd7a0b278f63a508b 430 429 2010-11-20T02:41:16Z Sahko 43 /* Prerequisites */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document will describe yet another way of doing this, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit ISO image. Syslinux >=3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive: <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS. dd expects the name of the device, not the partition, so you should be using eg. /dev/sdb and not /dev/sdb1. == Epilogue == Boot the machine using the USB drive. Experience should be no different than using the official installation media. 64b726ac3575197dad55acad10eae5e86b079619 431 430 2010-11-20T02:41:55Z Sahko 43 /* Prerequisites */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document will describe yet another way of doing this, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image. Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive: <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS. dd expects the name of the device, not the partition, so you should be using eg. /dev/sdb and not /dev/sdb1. == Epilogue == Boot the machine using the USB drive. Experience should be no different than using the official installation media. 8a95fea9904bd38f12fc5ac97ceb490262f79b84 432 431 2010-11-20T02:44:21Z Sahko 43 /* Copy the ISO to the USB flash drive */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document will describe yet another way of doing this, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image. Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive: <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS0. dd expects the name of the device, not the partition, so you should be using eg. /dev/sdb and not /dev/sdb1. PS1. the USB should NOT be mounted during dd invocation. == Epilogue == Boot the machine using the USB drive. Experience should be no different than using the official installation media. 9d465cd6a745ba10b9813da3c1b0ce610f6a199b 433 432 2010-11-20T02:44:50Z Sahko 43 /* Copy the ISO to the USB flash drive */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document will describe yet another way of doing this, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image. Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive: <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS0. dd expects the name of the device, not the partition, so you should be using eg. /dev/sdb and not /dev/sdb1. PS1. the USB should NOT be mounted during dd invocation. == Epilogue == Boot the machine using the USB drive. Experience should be no different than using the official installation media. 2b2133addf23e71b82dbaaff157764a8ecc94294 434 433 2010-11-20T02:46:03Z Sahko 43 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of doing this, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image. Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive: <code> dd if=slackware-13.1-install-dvd.iso of=/dev/sdX </code> PS0. dd expects the name of the device, not the partition, so you should be using eg. /dev/sdb and not /dev/sdb1. PS1. the USB should NOT be mounted during dd invocation. == Epilogue == Boot the machine using the USB drive. Experience should be no different than using the official installation media. 9bfd9360809eeabadd98e3d20e7933be40fb0155 435 434 2010-11-20T06:33:09Z Sahko 43 /* Copy the ISO to the USB flash drive */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of doing this, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image. Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: <code> isohybrid slackware-13.1-install-dvd.iso </code> == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive: dd if=slackware-13.1-install-dvd.iso of=/dev/sdX PS0. dd expects the name of the device, not the partition, so you should be using eg. /dev/sdb and not /dev/sdb1. PS1. the USB should NOT be mounted during dd invocation. == Epilogue == Boot the machine using the USB drive. Experience should be no different than using the official installation media. b1b75aed161047b773a6beaf2101f43b623aa44a 436 435 2010-11-20T06:33:52Z Sahko 43 /* Using isohybrid */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, along with AlienBOB's usbimg2disk.sh in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of doing this, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image. Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk. Make it hybrid: isohybrid slackware-13.1-install-dvd.iso == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user, that will overwrite all the files currently present on the USB drive: dd if=slackware-13.1-install-dvd.iso of=/dev/sdX PS0. dd expects the name of the device, not the partition, so you should be using eg. /dev/sdb and not /dev/sdb1. PS1. the USB should NOT be mounted during dd invocation. == Epilogue == Boot the machine using the USB drive. Experience should be no different than using the official installation media. ad7c2ab0d2ada46f2f61999f871d3a8f9d2fdeb1 437 436 2010-11-20T06:50:45Z Sahko 43 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk Make it hybrid: isohybrid slackware-13.1-install-dvd.iso == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. The below command will overwrite all the files currently present on the USB drive so prior backups are highly advisable: dd if=slackware-13.1-install-dvd.iso of=/dev/sdX PS1. dd expects the name of the device, not the partition, so you should be using eg. /dev/sdb and not /dev/sdb1. PS2. the USB should NOT be mounted during dd invocation. == Epilogue == Boot the machine using the USB drive. Experience should be no different than using the official installation media. 5fcf79119d568b8c2d3f4e6f4266943486b26c1f 438 437 2010-11-20T15:36:50Z Sahko 43 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk Make it hybrid: isohybrid slackware-13.1-install-dvd.iso == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. The following command will overwrite all the files currently present on the USB drive so prior backups are highly advisable: dd if=slackware-13.1-install-dvd.iso of=/dev/sdX PS1. dd expects the name of the device, not the partition, so you should be using eg. /dev/sdb and not /dev/sdb1. PS2. the USB should NOT be mounted during dd invocation. == Epilogue == Boot the machine using the USB drive. Experience should be no different than using the official installation media. 2d6c9e10c911746d4f6cc29a975b2c722ad0e2a8 439 438 2010-11-20T15:38:11Z Sahko 43 /* Copy the ISO to the USB flash drive */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk Make it hybrid: isohybrid slackware-13.1-install-dvd.iso == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. The following command will overwrite all the files currently present on the USB drive so prior backups are highly advisable: dd if=slackware-13.1-install-dvd.iso of=/dev/sdX PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Epilogue == Boot the machine using the USB drive. Experience should be no different than using the official installation media. 4dd1c2eaa32b26269c278ba00eb3dc625400916e Dhcp renewal after wakeup 0 234 440 2010-11-27T14:08:58Z Merge-delete 261 dhcp renew after sleep tip wikitext text/x-wiki [[Category:Tips]] Sometimes you need a new IP address after waking up from sleep/standby/hibernate modes. Network managers like Wicd can do this and are recommended for laptops, but you can use the pm-utils triggers yourself without installing and running more software too. The following script works for me: <pre> #!/bin/sh # # put this to: /usr/lib64/pm-utils/sleep.d/05DhcpcdRenew # /usr/lib/pm-utils/ .. on 32-bit systems case "$1" in hibernate|suspend) ;; thaw|resume) dhcpcd -n ;; *) exit $NA ;; esac </pre> The script probably needs to be executable. d1a8725bc987ff15e9c14f7232671c0e9c6dd0e3 441 440 2010-11-28T15:39:39Z Merge-delete 261 wikitext text/x-wiki [[Category:Tips]] Sometimes you need a new IP address after waking up from sleep/standby/hibernate modes. Network managers like Wicd can do this and are recommended for laptops, but you can use the pm-utils triggers yourself without installing and running more software too. The following script works for me: <pre> #!/bin/sh # # put this to: /usr/lib64/pm-utils/sleep.d/05DhcpcdRenew # /usr/lib/pm-utils/ .. on 32-bit systems case "$1" in hibernate|suspend) dhcpcd -k eth0 ;; thaw|resume) dhcpcd eth0 ;; *) exit $NA ;; esac </pre> The script probably needs to be executable. 65752095814daab5990203864ed6d6dd16570d53 Mutt 0 117 442 222 2010-12-26T20:36:29Z Lionel 130 /* Getmail */ Add Gmail IMAP getmail configuration wikitext text/x-wiki [[Category:Tutorials]] = Mutt = Mutt is a text-based mail client renowned for its powerful features and the fact that it is almost totally customizable. This article will cover the installation and configuration of mutt in order to use it as your daily email client. Please note that I use GMail as my primary email address, so the examples are designed for GMail users. Not much differs though other than the fact that GMail uses SSL. == Installation == Slackware comes with a package for mutt v1.4. If you did a full install, you already have it installed. If not, it can be located on the 'n' series on your Slackware install CD or favourite mirror. This tutorial also uses getmail, procmail and msmtp. procmail and getmail are available as Slackware packages, and can be installed in the same manner... If you have the CD, follow these steps as root to install it: mount /mnt/cdrom installpkg /mnt/cdrom/slackware/n/mutt-1.4.2.1i-i486-2.tgz installpkg /mnt/cdrom/slackware/n/getmail-4.4.4-noarch-1.tgz installpkg /mnt/cdrom/slackware/n/procmail-3.22-i486-1.tgz If you would rather install it from a mirror: wget http://www.slackware.at/data/slackware-current/slackware/n/mutt-1.4.2.1i-i486-2.tgz wget http://www.slackware.at/data/slackware-current/slackware/n/getmail-4.4.4-noarch-1.tgz wget http://www.slackware.at/data/slackware-current/slackware/n/procmail-3.22-i486-1.tgz installpkg mutt-1.4.2.1i-i486-2.tgz getmail-4.4.4-noarch-1.tgz procmail-3.22-i486-1.tgz Be sure to replace 'slackware-current' with the actual version of Slackware you are using. msmtp is not part of Slackware, and will need to be installed separately. It can be downloaded from [http://msmtp.sourceforge.net/ here]. If you need information on building Slackware packages, click [[Building_A_Package]] for an excellent tutorial. == Configuration == === Mutt === First, let start with mutt, and a very simple ''~/.muttrc'': # Name set realname='Slackware User' # Where we store our emails set folder=~/mail set mbox=+mbox set spoolfile=+inbox set record=+sent set sort=threads # sort by emails by thread ;-) set postponed=+drafts set mbox_type=Maildir mailboxes +inbox # my favourite editor is 'joe' set editor=joe ignore * # this means "ignore all headers by default" # I still want to see some basic details unignore date from subject to cc # Mutt options set edit_headers=yes set hdrs # Allows us to create our own headers my_hdr From: Slackware User <user@slackware.com> my_hdr X-Mailer: `mutt -v| head -n 1` So far, it's simple, and cannot do much. We can almost read emails stored in ~/mail, compose and save drafts. In order for us to read emails, first, we need to create our mail folders. We are using the Maildir format, so we need to create them using: mkdir -p ~/mail/inbox/{,cur,tmp,new} mkdir -p ~/mail/sent/{,cur,tmp,new} mkdir -p ~/mail/drafts/{,cur,tmp,new} Now, when we have an email in ~/mail/inbox, we will be able to read it. Postponed messages will also be saved in ~/mail/drafts. But want to be able to send emails too, right? That's where msmtp comes into play. For this part, we will assume that msmtp is installed. msmtp is basically a SMTP client that will be called by mutt when sending an email. So we need to have added to the mutt config like this: set sendmail="/usr/bin/msmtp" Now, that's useless by itself. We need to setup msmtp to send emails... Open up ~/.msmtprc with your favourite editor. This is a copy of mine, setup to use GMail's smtp server: account default host smtp.gmail.com port 587 protocol smtp auth on from username@gmail.com user username@gmail.com password mypassword tls on tls_starttls on So, after going through this and identifying what we need for our SMTP server, we are ready to send emails... Let's test it: Launch mutt by running: mutt -y Running mutt without '-y' will ignore our mailboxes statement, so we won't see any emails... You can see in mutt the key shortcuts at the top of the screen: 'm' for composing a new message. After we save the message, we see a new shortcut at the top: 'y' to send the message. We now have mutt that can read emails from ~/mail/inbox, and send emails!!! The next step is to get the emails in ~/mail, and that's getmail's job. === Getmail === Getmail is a Python application that's included with Slackware. Similar to fetchmail, many people prefer it, saying it's easier to configure. Just like mutt, getmail is in the 'n' series, and should already be installed if you chose to do a full install. If not, just check out the mutt section above to install what's needed for this tutorial. Once we have it all installed, let's create a basic getmail configuration. This configuration sits in ''~/.getmail/getmailrc'': [retriever] type = SimplePOP3SSLRetriever server = pop.gmail.com username = username@gmail.com port = 995 password = password [destination] type = Maildir path = ~/mail/inbox If you use a standard POP3 account that doesn't use SSL, use something like: [retriever] type = SimplePOP3Retriever server = pop.isp.net username = username port = 110 password = password [destination] type = Maildir path = ~/mail/inbox If you use Gmail's IMAP account, use something like: [retriever] type = SimpleIMAPSSLRetriever server = imap.gmail.com username = username password = password [destination] type = Maildir path = ~/mail/inbox As simple as that. Now, it will connect to your email account, and download all your emails to ~/mail/inbox. Please note that if you want to fetch mail for multiple accounts, unlike fetchmail, getmail works with a single account per config file. So if you have two email accounts, you can have each account configured in their own config file like ''~/.getmail/getmailrc'' and ''~/.getmail/getmailrc-isp'' If you want automatic check, just add the following lines to your crontab by running ''crontab -e'' for each one of your email accounts: /5 * * * * /usr/bin/getmail /30 * * * * /usr/bin/getmail -r ~/.getmail/getmailrc-isp === Procmail === Procmail is an advanced mail filtering solution. More to come == Todo == The rest... 1cc7b9ab34626ad0a0016f889446defce25da419 Main Page 0 1 443 393 2011-01-05T17:43:35Z Erik 1 wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.16.1. [[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 47ef67699b75145f212f029858584c7c950923f0 449 443 2011-02-01T23:53:51Z Erik 1 Patched to 1.16.2. wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) | Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) b846a902fcf48e513817e20caedec8bb1bb58432 Samba 0 145 445 173 2011-01-15T04:43:02Z Natex 157 /* Using Samba */ wikitext text/x-wiki [[Category:Tutorials]] ... this is a W.I.P ... will write more the next days, hope this is ok :) comments, suggestions, etc. are welcome! == Introduction == This Tutorial shows you how to configure Samba 3.0.x on Slackware 12.x. It should later act as simple and secure as it can be in a heterogen network with Windows systems (a workstation with admin access, guest accounts for the rest [eg. your friends]), a media streaming client (eg. Xbox) and Linux / *nix (Solaris / Mac OS X). I wanted to have all necessary parameters for home usage in my smb.conf so i can easily change them and have a mostly secure and stable system. Printing is disabled by default in my config, since i have no need to attach my printer to the server (the printer has its own print server: HP P2015). Also i really have no clue how to use a printer with linux. If someone wants to write something on printing then feel free to do so... == Upgrade / Build Samba == If you are here you probably will know what Samba is good for and how it works. Normally Samba is installed on your system and ready for action and doesn't need to be upgraded. === Upgrade Samba === All upgrades to Samba should be done via the patches directory on your favorite mirror. You should NOT NOT NOT mix -current packages with a non "-current" Slackware. === Building Samba === Hey! Wanna build Samba? Get the source, get the slackbuild, make a package and install it! I used the latest build from the 3.0.x fork since this comes with Slackware 12.x. You can also try building Samba 3.2.x. If you want a optimized build with a better performance that suits your system, you should consider installing GCC >4.2.4 since it supports better optimizing functions (''-march=native'' - specifying ''-march=native'' implies ''-mtune=native''. This will enable all instruction subsets supported by the local machine (hence the result might not run on different machines).) and use Samba 3.2.x cause it has a better overall performance. Only do this if you know what you are doing! * Get the source + SlackBuild, edit it and build the package... <pre>$ mkdir /tmp/samba $ cd /tmp/samba $ wget http://us3.samba.org/samba/ftp/stable/samba-3.0.31.tar.gz ... $ wget -r -nH ftp://slackware.osuosl.org/pub/slackware/slackware-current/source/n/samba $ jed samba.SlackBuild > VERSION=3.0.30 >> VERSION=3.0.31 > tar xjvf $CWD/samba-$VERSION.tar.bz2 >> tar xfvz $CWD/samba-$VERSION.tar.gz $ chmod +x samba.SlackBuild $ ./samba.SlackBuild $ upgradepkg /tmp/samba-3.0.31-i486-1.tgz</pre> == Configure Samba == There are a few requirments i had for this config. * Guest access from Windows without the need for a password * Guests are only allowed to read and have no ''home directory'' (eg. /home/guest) * Guests are only allowed to put new files in a given directory * Make everything secure as it can get with this config * Users on the system have access to their ''home directory'' * No Printing at all * Disable NetBios, we only have Windows XP or higher / *nix * Maybe more? === /etc/samba/smb.conf === This is my own ''smb.conf'' as i use it on my system. The config file itself should be selfexplaining. ==== '''smb.conf /w comments''' ==== <pre>#smb.conf - v1.1 # # Samba-3.0.30 - Slackware 12.x # e.v.o ( e.v.o [A-T] gmx.net ) # # ; COMMENT # #PARAMETER ( name = default value ) # Normally every parameter should have its default value. # If the parameter is commented out then it is the default value, # otherwise you should have a look at "man smb.conf" # # This config is based on the smb.conf manual page # and "Using Samba, 3rd Edition" from O'Reilly # # VARIABLE SUBSTITUTIONS ; %U session username ; %G primary group name of %U ; %h the Internet hostname that Samba is running on ; %m the NetBIOS name of the client machine (very useful) ; %L the NetBIOS name of the server ; %M the Internet name of the client machine ; %R the selected protocol level after protocol negotiation ; %d the process id of the current server process ; %a the architecture of the remote machine ; %I the IP address of the client machine ; %i the local IP address to which a client connected ; %T the current date and time ; %D name of the domain or workgroup of the current user ; %w the winbind separator ; %v Samba version number ; ; The following substitutes apply only to some configuration options ; Only those that are used when a connection has been established ; ; %S the name of the current service, if any ; %P the root directory of the current service, if any ; %u username of the current service, if any ; %g primary group name of %u ; %H the home directory of the user given by %u ; %N the name of your NIS home directory server ; %p the path of the service's home directory [global] ; Parameters in this section apply to the server as a whole ; ### USERSHARES ### # Capability for non-root users to ; ==================== # add/modify/delete own share definitions ; ; Controls if usershares can permit guest access #usershare allow guests = ; Maximum number of user defined shares allowed #usershare max shares = ; If set only directories owned by the sharing user can be shared #usershare owner only = ; Directory containing the user defined share definitions #usershare path = ; Comma-separated list restricting what directories can be shared #usershare prefix allow list = ; Comma-separated list restricting what directories can be shared #usershare prefix deny list = ; Pre-existing share used as a template for creating new usershares #usershare template share = ; ### NAME MANGLING ### # By default, Samba has the same ; ======================= # semantics as a Windows NT server ; ; Filenames are case sensitive #case sensitive = auto ; Default case for new filenames #default case = lower ; New files are created with the case that the client passes #preserve case = yes ; New files which conform to 8.3 syntax are created upper case #short preserve case = yes ; ### PRINTING ### ; ================== ; ; All printers in the printcap will be loaded for browsing by default load printers = no ; Only applicable if printing is set to cups. #cups server = "" ; Show the "Add Printer Wizard" Dialog show add printer wizard = no ; Yes = open, write to and submit spool files on the specified directory printable = no ; =============================== ; # - S E T T I N G S - # ; =============================== ; \-= USER SCRIPTS =-/ # These scripts are used on a PDC or stand-alone ; ==================== # machine to add or delete corresponding unix accounts ; Script that will be run when a new group is requested #add group script = /usr/sbin/groupadd %g ; Script that will be run when a machine is added to Samba's domain #add machine script = /usr/sbin/adduser -s /bin/false -d /dev/null %u -n -g machines -c Machine ; Script which will add a new service definition to smb.conf #add share command = ; Script which will add a new user #add user script = /usr/sbin/useradd -m %u ; Script that will be called when a user is added to a group #add user to group script = /usr/sbin/usermod -G %g %u ; Script which will modify an existing service definition in smb.conf #change share command = ; Script when a group is requested to be deleted #delete group script = /usr/sbin/groupdel %g ; Script when a user is removed from a group using the Windows NT domain administration tools #delete user from group script = /usr/sbin/deluser %u %g ; Script that will be run when managing users with remote RPC (NT) tools #delete user script = /usr/sbin/userdel -r %u ; Script that will be run under special circumstances #rename user script = no ; This script sets the primary group in the unix userdatase when an administrator sets the ; primary group from the windows user manager or when fetching a SAM with net rpc vampire #set primary group script = /usr/sbin/usermod -g '%g' '%u' ; Program that can be used to set UNIX user passwords #passwd program = /usr/bin/passwd %u ; Controls the "chat" conversation between smbd and the local password changing program #passwd chat = "*New password:*" %n\r "*New password (again):*" %n\r \ "*Password changed*" ; \-= PERMISSION MASKS =-/ ; ======================== #inherit owner = no #inherit permissions = no #directory mask = 0755 #directory security mask = 0777 #force create mode = 000 #force directory mode = 000 #force directory security mode = 0 #force security mode = 0 #security mask = 0777 ; \-= USER PARAMETER =-/ ; ====================== ; List of users who will be granted administrative privileges on the share admin users = evo ; This is a list of users that should be allowed to login to this service valid users = evo guest ; This is a list of users that should not be allowed to login to this service invalid users = root nobody ftp adm apache bin daemon games gdm haldaemon halt lp mail messagebus mysql news operator pop rpc shutdown smmsp sshd sync uucp ; This is a list of users that are given read-only access to a service read list = evo guest ; This is a list of users that are given read-write access to a service write list = evo ; -= Guest Settings =- ; Username which will be used for access to services which are specified as guest ok guest account = guest ; Yes for a service, then no password is required to connect to the service guest ok = no ; Yes for a service, then only guest connections to the service are permitted guest only = no ; -= Forced User/Group Settings =- ; UNIX user name that will be assigned as the default user for all users ;force user = guest ; UNIX group name that will be assigned as the default primary group for all users force group = users ; -= Map Settings =- ; Specify a file containing a mapping of usernames from the clients to the server #username map = ; #map acl inherit = no #map archive = yes #map hidden = #map read only = yes #map system = no map to guest = Bad User ; \-= SHARE PARAMETER =-/ ; ======================= ; Lets you "turn off" a service. If available = no, then ALL attempts to connect to the service will fail available = yes ; Controls whether this share is seen in the list of available shares in a net view and in the browse list browseable = yes ; Allow or disallow client access to accounts that have null passwords #null password = no ; If this parameter is yes, then users of a service may not create or modify files in the service's directory read only = yes ; Setting this parameter to no prevents any file or directory that is a symbolic link from being followed follow symlinks = no ; This parameter controls whether or not links in the UNIX file system may be followed by the server wide links = no ; This parameter specifies the name of a service which will be connected to if the service actually requested cannot be found #default service = ; This parameter allows you to specify a comma-delimited list of directories that the server should always show as empty dont descend = /bin,/boot,/dev,/etc,/lib,/opt,/proc,/sbin,/srv,/sys,/tmp,/usr,/var ; -= Hide Files =- ; This is a boolean parameter that controls whether files starting with a dot appear as hidden files #hide dot files = yes ; This is a list of files or directories that are not visible but are accessible #hide files = ; This parameter prevents clients from seeing special files such as sockets, devices and fifo's in directory listings #hide special files = no ; This parameter prevents clients from seeing the existance of files that cannot be read #hide unreadable = no ; This parameter prevents clients from seeing the existance of files that cannot be written to #hide unwriteable files = no ; \-= WINDOWS PARAMETER =-/ ; ========================= ; Specifies the charset that samba will use to print messages to stdout and stderr #display charset = "LOCALE" or "ASCII" (depending on the system) ; This option specifies which charset Samba should talk to DOS clients #dos charset = # No default ; Enabling this parameter allows a user who has write access to the file (by whatever means) to modify the permissions #dos filemode = no ; \-= NETWORK/CONNECTION PARAMETER =-/ ; ==================================== ; This controls what workgroup your server will appear to be in when queried by clients workgroup = KlingKlang ; This controls what string will show up in the printer comment box in print manager and next to the IPC connection in net view server string = FileDealer ; This sets the NetBIOS name by which a Samba server is known netbios name = FileDealer #netbios aliases = ; -= Interface Settings =- ; This parameter is a comma, space, or tab delimited set of hosts which are permitted to access a service hosts allow = 127.0.0.1 192.168. hosts deny = ALL ; -= Connection Options =- ; Represents the number of minutes of inactivity before a connection is considered dead and disconnected #deadtime = 0 ; The value of the parameter (an integer) represents the number of seconds between keepalive packets #keepalive = 300 ; This option allows the number of simultaneous connections to a service #max connections = 0 ; This option allows you to set socket options to be used when talking with the client socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 ; \-= OTHER PARAMETER =-/ ; ======================= security = user ; Enabling this parameter will disable netbios support in Samba disable netbios = yes ; Do a lookup with the DNS server dns proxy = no ; -= SMBpasswd Settings =- ; This option allows the administrator to chose which backend will be used for storing user and possibly group information #passdb backend = smbpasswd:/etc/samba/private/smbpasswd ; This option sets the path to the encrypted smbpasswd file #smb passwd file = /etc/samba/private/smbpasswd ; -= Directory Settings =- ; This option specifies the directory where lock files will be placed #lock directory = /var/lock ; This parameters defines the directory smbd will use for storing such files as smbpasswd and secrets.tdb #private dir = /etc/samba/private ; -= Logging Settings =- ; This option allows you to override the name of the Samba log file log file = /var/log/samba/samba.%m ; This option (an integer in kilobytes) specifies the max size the log file should grow to max log size = 5000 ; Parameter maps how Samba debug messages are logged onto the system #syslog = 1 ; Parameter is set then Samba debug messages are logged into the system syslog only #syslog only = no ; Using the following line enables you to customise your configuration on a per machine ; basis. The %m gets replaced with the netbios name of the machine that is connecting. ; Note: Consider carefully the location in the configuration file of ; this line. The included file is read at that point. #include = /etc/samba/smb.conf.%m ; =========================== ; # - S H A R E S - # ; =========================== [homes] comment = Eigene Dateien guest ok = yes read only = no browseable = no [printers] comment = Drucker path = /var/spool/samba browseable = no available = no guest ok = no printable = yes [BitHalde] comment = 3TB path = /mnt/raid guest ok = yes read only = yes </pre> ==== smb.conf w/o comments ==== <pre>[global] workgroup = KLINGKLANG server string = FileDealer map to guest = Bad User guest account = guest log file = /var/log/samba/samba.%m disable netbios = Yes socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 load printers = No show add printer wizard = No dns proxy = No invalid users = root, nobody, ftp, adm, apache, bin, daemon, games, gdm, haldaemon, halt, lp, mail, messagebus, mysql, news, operator, pop, rpc, shutdown, smmsp, sshd, sync, uucp valid users = evo, guest admin users = evo read list = evo, guest write list = evo force group = users hosts allow = 127.0.0.1, 192.168. hosts deny = ALL wide links = No follow symlinks = No dont descend = /bin,/boot,/dev,/etc,/lib,/opt,/proc,/sbin,/srv,/sys,/tmp,/usr,/var [homes] comment = Eigene Dateien read only = No guest ok = Yes browseable = No [printers] comment = Drucker path = /var/spool/samba printable = Yes browseable = No available = No [BitHalde] comment = 3TB path = /mnt/raid guest ok = Yes </pre> == Using Samba == In this section we will have a look on how to restart, stop, and start the samba server. === Starting and Stopping Samba === In Slackware, the script /etc/rc.d/rc.samba controls the state of the samba server. Below are the three commands you can use (as root). To restart samba use: <code>/etc/rc.d/rc.samba restart </code> To stop samba use: <code>/etc/rc.d/rc.samba stop </code> To start samba from a stopped state use: <code>/etc/rc.d/rc.samba start </code> The rc.samba script described above is merely a convenient wrapper for the /usr/sbin/smbd and /usr/sbin/nmdb commands. For example, you could also start the samba server by using these two commands together: <pre>#/usr/sbin/smbd -D #/usr/sbin/nmbd -D </pre> See the man pages for smbd and nmbd for details. === Optimizing Samba === == Testing and Troubleshooting == In this section we will have a look on how we test our configuration and what to do if we ran into problems. === Using ''testparm'' === <blockquote>testparm — check an smb.conf configuration file for internal correctness</blockquote> *: If your done with the setup of your ''smb.conf'' you should run ''testparm''. Do this by simply typing it ;) <pre>$ testparm Load smb config files from /etc/samba/smb.conf Processing section "[homes]" Processing section "[printers]" NOTE: Service printers is flagged unavailable. Processing section "[BitHalde]" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions</pre> :: Normally this is what the output should look like. By pressing enter you will get a list of all used parameters in smb.conf. *: If you wish to have a complete list of all options and how they are set: <pre>$ testparm -v</pre> ==== Using ''smbclient'' ==== <blockquote>smbclient — ftp-like client to access SMB/CIFS resources on servers</blockquote> * Connecting as a guest and list all shares <pre>$ smbclient -L localhost -N Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Sharename Type Comment --------- ---- ------- BitHalde Disk 3TB IPC$ IPC IPC Service (FileDealer) Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Server Comment --------- ------- Workgroup Master --------- ------- KLINGKLANG FILEDEALER</pre> <blockquote>-L ''host'' This option allows you to look at what services are available on a server.<br/> -N Suppresses the normal password prompt. Useful when accessing a service that does not require a password.</blockquote> * Connecting with a specified username and list all shares <pre>$ smbclient -L localhost -U evo Password: Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Sharename Type Comment --------- ---- ------- BitHalde Disk 3TB IPC$ IPC IPC Service (FileDealer) evo Disk Eigene Dateien Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Server Comment --------- ------- Workgroup Master --------- ------- KLINGKLANG FILEDEALER</pre> <blockquote>-U Sets the SMB username or username and password.</blockquote> == To Do == * alle user eintragen (cat /etc/passwd | cut -d':' -f1 | sort) * user scripte vervollständigen * masken richten + upload beim gast/evo gehört root? warum das? * was ist mit umlauten? * --> wie starten? rc.samba * Testmethoden aus dem samba buch einfügen 7f2aad2acc17370099c7c98d720f67da334b1396 446 445 2011-01-15T04:47:45Z Natex 157 /* Optimizing Samba */ wikitext text/x-wiki [[Category:Tutorials]] ... this is a W.I.P ... will write more the next days, hope this is ok :) comments, suggestions, etc. are welcome! == Introduction == This Tutorial shows you how to configure Samba 3.0.x on Slackware 12.x. It should later act as simple and secure as it can be in a heterogen network with Windows systems (a workstation with admin access, guest accounts for the rest [eg. your friends]), a media streaming client (eg. Xbox) and Linux / *nix (Solaris / Mac OS X). I wanted to have all necessary parameters for home usage in my smb.conf so i can easily change them and have a mostly secure and stable system. Printing is disabled by default in my config, since i have no need to attach my printer to the server (the printer has its own print server: HP P2015). Also i really have no clue how to use a printer with linux. If someone wants to write something on printing then feel free to do so... == Upgrade / Build Samba == If you are here you probably will know what Samba is good for and how it works. Normally Samba is installed on your system and ready for action and doesn't need to be upgraded. === Upgrade Samba === All upgrades to Samba should be done via the patches directory on your favorite mirror. You should NOT NOT NOT mix -current packages with a non "-current" Slackware. === Building Samba === Hey! Wanna build Samba? Get the source, get the slackbuild, make a package and install it! I used the latest build from the 3.0.x fork since this comes with Slackware 12.x. You can also try building Samba 3.2.x. If you want a optimized build with a better performance that suits your system, you should consider installing GCC >4.2.4 since it supports better optimizing functions (''-march=native'' - specifying ''-march=native'' implies ''-mtune=native''. This will enable all instruction subsets supported by the local machine (hence the result might not run on different machines).) and use Samba 3.2.x cause it has a better overall performance. Only do this if you know what you are doing! * Get the source + SlackBuild, edit it and build the package... <pre>$ mkdir /tmp/samba $ cd /tmp/samba $ wget http://us3.samba.org/samba/ftp/stable/samba-3.0.31.tar.gz ... $ wget -r -nH ftp://slackware.osuosl.org/pub/slackware/slackware-current/source/n/samba $ jed samba.SlackBuild > VERSION=3.0.30 >> VERSION=3.0.31 > tar xjvf $CWD/samba-$VERSION.tar.bz2 >> tar xfvz $CWD/samba-$VERSION.tar.gz $ chmod +x samba.SlackBuild $ ./samba.SlackBuild $ upgradepkg /tmp/samba-3.0.31-i486-1.tgz</pre> == Configure Samba == There are a few requirments i had for this config. * Guest access from Windows without the need for a password * Guests are only allowed to read and have no ''home directory'' (eg. /home/guest) * Guests are only allowed to put new files in a given directory * Make everything secure as it can get with this config * Users on the system have access to their ''home directory'' * No Printing at all * Disable NetBios, we only have Windows XP or higher / *nix * Maybe more? === /etc/samba/smb.conf === This is my own ''smb.conf'' as i use it on my system. The config file itself should be selfexplaining. ==== '''smb.conf /w comments''' ==== <pre>#smb.conf - v1.1 # # Samba-3.0.30 - Slackware 12.x # e.v.o ( e.v.o [A-T] gmx.net ) # # ; COMMENT # #PARAMETER ( name = default value ) # Normally every parameter should have its default value. # If the parameter is commented out then it is the default value, # otherwise you should have a look at "man smb.conf" # # This config is based on the smb.conf manual page # and "Using Samba, 3rd Edition" from O'Reilly # # VARIABLE SUBSTITUTIONS ; %U session username ; %G primary group name of %U ; %h the Internet hostname that Samba is running on ; %m the NetBIOS name of the client machine (very useful) ; %L the NetBIOS name of the server ; %M the Internet name of the client machine ; %R the selected protocol level after protocol negotiation ; %d the process id of the current server process ; %a the architecture of the remote machine ; %I the IP address of the client machine ; %i the local IP address to which a client connected ; %T the current date and time ; %D name of the domain or workgroup of the current user ; %w the winbind separator ; %v Samba version number ; ; The following substitutes apply only to some configuration options ; Only those that are used when a connection has been established ; ; %S the name of the current service, if any ; %P the root directory of the current service, if any ; %u username of the current service, if any ; %g primary group name of %u ; %H the home directory of the user given by %u ; %N the name of your NIS home directory server ; %p the path of the service's home directory [global] ; Parameters in this section apply to the server as a whole ; ### USERSHARES ### # Capability for non-root users to ; ==================== # add/modify/delete own share definitions ; ; Controls if usershares can permit guest access #usershare allow guests = ; Maximum number of user defined shares allowed #usershare max shares = ; If set only directories owned by the sharing user can be shared #usershare owner only = ; Directory containing the user defined share definitions #usershare path = ; Comma-separated list restricting what directories can be shared #usershare prefix allow list = ; Comma-separated list restricting what directories can be shared #usershare prefix deny list = ; Pre-existing share used as a template for creating new usershares #usershare template share = ; ### NAME MANGLING ### # By default, Samba has the same ; ======================= # semantics as a Windows NT server ; ; Filenames are case sensitive #case sensitive = auto ; Default case for new filenames #default case = lower ; New files are created with the case that the client passes #preserve case = yes ; New files which conform to 8.3 syntax are created upper case #short preserve case = yes ; ### PRINTING ### ; ================== ; ; All printers in the printcap will be loaded for browsing by default load printers = no ; Only applicable if printing is set to cups. #cups server = "" ; Show the "Add Printer Wizard" Dialog show add printer wizard = no ; Yes = open, write to and submit spool files on the specified directory printable = no ; =============================== ; # - S E T T I N G S - # ; =============================== ; \-= USER SCRIPTS =-/ # These scripts are used on a PDC or stand-alone ; ==================== # machine to add or delete corresponding unix accounts ; Script that will be run when a new group is requested #add group script = /usr/sbin/groupadd %g ; Script that will be run when a machine is added to Samba's domain #add machine script = /usr/sbin/adduser -s /bin/false -d /dev/null %u -n -g machines -c Machine ; Script which will add a new service definition to smb.conf #add share command = ; Script which will add a new user #add user script = /usr/sbin/useradd -m %u ; Script that will be called when a user is added to a group #add user to group script = /usr/sbin/usermod -G %g %u ; Script which will modify an existing service definition in smb.conf #change share command = ; Script when a group is requested to be deleted #delete group script = /usr/sbin/groupdel %g ; Script when a user is removed from a group using the Windows NT domain administration tools #delete user from group script = /usr/sbin/deluser %u %g ; Script that will be run when managing users with remote RPC (NT) tools #delete user script = /usr/sbin/userdel -r %u ; Script that will be run under special circumstances #rename user script = no ; This script sets the primary group in the unix userdatase when an administrator sets the ; primary group from the windows user manager or when fetching a SAM with net rpc vampire #set primary group script = /usr/sbin/usermod -g '%g' '%u' ; Program that can be used to set UNIX user passwords #passwd program = /usr/bin/passwd %u ; Controls the "chat" conversation between smbd and the local password changing program #passwd chat = "*New password:*" %n\r "*New password (again):*" %n\r \ "*Password changed*" ; \-= PERMISSION MASKS =-/ ; ======================== #inherit owner = no #inherit permissions = no #directory mask = 0755 #directory security mask = 0777 #force create mode = 000 #force directory mode = 000 #force directory security mode = 0 #force security mode = 0 #security mask = 0777 ; \-= USER PARAMETER =-/ ; ====================== ; List of users who will be granted administrative privileges on the share admin users = evo ; This is a list of users that should be allowed to login to this service valid users = evo guest ; This is a list of users that should not be allowed to login to this service invalid users = root nobody ftp adm apache bin daemon games gdm haldaemon halt lp mail messagebus mysql news operator pop rpc shutdown smmsp sshd sync uucp ; This is a list of users that are given read-only access to a service read list = evo guest ; This is a list of users that are given read-write access to a service write list = evo ; -= Guest Settings =- ; Username which will be used for access to services which are specified as guest ok guest account = guest ; Yes for a service, then no password is required to connect to the service guest ok = no ; Yes for a service, then only guest connections to the service are permitted guest only = no ; -= Forced User/Group Settings =- ; UNIX user name that will be assigned as the default user for all users ;force user = guest ; UNIX group name that will be assigned as the default primary group for all users force group = users ; -= Map Settings =- ; Specify a file containing a mapping of usernames from the clients to the server #username map = ; #map acl inherit = no #map archive = yes #map hidden = #map read only = yes #map system = no map to guest = Bad User ; \-= SHARE PARAMETER =-/ ; ======================= ; Lets you "turn off" a service. If available = no, then ALL attempts to connect to the service will fail available = yes ; Controls whether this share is seen in the list of available shares in a net view and in the browse list browseable = yes ; Allow or disallow client access to accounts that have null passwords #null password = no ; If this parameter is yes, then users of a service may not create or modify files in the service's directory read only = yes ; Setting this parameter to no prevents any file or directory that is a symbolic link from being followed follow symlinks = no ; This parameter controls whether or not links in the UNIX file system may be followed by the server wide links = no ; This parameter specifies the name of a service which will be connected to if the service actually requested cannot be found #default service = ; This parameter allows you to specify a comma-delimited list of directories that the server should always show as empty dont descend = /bin,/boot,/dev,/etc,/lib,/opt,/proc,/sbin,/srv,/sys,/tmp,/usr,/var ; -= Hide Files =- ; This is a boolean parameter that controls whether files starting with a dot appear as hidden files #hide dot files = yes ; This is a list of files or directories that are not visible but are accessible #hide files = ; This parameter prevents clients from seeing special files such as sockets, devices and fifo's in directory listings #hide special files = no ; This parameter prevents clients from seeing the existance of files that cannot be read #hide unreadable = no ; This parameter prevents clients from seeing the existance of files that cannot be written to #hide unwriteable files = no ; \-= WINDOWS PARAMETER =-/ ; ========================= ; Specifies the charset that samba will use to print messages to stdout and stderr #display charset = "LOCALE" or "ASCII" (depending on the system) ; This option specifies which charset Samba should talk to DOS clients #dos charset = # No default ; Enabling this parameter allows a user who has write access to the file (by whatever means) to modify the permissions #dos filemode = no ; \-= NETWORK/CONNECTION PARAMETER =-/ ; ==================================== ; This controls what workgroup your server will appear to be in when queried by clients workgroup = KlingKlang ; This controls what string will show up in the printer comment box in print manager and next to the IPC connection in net view server string = FileDealer ; This sets the NetBIOS name by which a Samba server is known netbios name = FileDealer #netbios aliases = ; -= Interface Settings =- ; This parameter is a comma, space, or tab delimited set of hosts which are permitted to access a service hosts allow = 127.0.0.1 192.168. hosts deny = ALL ; -= Connection Options =- ; Represents the number of minutes of inactivity before a connection is considered dead and disconnected #deadtime = 0 ; The value of the parameter (an integer) represents the number of seconds between keepalive packets #keepalive = 300 ; This option allows the number of simultaneous connections to a service #max connections = 0 ; This option allows you to set socket options to be used when talking with the client socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 ; \-= OTHER PARAMETER =-/ ; ======================= security = user ; Enabling this parameter will disable netbios support in Samba disable netbios = yes ; Do a lookup with the DNS server dns proxy = no ; -= SMBpasswd Settings =- ; This option allows the administrator to chose which backend will be used for storing user and possibly group information #passdb backend = smbpasswd:/etc/samba/private/smbpasswd ; This option sets the path to the encrypted smbpasswd file #smb passwd file = /etc/samba/private/smbpasswd ; -= Directory Settings =- ; This option specifies the directory where lock files will be placed #lock directory = /var/lock ; This parameters defines the directory smbd will use for storing such files as smbpasswd and secrets.tdb #private dir = /etc/samba/private ; -= Logging Settings =- ; This option allows you to override the name of the Samba log file log file = /var/log/samba/samba.%m ; This option (an integer in kilobytes) specifies the max size the log file should grow to max log size = 5000 ; Parameter maps how Samba debug messages are logged onto the system #syslog = 1 ; Parameter is set then Samba debug messages are logged into the system syslog only #syslog only = no ; Using the following line enables you to customise your configuration on a per machine ; basis. The %m gets replaced with the netbios name of the machine that is connecting. ; Note: Consider carefully the location in the configuration file of ; this line. The included file is read at that point. #include = /etc/samba/smb.conf.%m ; =========================== ; # - S H A R E S - # ; =========================== [homes] comment = Eigene Dateien guest ok = yes read only = no browseable = no [printers] comment = Drucker path = /var/spool/samba browseable = no available = no guest ok = no printable = yes [BitHalde] comment = 3TB path = /mnt/raid guest ok = yes read only = yes </pre> ==== smb.conf w/o comments ==== <pre>[global] workgroup = KLINGKLANG server string = FileDealer map to guest = Bad User guest account = guest log file = /var/log/samba/samba.%m disable netbios = Yes socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 load printers = No show add printer wizard = No dns proxy = No invalid users = root, nobody, ftp, adm, apache, bin, daemon, games, gdm, haldaemon, halt, lp, mail, messagebus, mysql, news, operator, pop, rpc, shutdown, smmsp, sshd, sync, uucp valid users = evo, guest admin users = evo read list = evo, guest write list = evo force group = users hosts allow = 127.0.0.1, 192.168. hosts deny = ALL wide links = No follow symlinks = No dont descend = /bin,/boot,/dev,/etc,/lib,/opt,/proc,/sbin,/srv,/sys,/tmp,/usr,/var [homes] comment = Eigene Dateien read only = No guest ok = Yes browseable = No [printers] comment = Drucker path = /var/spool/samba printable = Yes browseable = No available = No [BitHalde] comment = 3TB path = /mnt/raid guest ok = Yes </pre> == Using Samba == In this section we will have a look on how to restart, stop, and start the samba server. === Starting and Stopping Samba === In Slackware, the script /etc/rc.d/rc.samba controls the state of the samba server. Below are the three commands you can use (as root). To restart samba use: <code>/etc/rc.d/rc.samba restart </code> To stop samba use: <code>/etc/rc.d/rc.samba stop </code> To start samba from a stopped state use: <code>/etc/rc.d/rc.samba start </code> The rc.samba script described above is merely a convenient wrapper for the /usr/sbin/smbd and /usr/sbin/nmdb commands. For example, you could also start the samba server by using these two commands together: <pre>#/usr/sbin/smbd -D #/usr/sbin/nmbd -D </pre> See the man pages for smbd and nmbd for details. == Testing and Troubleshooting == In this section we will have a look on how we test our configuration and what to do if we ran into problems. === Using ''testparm'' === <blockquote>testparm — check an smb.conf configuration file for internal correctness</blockquote> *: If your done with the setup of your ''smb.conf'' you should run ''testparm''. Do this by simply typing it ;) <pre>$ testparm Load smb config files from /etc/samba/smb.conf Processing section "[homes]" Processing section "[printers]" NOTE: Service printers is flagged unavailable. Processing section "[BitHalde]" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions</pre> :: Normally this is what the output should look like. By pressing enter you will get a list of all used parameters in smb.conf. *: If you wish to have a complete list of all options and how they are set: <pre>$ testparm -v</pre> ==== Using ''smbclient'' ==== <blockquote>smbclient — ftp-like client to access SMB/CIFS resources on servers</blockquote> * Connecting as a guest and list all shares <pre>$ smbclient -L localhost -N Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Sharename Type Comment --------- ---- ------- BitHalde Disk 3TB IPC$ IPC IPC Service (FileDealer) Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Server Comment --------- ------- Workgroup Master --------- ------- KLINGKLANG FILEDEALER</pre> <blockquote>-L ''host'' This option allows you to look at what services are available on a server.<br/> -N Suppresses the normal password prompt. Useful when accessing a service that does not require a password.</blockquote> * Connecting with a specified username and list all shares <pre>$ smbclient -L localhost -U evo Password: Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Sharename Type Comment --------- ---- ------- BitHalde Disk 3TB IPC$ IPC IPC Service (FileDealer) evo Disk Eigene Dateien Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Server Comment --------- ------- Workgroup Master --------- ------- KLINGKLANG FILEDEALER</pre> <blockquote>-U Sets the SMB username or username and password.</blockquote> == To Do == * alle user eintragen (cat /etc/passwd | cut -d':' -f1 | sort) * user scripte vervollständigen * masken richten + upload beim gast/evo gehört root? warum das? * was ist mit umlauten? * --> wie starten? rc.samba * Testmethoden aus dem samba buch einfügen 93ec2038537adfd5e2dbd8cd46eca4c9eb0aeb2a 447 446 2011-01-15T04:52:39Z Natex 157 /* Using testparm */ wikitext text/x-wiki [[Category:Tutorials]] ... this is a W.I.P ... will write more the next days, hope this is ok :) comments, suggestions, etc. are welcome! == Introduction == This Tutorial shows you how to configure Samba 3.0.x on Slackware 12.x. It should later act as simple and secure as it can be in a heterogen network with Windows systems (a workstation with admin access, guest accounts for the rest [eg. your friends]), a media streaming client (eg. Xbox) and Linux / *nix (Solaris / Mac OS X). I wanted to have all necessary parameters for home usage in my smb.conf so i can easily change them and have a mostly secure and stable system. Printing is disabled by default in my config, since i have no need to attach my printer to the server (the printer has its own print server: HP P2015). Also i really have no clue how to use a printer with linux. If someone wants to write something on printing then feel free to do so... == Upgrade / Build Samba == If you are here you probably will know what Samba is good for and how it works. Normally Samba is installed on your system and ready for action and doesn't need to be upgraded. === Upgrade Samba === All upgrades to Samba should be done via the patches directory on your favorite mirror. You should NOT NOT NOT mix -current packages with a non "-current" Slackware. === Building Samba === Hey! Wanna build Samba? Get the source, get the slackbuild, make a package and install it! I used the latest build from the 3.0.x fork since this comes with Slackware 12.x. You can also try building Samba 3.2.x. If you want a optimized build with a better performance that suits your system, you should consider installing GCC >4.2.4 since it supports better optimizing functions (''-march=native'' - specifying ''-march=native'' implies ''-mtune=native''. This will enable all instruction subsets supported by the local machine (hence the result might not run on different machines).) and use Samba 3.2.x cause it has a better overall performance. Only do this if you know what you are doing! * Get the source + SlackBuild, edit it and build the package... <pre>$ mkdir /tmp/samba $ cd /tmp/samba $ wget http://us3.samba.org/samba/ftp/stable/samba-3.0.31.tar.gz ... $ wget -r -nH ftp://slackware.osuosl.org/pub/slackware/slackware-current/source/n/samba $ jed samba.SlackBuild > VERSION=3.0.30 >> VERSION=3.0.31 > tar xjvf $CWD/samba-$VERSION.tar.bz2 >> tar xfvz $CWD/samba-$VERSION.tar.gz $ chmod +x samba.SlackBuild $ ./samba.SlackBuild $ upgradepkg /tmp/samba-3.0.31-i486-1.tgz</pre> == Configure Samba == There are a few requirments i had for this config. * Guest access from Windows without the need for a password * Guests are only allowed to read and have no ''home directory'' (eg. /home/guest) * Guests are only allowed to put new files in a given directory * Make everything secure as it can get with this config * Users on the system have access to their ''home directory'' * No Printing at all * Disable NetBios, we only have Windows XP or higher / *nix * Maybe more? === /etc/samba/smb.conf === This is my own ''smb.conf'' as i use it on my system. The config file itself should be selfexplaining. ==== '''smb.conf /w comments''' ==== <pre>#smb.conf - v1.1 # # Samba-3.0.30 - Slackware 12.x # e.v.o ( e.v.o [A-T] gmx.net ) # # ; COMMENT # #PARAMETER ( name = default value ) # Normally every parameter should have its default value. # If the parameter is commented out then it is the default value, # otherwise you should have a look at "man smb.conf" # # This config is based on the smb.conf manual page # and "Using Samba, 3rd Edition" from O'Reilly # # VARIABLE SUBSTITUTIONS ; %U session username ; %G primary group name of %U ; %h the Internet hostname that Samba is running on ; %m the NetBIOS name of the client machine (very useful) ; %L the NetBIOS name of the server ; %M the Internet name of the client machine ; %R the selected protocol level after protocol negotiation ; %d the process id of the current server process ; %a the architecture of the remote machine ; %I the IP address of the client machine ; %i the local IP address to which a client connected ; %T the current date and time ; %D name of the domain or workgroup of the current user ; %w the winbind separator ; %v Samba version number ; ; The following substitutes apply only to some configuration options ; Only those that are used when a connection has been established ; ; %S the name of the current service, if any ; %P the root directory of the current service, if any ; %u username of the current service, if any ; %g primary group name of %u ; %H the home directory of the user given by %u ; %N the name of your NIS home directory server ; %p the path of the service's home directory [global] ; Parameters in this section apply to the server as a whole ; ### USERSHARES ### # Capability for non-root users to ; ==================== # add/modify/delete own share definitions ; ; Controls if usershares can permit guest access #usershare allow guests = ; Maximum number of user defined shares allowed #usershare max shares = ; If set only directories owned by the sharing user can be shared #usershare owner only = ; Directory containing the user defined share definitions #usershare path = ; Comma-separated list restricting what directories can be shared #usershare prefix allow list = ; Comma-separated list restricting what directories can be shared #usershare prefix deny list = ; Pre-existing share used as a template for creating new usershares #usershare template share = ; ### NAME MANGLING ### # By default, Samba has the same ; ======================= # semantics as a Windows NT server ; ; Filenames are case sensitive #case sensitive = auto ; Default case for new filenames #default case = lower ; New files are created with the case that the client passes #preserve case = yes ; New files which conform to 8.3 syntax are created upper case #short preserve case = yes ; ### PRINTING ### ; ================== ; ; All printers in the printcap will be loaded for browsing by default load printers = no ; Only applicable if printing is set to cups. #cups server = "" ; Show the "Add Printer Wizard" Dialog show add printer wizard = no ; Yes = open, write to and submit spool files on the specified directory printable = no ; =============================== ; # - S E T T I N G S - # ; =============================== ; \-= USER SCRIPTS =-/ # These scripts are used on a PDC or stand-alone ; ==================== # machine to add or delete corresponding unix accounts ; Script that will be run when a new group is requested #add group script = /usr/sbin/groupadd %g ; Script that will be run when a machine is added to Samba's domain #add machine script = /usr/sbin/adduser -s /bin/false -d /dev/null %u -n -g machines -c Machine ; Script which will add a new service definition to smb.conf #add share command = ; Script which will add a new user #add user script = /usr/sbin/useradd -m %u ; Script that will be called when a user is added to a group #add user to group script = /usr/sbin/usermod -G %g %u ; Script which will modify an existing service definition in smb.conf #change share command = ; Script when a group is requested to be deleted #delete group script = /usr/sbin/groupdel %g ; Script when a user is removed from a group using the Windows NT domain administration tools #delete user from group script = /usr/sbin/deluser %u %g ; Script that will be run when managing users with remote RPC (NT) tools #delete user script = /usr/sbin/userdel -r %u ; Script that will be run under special circumstances #rename user script = no ; This script sets the primary group in the unix userdatase when an administrator sets the ; primary group from the windows user manager or when fetching a SAM with net rpc vampire #set primary group script = /usr/sbin/usermod -g '%g' '%u' ; Program that can be used to set UNIX user passwords #passwd program = /usr/bin/passwd %u ; Controls the "chat" conversation between smbd and the local password changing program #passwd chat = "*New password:*" %n\r "*New password (again):*" %n\r \ "*Password changed*" ; \-= PERMISSION MASKS =-/ ; ======================== #inherit owner = no #inherit permissions = no #directory mask = 0755 #directory security mask = 0777 #force create mode = 000 #force directory mode = 000 #force directory security mode = 0 #force security mode = 0 #security mask = 0777 ; \-= USER PARAMETER =-/ ; ====================== ; List of users who will be granted administrative privileges on the share admin users = evo ; This is a list of users that should be allowed to login to this service valid users = evo guest ; This is a list of users that should not be allowed to login to this service invalid users = root nobody ftp adm apache bin daemon games gdm haldaemon halt lp mail messagebus mysql news operator pop rpc shutdown smmsp sshd sync uucp ; This is a list of users that are given read-only access to a service read list = evo guest ; This is a list of users that are given read-write access to a service write list = evo ; -= Guest Settings =- ; Username which will be used for access to services which are specified as guest ok guest account = guest ; Yes for a service, then no password is required to connect to the service guest ok = no ; Yes for a service, then only guest connections to the service are permitted guest only = no ; -= Forced User/Group Settings =- ; UNIX user name that will be assigned as the default user for all users ;force user = guest ; UNIX group name that will be assigned as the default primary group for all users force group = users ; -= Map Settings =- ; Specify a file containing a mapping of usernames from the clients to the server #username map = ; #map acl inherit = no #map archive = yes #map hidden = #map read only = yes #map system = no map to guest = Bad User ; \-= SHARE PARAMETER =-/ ; ======================= ; Lets you "turn off" a service. If available = no, then ALL attempts to connect to the service will fail available = yes ; Controls whether this share is seen in the list of available shares in a net view and in the browse list browseable = yes ; Allow or disallow client access to accounts that have null passwords #null password = no ; If this parameter is yes, then users of a service may not create or modify files in the service's directory read only = yes ; Setting this parameter to no prevents any file or directory that is a symbolic link from being followed follow symlinks = no ; This parameter controls whether or not links in the UNIX file system may be followed by the server wide links = no ; This parameter specifies the name of a service which will be connected to if the service actually requested cannot be found #default service = ; This parameter allows you to specify a comma-delimited list of directories that the server should always show as empty dont descend = /bin,/boot,/dev,/etc,/lib,/opt,/proc,/sbin,/srv,/sys,/tmp,/usr,/var ; -= Hide Files =- ; This is a boolean parameter that controls whether files starting with a dot appear as hidden files #hide dot files = yes ; This is a list of files or directories that are not visible but are accessible #hide files = ; This parameter prevents clients from seeing special files such as sockets, devices and fifo's in directory listings #hide special files = no ; This parameter prevents clients from seeing the existance of files that cannot be read #hide unreadable = no ; This parameter prevents clients from seeing the existance of files that cannot be written to #hide unwriteable files = no ; \-= WINDOWS PARAMETER =-/ ; ========================= ; Specifies the charset that samba will use to print messages to stdout and stderr #display charset = "LOCALE" or "ASCII" (depending on the system) ; This option specifies which charset Samba should talk to DOS clients #dos charset = # No default ; Enabling this parameter allows a user who has write access to the file (by whatever means) to modify the permissions #dos filemode = no ; \-= NETWORK/CONNECTION PARAMETER =-/ ; ==================================== ; This controls what workgroup your server will appear to be in when queried by clients workgroup = KlingKlang ; This controls what string will show up in the printer comment box in print manager and next to the IPC connection in net view server string = FileDealer ; This sets the NetBIOS name by which a Samba server is known netbios name = FileDealer #netbios aliases = ; -= Interface Settings =- ; This parameter is a comma, space, or tab delimited set of hosts which are permitted to access a service hosts allow = 127.0.0.1 192.168. hosts deny = ALL ; -= Connection Options =- ; Represents the number of minutes of inactivity before a connection is considered dead and disconnected #deadtime = 0 ; The value of the parameter (an integer) represents the number of seconds between keepalive packets #keepalive = 300 ; This option allows the number of simultaneous connections to a service #max connections = 0 ; This option allows you to set socket options to be used when talking with the client socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 ; \-= OTHER PARAMETER =-/ ; ======================= security = user ; Enabling this parameter will disable netbios support in Samba disable netbios = yes ; Do a lookup with the DNS server dns proxy = no ; -= SMBpasswd Settings =- ; This option allows the administrator to chose which backend will be used for storing user and possibly group information #passdb backend = smbpasswd:/etc/samba/private/smbpasswd ; This option sets the path to the encrypted smbpasswd file #smb passwd file = /etc/samba/private/smbpasswd ; -= Directory Settings =- ; This option specifies the directory where lock files will be placed #lock directory = /var/lock ; This parameters defines the directory smbd will use for storing such files as smbpasswd and secrets.tdb #private dir = /etc/samba/private ; -= Logging Settings =- ; This option allows you to override the name of the Samba log file log file = /var/log/samba/samba.%m ; This option (an integer in kilobytes) specifies the max size the log file should grow to max log size = 5000 ; Parameter maps how Samba debug messages are logged onto the system #syslog = 1 ; Parameter is set then Samba debug messages are logged into the system syslog only #syslog only = no ; Using the following line enables you to customise your configuration on a per machine ; basis. The %m gets replaced with the netbios name of the machine that is connecting. ; Note: Consider carefully the location in the configuration file of ; this line. The included file is read at that point. #include = /etc/samba/smb.conf.%m ; =========================== ; # - S H A R E S - # ; =========================== [homes] comment = Eigene Dateien guest ok = yes read only = no browseable = no [printers] comment = Drucker path = /var/spool/samba browseable = no available = no guest ok = no printable = yes [BitHalde] comment = 3TB path = /mnt/raid guest ok = yes read only = yes </pre> ==== smb.conf w/o comments ==== <pre>[global] workgroup = KLINGKLANG server string = FileDealer map to guest = Bad User guest account = guest log file = /var/log/samba/samba.%m disable netbios = Yes socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 load printers = No show add printer wizard = No dns proxy = No invalid users = root, nobody, ftp, adm, apache, bin, daemon, games, gdm, haldaemon, halt, lp, mail, messagebus, mysql, news, operator, pop, rpc, shutdown, smmsp, sshd, sync, uucp valid users = evo, guest admin users = evo read list = evo, guest write list = evo force group = users hosts allow = 127.0.0.1, 192.168. hosts deny = ALL wide links = No follow symlinks = No dont descend = /bin,/boot,/dev,/etc,/lib,/opt,/proc,/sbin,/srv,/sys,/tmp,/usr,/var [homes] comment = Eigene Dateien read only = No guest ok = Yes browseable = No [printers] comment = Drucker path = /var/spool/samba printable = Yes browseable = No available = No [BitHalde] comment = 3TB path = /mnt/raid guest ok = Yes </pre> == Using Samba == In this section we will have a look on how to restart, stop, and start the samba server. === Starting and Stopping Samba === In Slackware, the script /etc/rc.d/rc.samba controls the state of the samba server. Below are the three commands you can use (as root). To restart samba use: <code>/etc/rc.d/rc.samba restart </code> To stop samba use: <code>/etc/rc.d/rc.samba stop </code> To start samba from a stopped state use: <code>/etc/rc.d/rc.samba start </code> The rc.samba script described above is merely a convenient wrapper for the /usr/sbin/smbd and /usr/sbin/nmdb commands. For example, you could also start the samba server by using these two commands together: <pre>#/usr/sbin/smbd -D #/usr/sbin/nmbd -D </pre> See the man pages for smbd and nmbd for details. == Testing and Troubleshooting == In this section we will have a look on how we test our configuration and what to do if we ran into problems. === Using ''testparm'' === <blockquote>testparm — check an smb.conf configuration file for internal correctness</blockquote> *: If your done with the setup of your ''smb.conf'' you should run ''testparm''. Do this by simply typing it ;) <pre>$ testparm Load smb config files from /etc/samba/smb.conf Processing section "[homes]" Processing section "[printers]" NOTE: Service printers is flagged unavailable. Processing section "[BitHalde]" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions</pre> :: Normally this is what the output should look like. By pressing enter you will get a list of all used parameters in smb.conf. *: If you wish to have a complete list of all options and how they are set: <pre>$ testparm -v</pre> === Using ''smbclient'' === <blockquote>smbclient — ftp-like client to access SMB/CIFS resources on servers</blockquote> * Connecting as a guest and list all shares <pre>$ smbclient -L localhost -N Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Sharename Type Comment --------- ---- ------- BitHalde Disk 3TB IPC$ IPC IPC Service (FileDealer) Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Server Comment --------- ------- Workgroup Master --------- ------- KLINGKLANG FILEDEALER</pre> <blockquote>-L ''host'' This option allows you to look at what services are available on a server.<br/> -N Suppresses the normal password prompt. Useful when accessing a service that does not require a password.</blockquote> * Connecting with a specified username and list all shares <pre>$ smbclient -L localhost -U evo Password: Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Sharename Type Comment --------- ---- ------- BitHalde Disk 3TB IPC$ IPC IPC Service (FileDealer) evo Disk Eigene Dateien Domain=[FILEDEALER] OS=[Unix] Server=[Samba 3.0.30] Server Comment --------- ------- Workgroup Master --------- ------- KLINGKLANG FILEDEALER</pre> <blockquote>-U Sets the SMB username or username and password.</blockquote> == To Do == * alle user eintragen (cat /etc/passwd | cut -d':' -f1 | sort) * user scripte vervollständigen * masken richten + upload beim gast/evo gehört root? warum das? * was ist mit umlauten? * --> wie starten? rc.samba * Testmethoden aus dem samba buch einfügen 1804b150b44482aa3e18e419c452807b72f2c872 The Regulars 0 4 448 305 2011-01-15T13:35:41Z Natex 157 /* Others */ wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:cpunches|cpunches]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|dchmelik]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jcm |jcm]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] * [[User:natex|natex]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. 8d3f658def79fdf6f18d6127dfe54a96990817dc 455 448 2011-02-18T08:40:05Z Merge-delete 261 /* Others */ wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:cpunches|cpunches]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|dchmelik]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jcm |jcm]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:robert-brown|robert-brown]] * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] * [[User:natex|natex]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. f3173df5d143c44b3c693fef3ec951bfb8f1dd73 User talk:Balsa 3 236 450 2011-02-03T08:28:32Z Balsa 156 Discussed arecord and got it to record some microphone audio. wikitext text/x-wiki Hi. [[User:Balsa|Balsa]] 03:28, 3 February 2011 (EST) ALSA /etc/asound.names Gives names and descriptions for ALSA hardware devices. Very useful when using arecord and its '-D, --device=NAME' command line options. /etc/asound.conf I do not know what this is currently. /etc/asound.state Ditto. strace - handy utility to see what programs are doing. strace -e file [some program and its args if relevant] - only shows file related stuff. arecord - ALSA utility to record sound. It's what I'm having trouble with, and is the subject of most of this page. sox - "Sound eXchange, the Swiss Army knife of audio manipulation" - (man sox; GNU General Public License) strace -e file arecord -v -d 5 -t au test4.au ----> <snip> Recording Sparc Audio 'test4.au' : Unsigned 8 bit, Rate 8000 Hz, Mono <snip> Very interesting, indeed. This gives us the default ALSA device used by arecord, in my case it was /dev/snd/pcmC0D0c. Cross referencing with /etc/asound.names doesn't get us far, because I still don't know the mappings between that file and the stuff in /dev/snd. Some speculation may be in order. grep -i capture -B 1 /etc/asound.names --> name 'hw:0,4' comment 'Physical Device - ALC268 Analog (Capture)' -- name 'plughw:0,4' comment 'Physical Device With Conversions - ALC268 Analog (Capture)' Hmm. Lets try: strace -e file arecord -v -d 5 -t au -D hw:0,4 test5.au This opens /dev/snd/pcmC0D4c, and says "Recording Sparc Audio 'test5.au' : Unsigned 8 bit, Rate 8000 Hz, Mono" but exits with "arecord: set_params:954: Sample format non available". strace -e file arecord -v -d 5 -t au -D hw:0,0 test5.au Same deal, but opens /dev/snd/pcmC0D0c instead. Strange, since that is the same as the default. TODO: Look at source code. Edit: nevermind. Let's try one more thing - that /etc/asound.names gave me an idea... strace -e file arecord -v -d 5 -t au -D plughw:0,0 test5.au Hot dog it worked! open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4 open("test5.au", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3 sox test5.au -d --> Lots of clipping, noisy. sox au: header size 24 is too small Input File : 'test5.au' Channels : 1 Sample Rate : 8000 Precision : 8-bit Duration : 00:05.00 = 40000 samples ~ 375 CDDA sectors Sample Encoding: 8-bit Signed Integer PCM 100% 00:05.00 [00:00.00] of 00:05.00 Out:240k [!=====|=====!]Hd:0.0 Clip:182k sox effects: rate clipped 120593 samples; decrease volume? sox sox: alsa: output clipped 61507 samples; decrease volume? Done. Aha! The recording is unsigned 8bit, but the playback was signed 8bit. How does one change this? man sox sox -u test5.au -d sox formats_i: `test5.au': overriding encoding type Sample Encoding: 8-bit Unsigned Integer PCM OK, it plays as unsigned 8bit. Success. 3df007c6d43cf94ad57e3c1dc0e78989a36bd33d 451 450 2011-02-04T03:36:51Z Balsa 156 some formatting cleanup wikitext text/x-wiki Hi. [[User:Balsa|Balsa]] 03:28, 3 February 2011 (EST) == ALSA == /etc/asound.names<br/> Gives names and descriptions for ALSA hardware devices. Very useful when using arecord and its '-D, --device=NAME' command line options. /etc/asound.conf<br/> I do not know what this is currently. /etc/asound.state<br/> Ditto. strace - handy utility to see what programs are doing. strace -e file [some program and its args if relevant] - only shows file related stuff. arecord - ALSA utility to record sound. It's what I'm having trouble with, and is the subject of most of this page. sox - "Sound eXchange, the Swiss Army knife of audio manipulation" - (man sox; GNU General Public License) strace -e file arecord -v -d 5 -t au test4.au ----> <snip><br/> Recording Sparc Audio 'test4.au' : Unsigned 8 bit, Rate 8000 Hz, Mono <snip><br/> Very interesting, indeed. This gives us the default ALSA device used by arecord, in my case it was /dev/snd/pcmC0D0c. Cross referencing with /etc/asound.names doesn't get us far, because I still don't know the mappings between that file and the stuff in /dev/snd. Some speculation may be in order. grep -i capture -B 1 /etc/asound.names --> <br/> name 'hw:0,4'<br/> comment 'Physical Device - ALC268 Analog (Capture)'<br/> --<br/> name 'plughw:0,4'<br/> comment 'Physical Device With Conversions - ALC268 Analog (Capture)'<br/> Hmm. Lets try: strace -e file arecord -v -d 5 -t au -D hw:0,4 test5.au<br/> This opens /dev/snd/pcmC0D4c, and says "Recording Sparc Audio 'test5.au' : Unsigned 8 bit, Rate 8000 Hz, Mono" but exits with "arecord: set_params:954: Sample format non available". strace -e file arecord -v -d 5 -t au -D hw:0,0 test5.au<br/> Same deal, but opens /dev/snd/pcmC0D0c instead. Strange, since that is the same as the default. TODO: Look at source code. Edit: nevermind. Let's try one more thing - that /etc/asound.names gave me an idea...<br/> strace -e file arecord -v -d 5 -t au -D plughw:0,0 test5.au<br/> Hot dog it worked!<br/> open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4<br/> open("test5.au", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3<br/> sox test5.au -d --> Lots of clipping, noisy.<br/> sox au: header size 24 is too small Input File : 'test5.au'<br/> Channels : 1<br/> Sample Rate : 8000<br/> Precision : 8-bit<br/> Duration : 00:05.00 = 40000 samples ~ 375 CDDA sectors<br/> Sample Encoding: 8-bit Signed Integer PCM<br/> 100% 00:05.00 [00:00.00] of 00:05.00 Out:240k [!=====|=====!]Hd:0.0 Clip:182k<br/> sox effects: rate clipped 120593 samples; decrease volume?<br/> sox sox: alsa: output clipped 61507 samples; decrease volume?<br/> Done.<br/> Aha! The recording is unsigned 8bit, but the playback was signed 8bit. How does one change this? man sox sox -u test5.au -d<br/> sox formats_i: `test5.au': overriding encoding type<br/> Sample Encoding: 8-bit Unsigned Integer PCM<br/> OK, it plays as unsigned 8bit. Success.<br/> 386afcef9cc942ef98d54e3fb4fde0df800f5647 452 451 2011-02-04T03:46:40Z Balsa 156 more formatting cleanup wikitext text/x-wiki Hi. [[User:Balsa|Balsa]] 03:28, 3 February 2011 (EST) == ALSA == /etc/asound.names<br/> Gives names and descriptions for ALSA hardware devices. Very useful when using arecord and its '-D, --device=NAME' command line options. /etc/asound.conf<br/> I do not know what this is currently. /etc/asound.state<br/> Ditto. strace - handy utility to see what programs are doing. strace -e file [some program and its args if relevant] - only shows file related stuff. arecord - ALSA utility to record sound. It's what I'm having trouble with, and is the subject of most of this page. sox - "Sound eXchange, the Swiss Army knife of audio manipulation" - (man sox; GNU General Public License) strace -e file arecord -v -d 5 -t au test4.au ----> <snip><br/> Recording Sparc Audio 'test4.au' : Unsigned 8 bit, Rate 8000 Hz, Mono <snip><br/> Very interesting, indeed. This gives us the default ALSA device used by arecord, in my case it was /dev/snd/pcmC0D0c. Cross referencing with /etc/asound.names doesn't get us far, because I still don't know the mappings between that file and the stuff in /dev/snd. Some speculation may be in order. grep -i capture -B 1 /etc/asound.names --> <br/> name 'hw:0,4'<br/> comment 'Physical Device - ALC268 Analog (Capture)'<br/> --<br/> name 'plughw:0,4'<br/> comment 'Physical Device With Conversions - ALC268 Analog (Capture)'<br/> Hmm. Lets try: strace -e file arecord -v -d 5 -t au -D hw:0,4 test5.au<br/> This opens /dev/snd/pcmC0D4c, and says "Recording Sparc Audio 'test5.au' : Unsigned 8 bit, Rate 8000 Hz, Mono" but exits with "arecord: set_params:954: Sample format non available". strace -e file arecord -v -d 5 -t au -D hw:0,0 test5.au<br/> Same deal, but opens /dev/snd/pcmC0D0c instead. Strange, since that is the same as the default. TODO: Look at source code. Edit: nevermind. Let's try one more thing - that /etc/asound.names gave me an idea...<br/> strace -e file arecord -v -d 5 -t au -D plughw:0,0 test5.au<br/> Hot dog it worked!<br/> open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4<br/> open("test5.au", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3<br/> sox test5.au -d --> Lots of clipping, noisy.<br/> sox au: header size 24 is too small Input File : 'test5.au'<br/> Channels : 1<br/> Sample Rate : 8000<br/> Precision : 8-bit<br/> Duration : 00:05.00 = 40000 samples ~ 375 CDDA sectors<br/> Sample Encoding: 8-bit Signed Integer PCM<br/> 100% 00:05.00 [00:00.00] of 00:05.00 Out:240k [!=====|=====!]Hd:0.0 Clip:182k<br/> sox effects: rate clipped 120593 samples; decrease volume?<br/> sox sox: alsa: output clipped 61507 samples; decrease volume?<br/> Done.<br/> Aha! The recording is unsigned 8bit, but the playback was signed 8bit. How does one change this? man sox sox -u test5.au -d<br/> sox formats_i: `test5.au': overriding encoding type<br/> Sample Encoding: 8-bit Unsigned Integer PCM<br/> OK, it plays as unsigned 8bit. Success.<br/> 7b03d1d213fa91ba642f4ac855deb295299c2ae9 457 452 2011-02-20T21:15:06Z Balsa 156 /* Simple tests from command line */ new section wikitext text/x-wiki Hi. [[User:Balsa|Balsa]] 03:28, 3 February 2011 (EST) == ALSA == /etc/asound.names<br/> Gives names and descriptions for ALSA hardware devices. Very useful when using arecord and its '-D, --device=NAME' command line options. /etc/asound.conf<br/> I do not know what this is currently. /etc/asound.state<br/> Ditto. strace - handy utility to see what programs are doing. strace -e file [some program and its args if relevant] - only shows file related stuff. arecord - ALSA utility to record sound. It's what I'm having trouble with, and is the subject of most of this page. sox - "Sound eXchange, the Swiss Army knife of audio manipulation" - (man sox; GNU General Public License) strace -e file arecord -v -d 5 -t au test4.au ----> <snip><br/> Recording Sparc Audio 'test4.au' : Unsigned 8 bit, Rate 8000 Hz, Mono <snip><br/> Very interesting, indeed. This gives us the default ALSA device used by arecord, in my case it was /dev/snd/pcmC0D0c. Cross referencing with /etc/asound.names doesn't get us far, because I still don't know the mappings between that file and the stuff in /dev/snd. Some speculation may be in order. grep -i capture -B 1 /etc/asound.names --> <br/> name 'hw:0,4'<br/> comment 'Physical Device - ALC268 Analog (Capture)'<br/> --<br/> name 'plughw:0,4'<br/> comment 'Physical Device With Conversions - ALC268 Analog (Capture)'<br/> Hmm. Lets try: strace -e file arecord -v -d 5 -t au -D hw:0,4 test5.au<br/> This opens /dev/snd/pcmC0D4c, and says "Recording Sparc Audio 'test5.au' : Unsigned 8 bit, Rate 8000 Hz, Mono" but exits with "arecord: set_params:954: Sample format non available". strace -e file arecord -v -d 5 -t au -D hw:0,0 test5.au<br/> Same deal, but opens /dev/snd/pcmC0D0c instead. Strange, since that is the same as the default. TODO: Look at source code. Edit: nevermind. Let's try one more thing - that /etc/asound.names gave me an idea...<br/> strace -e file arecord -v -d 5 -t au -D plughw:0,0 test5.au<br/> Hot dog it worked!<br/> open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4<br/> open("test5.au", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3<br/> sox test5.au -d --> Lots of clipping, noisy.<br/> sox au: header size 24 is too small Input File : 'test5.au'<br/> Channels : 1<br/> Sample Rate : 8000<br/> Precision : 8-bit<br/> Duration : 00:05.00 = 40000 samples ~ 375 CDDA sectors<br/> Sample Encoding: 8-bit Signed Integer PCM<br/> 100% 00:05.00 [00:00.00] of 00:05.00 Out:240k [!=====|=====!]Hd:0.0 Clip:182k<br/> sox effects: rate clipped 120593 samples; decrease volume?<br/> sox sox: alsa: output clipped 61507 samples; decrease volume?<br/> Done.<br/> Aha! The recording is unsigned 8bit, but the playback was signed 8bit. How does one change this? man sox sox -u test5.au -d<br/> sox formats_i: `test5.au': overriding encoding type<br/> Sample Encoding: 8-bit Unsigned Integer PCM<br/> OK, it plays as unsigned 8bit. Success.<br/> == Simple tests from command line == netstat - man netstat look for services that you don't know, read their manual pages. See if the service would be better listening to fewer interfaces [like localhost]. Use the ps command to figure out what's running. Try the netstat flags "--inet -anp" and read what they mean in the netstat manual. look at /etc/fstab man fstab man mount Read a security article [fixme] about this file and the options. Skim the LVM and partitions pages here on slackwiki. Read about the noexec option (don't use this without understanding the consequences) Try "hostname --fqdn" and see what it does. Check the exim page or qmail page to see about local mail delivery. Some security tools (and other stuff too) will email you when important events occur. Read about the sudo and su commands. --[[User:Balsa|Balsa]] 16:15, 20 February 2011 (EST) a4f907968d137e4dcdd5bfaacffc816dbb6f14e9 458 457 2011-02-20T22:24:21Z Balsa 156 /* Exim - local mail only - setup and testing */ new section wikitext text/x-wiki Hi. [[User:Balsa|Balsa]] 03:28, 3 February 2011 (EST) == ALSA == /etc/asound.names<br/> Gives names and descriptions for ALSA hardware devices. Very useful when using arecord and its '-D, --device=NAME' command line options. /etc/asound.conf<br/> I do not know what this is currently. /etc/asound.state<br/> Ditto. strace - handy utility to see what programs are doing. strace -e file [some program and its args if relevant] - only shows file related stuff. arecord - ALSA utility to record sound. It's what I'm having trouble with, and is the subject of most of this page. sox - "Sound eXchange, the Swiss Army knife of audio manipulation" - (man sox; GNU General Public License) strace -e file arecord -v -d 5 -t au test4.au ----> <snip><br/> Recording Sparc Audio 'test4.au' : Unsigned 8 bit, Rate 8000 Hz, Mono <snip><br/> Very interesting, indeed. This gives us the default ALSA device used by arecord, in my case it was /dev/snd/pcmC0D0c. Cross referencing with /etc/asound.names doesn't get us far, because I still don't know the mappings between that file and the stuff in /dev/snd. Some speculation may be in order. grep -i capture -B 1 /etc/asound.names --> <br/> name 'hw:0,4'<br/> comment 'Physical Device - ALC268 Analog (Capture)'<br/> --<br/> name 'plughw:0,4'<br/> comment 'Physical Device With Conversions - ALC268 Analog (Capture)'<br/> Hmm. Lets try: strace -e file arecord -v -d 5 -t au -D hw:0,4 test5.au<br/> This opens /dev/snd/pcmC0D4c, and says "Recording Sparc Audio 'test5.au' : Unsigned 8 bit, Rate 8000 Hz, Mono" but exits with "arecord: set_params:954: Sample format non available". strace -e file arecord -v -d 5 -t au -D hw:0,0 test5.au<br/> Same deal, but opens /dev/snd/pcmC0D0c instead. Strange, since that is the same as the default. TODO: Look at source code. Edit: nevermind. Let's try one more thing - that /etc/asound.names gave me an idea...<br/> strace -e file arecord -v -d 5 -t au -D plughw:0,0 test5.au<br/> Hot dog it worked!<br/> open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4<br/> open("test5.au", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3<br/> sox test5.au -d --> Lots of clipping, noisy.<br/> sox au: header size 24 is too small Input File : 'test5.au'<br/> Channels : 1<br/> Sample Rate : 8000<br/> Precision : 8-bit<br/> Duration : 00:05.00 = 40000 samples ~ 375 CDDA sectors<br/> Sample Encoding: 8-bit Signed Integer PCM<br/> 100% 00:05.00 [00:00.00] of 00:05.00 Out:240k [!=====|=====!]Hd:0.0 Clip:182k<br/> sox effects: rate clipped 120593 samples; decrease volume?<br/> sox sox: alsa: output clipped 61507 samples; decrease volume?<br/> Done.<br/> Aha! The recording is unsigned 8bit, but the playback was signed 8bit. How does one change this? man sox sox -u test5.au -d<br/> sox formats_i: `test5.au': overriding encoding type<br/> Sample Encoding: 8-bit Unsigned Integer PCM<br/> OK, it plays as unsigned 8bit. Success.<br/> == Simple tests from command line == netstat - man netstat look for services that you don't know, read their manual pages. See if the service would be better listening to fewer interfaces [like localhost]. Use the ps command to figure out what's running. Try the netstat flags "--inet -anp" and read what they mean in the netstat manual. look at /etc/fstab man fstab man mount Read a security article [fixme] about this file and the options. Skim the LVM and partitions pages here on slackwiki. Read about the noexec option (don't use this without understanding the consequences) Try "hostname --fqdn" and see what it does. Check the exim page or qmail page to see about local mail delivery. Some security tools (and other stuff too) will email you when important events occur. Read about the sudo and su commands. --[[User:Balsa|Balsa]] 16:15, 20 February 2011 (EST) == Exim - local mail only - setup and testing == Setup: not written yet. Testing / Debugging: The following are draft quality only. ps -efw | grep -i -e exim | grep -v grep #Lists running exim processes. netstat --inet -anp | grep -i -e exim -e 25 -e mail #See if anything is listening on port 25. ls -l /var/log look for mail or exim4 directory, and mail.??? and mail.???? files. ls -l /var/ look for mail, queue, or spool. Do a ls -l in any directories found above. Mail might be in ~/Mail Read the Mutt HOWTO on slackwiki.org. Read the qmail HOWTO as well. tail -f /var/log/exim4/mainlog (if it exists) The -f flag makes tail follow the file, so its best used on another virtual console or with screen. There are numerous guides for screen. My suggestion is to printout the most common commands on paper and keep it near your monitor. Try the mail command out. man mail echo "Testing local mail, sent on `date` to the local system" \ | mail -s "Test of Local Mail" username@localhost.localdomain Note that username@localhost.localdomain may not work. Try hostname --fqdn look in /etc/hosts Testing the MTA with telnet on a certain port: telnet localhost 25 HELO localhost MAIL FROM: username@localhost.localdomain RCPT TO: username@localhost.localdomain DATA SUBJECT: Testing mail via telnet This is the message body. Check if it worked with your favorite mail reader or by looking in the files listed above. End message body with a "." on a line by itself. . QUIT Once local mail delivery works, you can setup cron jobs (see cron page on slackwiki, and man cron) and the output (if any) will be mailed to you. c97e3de5ae6a7bdb72b13b5ecc771c1303fe505e 459 458 2011-02-21T18:17:52Z Balsa 156 /* Octave: simple functions */ new section wikitext text/x-wiki Hi. [[User:Balsa|Balsa]] 03:28, 3 February 2011 (EST) == ALSA == /etc/asound.names<br/> Gives names and descriptions for ALSA hardware devices. Very useful when using arecord and its '-D, --device=NAME' command line options. /etc/asound.conf<br/> I do not know what this is currently. /etc/asound.state<br/> Ditto. strace - handy utility to see what programs are doing. strace -e file [some program and its args if relevant] - only shows file related stuff. arecord - ALSA utility to record sound. It's what I'm having trouble with, and is the subject of most of this page. sox - "Sound eXchange, the Swiss Army knife of audio manipulation" - (man sox; GNU General Public License) strace -e file arecord -v -d 5 -t au test4.au ----> <snip><br/> Recording Sparc Audio 'test4.au' : Unsigned 8 bit, Rate 8000 Hz, Mono <snip><br/> Very interesting, indeed. This gives us the default ALSA device used by arecord, in my case it was /dev/snd/pcmC0D0c. Cross referencing with /etc/asound.names doesn't get us far, because I still don't know the mappings between that file and the stuff in /dev/snd. Some speculation may be in order. grep -i capture -B 1 /etc/asound.names --> <br/> name 'hw:0,4'<br/> comment 'Physical Device - ALC268 Analog (Capture)'<br/> --<br/> name 'plughw:0,4'<br/> comment 'Physical Device With Conversions - ALC268 Analog (Capture)'<br/> Hmm. Lets try: strace -e file arecord -v -d 5 -t au -D hw:0,4 test5.au<br/> This opens /dev/snd/pcmC0D4c, and says "Recording Sparc Audio 'test5.au' : Unsigned 8 bit, Rate 8000 Hz, Mono" but exits with "arecord: set_params:954: Sample format non available". strace -e file arecord -v -d 5 -t au -D hw:0,0 test5.au<br/> Same deal, but opens /dev/snd/pcmC0D0c instead. Strange, since that is the same as the default. TODO: Look at source code. Edit: nevermind. Let's try one more thing - that /etc/asound.names gave me an idea...<br/> strace -e file arecord -v -d 5 -t au -D plughw:0,0 test5.au<br/> Hot dog it worked!<br/> open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4<br/> open("test5.au", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3<br/> sox test5.au -d --> Lots of clipping, noisy.<br/> sox au: header size 24 is too small Input File : 'test5.au'<br/> Channels : 1<br/> Sample Rate : 8000<br/> Precision : 8-bit<br/> Duration : 00:05.00 = 40000 samples ~ 375 CDDA sectors<br/> Sample Encoding: 8-bit Signed Integer PCM<br/> 100% 00:05.00 [00:00.00] of 00:05.00 Out:240k [!=====|=====!]Hd:0.0 Clip:182k<br/> sox effects: rate clipped 120593 samples; decrease volume?<br/> sox sox: alsa: output clipped 61507 samples; decrease volume?<br/> Done.<br/> Aha! The recording is unsigned 8bit, but the playback was signed 8bit. How does one change this? man sox sox -u test5.au -d<br/> sox formats_i: `test5.au': overriding encoding type<br/> Sample Encoding: 8-bit Unsigned Integer PCM<br/> OK, it plays as unsigned 8bit. Success.<br/> == Simple tests from command line == netstat - man netstat look for services that you don't know, read their manual pages. See if the service would be better listening to fewer interfaces [like localhost]. Use the ps command to figure out what's running. Try the netstat flags "--inet -anp" and read what they mean in the netstat manual. look at /etc/fstab man fstab man mount Read a security article [fixme] about this file and the options. Skim the LVM and partitions pages here on slackwiki. Read about the noexec option (don't use this without understanding the consequences) Try "hostname --fqdn" and see what it does. Check the exim page or qmail page to see about local mail delivery. Some security tools (and other stuff too) will email you when important events occur. Read about the sudo and su commands. --[[User:Balsa|Balsa]] 16:15, 20 February 2011 (EST) == Exim - local mail only - setup and testing == Setup: not written yet. Testing / Debugging: The following are draft quality only. ps -efw | grep -i -e exim | grep -v grep #Lists running exim processes. netstat --inet -anp | grep -i -e exim -e 25 -e mail #See if anything is listening on port 25. ls -l /var/log look for mail or exim4 directory, and mail.??? and mail.???? files. ls -l /var/ look for mail, queue, or spool. Do a ls -l in any directories found above. Mail might be in ~/Mail Read the Mutt HOWTO on slackwiki.org. Read the qmail HOWTO as well. tail -f /var/log/exim4/mainlog (if it exists) The -f flag makes tail follow the file, so its best used on another virtual console or with screen. There are numerous guides for screen. My suggestion is to printout the most common commands on paper and keep it near your monitor. Try the mail command out. man mail echo "Testing local mail, sent on `date` to the local system" \ | mail -s "Test of Local Mail" username@localhost.localdomain Note that username@localhost.localdomain may not work. Try hostname --fqdn look in /etc/hosts Testing the MTA with telnet on a certain port: telnet localhost 25 HELO localhost MAIL FROM: username@localhost.localdomain RCPT TO: username@localhost.localdomain DATA SUBJECT: Testing mail via telnet This is the message body. Check if it worked with your favorite mail reader or by looking in the files listed above. End message body with a "." on a line by itself. . QUIT Once local mail delivery works, you can setup cron jobs (see cron page on slackwiki, and man cron) and the output (if any) will be mailed to you. == Octave: simple functions == Find the Octave tutorial by typing doc at the Octave command line.<br> Navigate to * Introduction:: A brief introduction to Octave.<br> Then go to * Simple Examples::<br> The tutorial is quite brief, and gives few examples of functions.<br> This page will demo how to make simple functions, and how to call one function from another.<br> octave:11> function fn = fn ( p )<br> > fn = p*20<br> > endfunction<br> octave:10> function sn = sn ( a )<br> > sn = a * (1/2)<br> > endfunction<br> octave:12> function tn = tn( p, a )<br> > tn = sn(a)+fn(p)<br> > endfunction<br> octave:17> function excess = excess( p, a, bs )<br> > excess = bs - tn(p,a)<br> > endfunction<br> octave:18> excess(p,a,bs)<br> sn = 517.50<br> fn = 2140<br> tn = 2657.5<br> excess = -1452.5<br> ans = -1452.5<br> octave:28> function trade = trade ( p, a, bs, lt )<br> > trade = excess(p,a,bs)/lt<br> > endfunction<br> octave:26> function newacres = newacres (p, a, bs, lt, na )<br> > newacres = a+trade(p,a,bs,lt)<br> > endfunction<br> octave:36> p=107; a=1013; bs=3017; lt=25;<br> octave:37> newacres(p,a,bs,lt,na)<br> sn = 506.50<br> fn = 2140<br> tn = 2646.5<br> excess = 370.50<br> trade = 14.820<br> newacres = 1027.8<br> ans = 1027.8<br> octave:38> p=114; a=1027; bs=3095; lt=23;<br> octave:39> newacres(p,a,bs,lt,na)<br> sn = 513.50<br> fn = 2280<br> tn = 2793.5<br> excess = 301.50<br> trade = 13.109<br> newacres = 1040.1<br> ans = 1040.1<br> --[[User:Balsa|Balsa]] 13:17, 21 February 2011 (EST) f2e51ca13cf5501c85f75a29dce6af8887873b4c 460 459 2011-02-21T18:23:27Z Balsa 156 /* Getmail */ new section wikitext text/x-wiki Hi. [[User:Balsa|Balsa]] 03:28, 3 February 2011 (EST) == ALSA == /etc/asound.names<br/> Gives names and descriptions for ALSA hardware devices. Very useful when using arecord and its '-D, --device=NAME' command line options. /etc/asound.conf<br/> I do not know what this is currently. /etc/asound.state<br/> Ditto. strace - handy utility to see what programs are doing. strace -e file [some program and its args if relevant] - only shows file related stuff. arecord - ALSA utility to record sound. It's what I'm having trouble with, and is the subject of most of this page. sox - "Sound eXchange, the Swiss Army knife of audio manipulation" - (man sox; GNU General Public License) strace -e file arecord -v -d 5 -t au test4.au ----> <snip><br/> Recording Sparc Audio 'test4.au' : Unsigned 8 bit, Rate 8000 Hz, Mono <snip><br/> Very interesting, indeed. This gives us the default ALSA device used by arecord, in my case it was /dev/snd/pcmC0D0c. Cross referencing with /etc/asound.names doesn't get us far, because I still don't know the mappings between that file and the stuff in /dev/snd. Some speculation may be in order. grep -i capture -B 1 /etc/asound.names --> <br/> name 'hw:0,4'<br/> comment 'Physical Device - ALC268 Analog (Capture)'<br/> --<br/> name 'plughw:0,4'<br/> comment 'Physical Device With Conversions - ALC268 Analog (Capture)'<br/> Hmm. Lets try: strace -e file arecord -v -d 5 -t au -D hw:0,4 test5.au<br/> This opens /dev/snd/pcmC0D4c, and says "Recording Sparc Audio 'test5.au' : Unsigned 8 bit, Rate 8000 Hz, Mono" but exits with "arecord: set_params:954: Sample format non available". strace -e file arecord -v -d 5 -t au -D hw:0,0 test5.au<br/> Same deal, but opens /dev/snd/pcmC0D0c instead. Strange, since that is the same as the default. TODO: Look at source code. Edit: nevermind. Let's try one more thing - that /etc/asound.names gave me an idea...<br/> strace -e file arecord -v -d 5 -t au -D plughw:0,0 test5.au<br/> Hot dog it worked!<br/> open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4<br/> open("test5.au", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3<br/> sox test5.au -d --> Lots of clipping, noisy.<br/> sox au: header size 24 is too small Input File : 'test5.au'<br/> Channels : 1<br/> Sample Rate : 8000<br/> Precision : 8-bit<br/> Duration : 00:05.00 = 40000 samples ~ 375 CDDA sectors<br/> Sample Encoding: 8-bit Signed Integer PCM<br/> 100% 00:05.00 [00:00.00] of 00:05.00 Out:240k [!=====|=====!]Hd:0.0 Clip:182k<br/> sox effects: rate clipped 120593 samples; decrease volume?<br/> sox sox: alsa: output clipped 61507 samples; decrease volume?<br/> Done.<br/> Aha! The recording is unsigned 8bit, but the playback was signed 8bit. How does one change this? man sox sox -u test5.au -d<br/> sox formats_i: `test5.au': overriding encoding type<br/> Sample Encoding: 8-bit Unsigned Integer PCM<br/> OK, it plays as unsigned 8bit. Success.<br/> == Simple tests from command line == netstat - man netstat look for services that you don't know, read their manual pages. See if the service would be better listening to fewer interfaces [like localhost]. Use the ps command to figure out what's running. Try the netstat flags "--inet -anp" and read what they mean in the netstat manual. look at /etc/fstab man fstab man mount Read a security article [fixme] about this file and the options. Skim the LVM and partitions pages here on slackwiki. Read about the noexec option (don't use this without understanding the consequences) Try "hostname --fqdn" and see what it does. Check the exim page or qmail page to see about local mail delivery. Some security tools (and other stuff too) will email you when important events occur. Read about the sudo and su commands. --[[User:Balsa|Balsa]] 16:15, 20 February 2011 (EST) == Exim - local mail only - setup and testing == Setup: not written yet. Testing / Debugging: The following are draft quality only. ps -efw | grep -i -e exim | grep -v grep #Lists running exim processes. netstat --inet -anp | grep -i -e exim -e 25 -e mail #See if anything is listening on port 25. ls -l /var/log look for mail or exim4 directory, and mail.??? and mail.???? files. ls -l /var/ look for mail, queue, or spool. Do a ls -l in any directories found above. Mail might be in ~/Mail Read the Mutt HOWTO on slackwiki.org. Read the qmail HOWTO as well. tail -f /var/log/exim4/mainlog (if it exists) The -f flag makes tail follow the file, so its best used on another virtual console or with screen. There are numerous guides for screen. My suggestion is to printout the most common commands on paper and keep it near your monitor. Try the mail command out. man mail echo "Testing local mail, sent on `date` to the local system" \ | mail -s "Test of Local Mail" username@localhost.localdomain Note that username@localhost.localdomain may not work. Try hostname --fqdn look in /etc/hosts Testing the MTA with telnet on a certain port: telnet localhost 25 HELO localhost MAIL FROM: username@localhost.localdomain RCPT TO: username@localhost.localdomain DATA SUBJECT: Testing mail via telnet This is the message body. Check if it worked with your favorite mail reader or by looking in the files listed above. End message body with a "." on a line by itself. . QUIT Once local mail delivery works, you can setup cron jobs (see cron page on slackwiki, and man cron) and the output (if any) will be mailed to you. == Octave: simple functions == Find the Octave tutorial by typing doc at the Octave command line.<br> Navigate to * Introduction:: A brief introduction to Octave.<br> Then go to * Simple Examples::<br> The tutorial is quite brief, and gives few examples of functions.<br> This page will demo how to make simple functions, and how to call one function from another.<br> octave:11> function fn = fn ( p )<br> > fn = p*20<br> > endfunction<br> octave:10> function sn = sn ( a )<br> > sn = a * (1/2)<br> > endfunction<br> octave:12> function tn = tn( p, a )<br> > tn = sn(a)+fn(p)<br> > endfunction<br> octave:17> function excess = excess( p, a, bs )<br> > excess = bs - tn(p,a)<br> > endfunction<br> octave:18> excess(p,a,bs)<br> sn = 517.50<br> fn = 2140<br> tn = 2657.5<br> excess = -1452.5<br> ans = -1452.5<br> octave:28> function trade = trade ( p, a, bs, lt )<br> > trade = excess(p,a,bs)/lt<br> > endfunction<br> octave:26> function newacres = newacres (p, a, bs, lt, na )<br> > newacres = a+trade(p,a,bs,lt)<br> > endfunction<br> octave:36> p=107; a=1013; bs=3017; lt=25;<br> octave:37> newacres(p,a,bs,lt,na)<br> sn = 506.50<br> fn = 2140<br> tn = 2646.5<br> excess = 370.50<br> trade = 14.820<br> newacres = 1027.8<br> ans = 1027.8<br> octave:38> p=114; a=1027; bs=3095; lt=23;<br> octave:39> newacres(p,a,bs,lt,na)<br> sn = 513.50<br> fn = 2280<br> tn = 2793.5<br> excess = 301.50<br> trade = 13.109<br> newacres = 1040.1<br> ans = 1040.1<br> --[[User:Balsa|Balsa]] 13:17, 21 February 2011 (EST) == Getmail == One of getmail's biggest features is writing directly to Maildir. This obviates the need for a Mail Transport Agent (MTA).<br> In a getmail configuration file: [destination]<br> type = Maildir<br> path = ~/Maildir/<br> This will write your email directly to the ~/Maildir/ directory in Maildir format.<br> --[[User:Balsa|Balsa]] 13:23, 21 February 2011 (EST) 8bc5f6d507703f50ce370dc2aaffed39558086b8 461 460 2011-02-21T18:34:55Z Balsa 156 /* Redirecting stderr and stdout to a file */ new section wikitext text/x-wiki Hi. [[User:Balsa|Balsa]] 03:28, 3 February 2011 (EST) == ALSA == /etc/asound.names<br/> Gives names and descriptions for ALSA hardware devices. Very useful when using arecord and its '-D, --device=NAME' command line options. /etc/asound.conf<br/> I do not know what this is currently. /etc/asound.state<br/> Ditto. strace - handy utility to see what programs are doing. strace -e file [some program and its args if relevant] - only shows file related stuff. arecord - ALSA utility to record sound. It's what I'm having trouble with, and is the subject of most of this page. sox - "Sound eXchange, the Swiss Army knife of audio manipulation" - (man sox; GNU General Public License) strace -e file arecord -v -d 5 -t au test4.au ----> <snip><br/> Recording Sparc Audio 'test4.au' : Unsigned 8 bit, Rate 8000 Hz, Mono <snip><br/> Very interesting, indeed. This gives us the default ALSA device used by arecord, in my case it was /dev/snd/pcmC0D0c. Cross referencing with /etc/asound.names doesn't get us far, because I still don't know the mappings between that file and the stuff in /dev/snd. Some speculation may be in order. grep -i capture -B 1 /etc/asound.names --> <br/> name 'hw:0,4'<br/> comment 'Physical Device - ALC268 Analog (Capture)'<br/> --<br/> name 'plughw:0,4'<br/> comment 'Physical Device With Conversions - ALC268 Analog (Capture)'<br/> Hmm. Lets try: strace -e file arecord -v -d 5 -t au -D hw:0,4 test5.au<br/> This opens /dev/snd/pcmC0D4c, and says "Recording Sparc Audio 'test5.au' : Unsigned 8 bit, Rate 8000 Hz, Mono" but exits with "arecord: set_params:954: Sample format non available". strace -e file arecord -v -d 5 -t au -D hw:0,0 test5.au<br/> Same deal, but opens /dev/snd/pcmC0D0c instead. Strange, since that is the same as the default. TODO: Look at source code. Edit: nevermind. Let's try one more thing - that /etc/asound.names gave me an idea...<br/> strace -e file arecord -v -d 5 -t au -D plughw:0,0 test5.au<br/> Hot dog it worked!<br/> open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4<br/> open("test5.au", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3<br/> sox test5.au -d --> Lots of clipping, noisy.<br/> sox au: header size 24 is too small Input File : 'test5.au'<br/> Channels : 1<br/> Sample Rate : 8000<br/> Precision : 8-bit<br/> Duration : 00:05.00 = 40000 samples ~ 375 CDDA sectors<br/> Sample Encoding: 8-bit Signed Integer PCM<br/> 100% 00:05.00 [00:00.00] of 00:05.00 Out:240k [!=====|=====!]Hd:0.0 Clip:182k<br/> sox effects: rate clipped 120593 samples; decrease volume?<br/> sox sox: alsa: output clipped 61507 samples; decrease volume?<br/> Done.<br/> Aha! The recording is unsigned 8bit, but the playback was signed 8bit. How does one change this? man sox sox -u test5.au -d<br/> sox formats_i: `test5.au': overriding encoding type<br/> Sample Encoding: 8-bit Unsigned Integer PCM<br/> OK, it plays as unsigned 8bit. Success.<br/> == Simple tests from command line == netstat - man netstat look for services that you don't know, read their manual pages. See if the service would be better listening to fewer interfaces [like localhost]. Use the ps command to figure out what's running. Try the netstat flags "--inet -anp" and read what they mean in the netstat manual. look at /etc/fstab man fstab man mount Read a security article [fixme] about this file and the options. Skim the LVM and partitions pages here on slackwiki. Read about the noexec option (don't use this without understanding the consequences) Try "hostname --fqdn" and see what it does. Check the exim page or qmail page to see about local mail delivery. Some security tools (and other stuff too) will email you when important events occur. Read about the sudo and su commands. --[[User:Balsa|Balsa]] 16:15, 20 February 2011 (EST) == Exim - local mail only - setup and testing == Setup: not written yet. Testing / Debugging: The following are draft quality only. ps -efw | grep -i -e exim | grep -v grep #Lists running exim processes. netstat --inet -anp | grep -i -e exim -e 25 -e mail #See if anything is listening on port 25. ls -l /var/log look for mail or exim4 directory, and mail.??? and mail.???? files. ls -l /var/ look for mail, queue, or spool. Do a ls -l in any directories found above. Mail might be in ~/Mail Read the Mutt HOWTO on slackwiki.org. Read the qmail HOWTO as well. tail -f /var/log/exim4/mainlog (if it exists) The -f flag makes tail follow the file, so its best used on another virtual console or with screen. There are numerous guides for screen. My suggestion is to printout the most common commands on paper and keep it near your monitor. Try the mail command out. man mail echo "Testing local mail, sent on `date` to the local system" \ | mail -s "Test of Local Mail" username@localhost.localdomain Note that username@localhost.localdomain may not work. Try hostname --fqdn look in /etc/hosts Testing the MTA with telnet on a certain port: telnet localhost 25 HELO localhost MAIL FROM: username@localhost.localdomain RCPT TO: username@localhost.localdomain DATA SUBJECT: Testing mail via telnet This is the message body. Check if it worked with your favorite mail reader or by looking in the files listed above. End message body with a "." on a line by itself. . QUIT Once local mail delivery works, you can setup cron jobs (see cron page on slackwiki, and man cron) and the output (if any) will be mailed to you. == Octave: simple functions == Find the Octave tutorial by typing doc at the Octave command line.<br> Navigate to * Introduction:: A brief introduction to Octave.<br> Then go to * Simple Examples::<br> The tutorial is quite brief, and gives few examples of functions.<br> This page will demo how to make simple functions, and how to call one function from another.<br> octave:11> function fn = fn ( p )<br> > fn = p*20<br> > endfunction<br> octave:10> function sn = sn ( a )<br> > sn = a * (1/2)<br> > endfunction<br> octave:12> function tn = tn( p, a )<br> > tn = sn(a)+fn(p)<br> > endfunction<br> octave:17> function excess = excess( p, a, bs )<br> > excess = bs - tn(p,a)<br> > endfunction<br> octave:18> excess(p,a,bs)<br> sn = 517.50<br> fn = 2140<br> tn = 2657.5<br> excess = -1452.5<br> ans = -1452.5<br> octave:28> function trade = trade ( p, a, bs, lt )<br> > trade = excess(p,a,bs)/lt<br> > endfunction<br> octave:26> function newacres = newacres (p, a, bs, lt, na )<br> > newacres = a+trade(p,a,bs,lt)<br> > endfunction<br> octave:36> p=107; a=1013; bs=3017; lt=25;<br> octave:37> newacres(p,a,bs,lt,na)<br> sn = 506.50<br> fn = 2140<br> tn = 2646.5<br> excess = 370.50<br> trade = 14.820<br> newacres = 1027.8<br> ans = 1027.8<br> octave:38> p=114; a=1027; bs=3095; lt=23;<br> octave:39> newacres(p,a,bs,lt,na)<br> sn = 513.50<br> fn = 2280<br> tn = 2793.5<br> excess = 301.50<br> trade = 13.109<br> newacres = 1040.1<br> ans = 1040.1<br> --[[User:Balsa|Balsa]] 13:17, 21 February 2011 (EST) == Getmail == One of getmail's biggest features is writing directly to Maildir. This obviates the need for a Mail Transport Agent (MTA).<br> In a getmail configuration file: [destination]<br> type = Maildir<br> path = ~/Maildir/<br> This will write your email directly to the ~/Maildir/ directory in Maildir format.<br> --[[User:Balsa|Balsa]] 13:23, 21 February 2011 (EST) == Redirecting stderr and stdout to a file == /bin/true &> foo<br> This may be helpful in the "Piping" section here on slackwiki.<br> --[[User:Balsa|Balsa]] 13:34, 21 February 2011 (EST) 9fb8531e1b1c5ee5465c6387e08e14260705218b 462 461 2011-02-21T18:38:57Z Balsa 156 /* Sandbox and/or Editing Help pages on slackwiki? */ new section wikitext text/x-wiki Hi. [[User:Balsa|Balsa]] 03:28, 3 February 2011 (EST) == ALSA == /etc/asound.names<br/> Gives names and descriptions for ALSA hardware devices. Very useful when using arecord and its '-D, --device=NAME' command line options. /etc/asound.conf<br/> I do not know what this is currently. /etc/asound.state<br/> Ditto. strace - handy utility to see what programs are doing. strace -e file [some program and its args if relevant] - only shows file related stuff. arecord - ALSA utility to record sound. It's what I'm having trouble with, and is the subject of most of this page. sox - "Sound eXchange, the Swiss Army knife of audio manipulation" - (man sox; GNU General Public License) strace -e file arecord -v -d 5 -t au test4.au ----> <snip><br/> Recording Sparc Audio 'test4.au' : Unsigned 8 bit, Rate 8000 Hz, Mono <snip><br/> Very interesting, indeed. This gives us the default ALSA device used by arecord, in my case it was /dev/snd/pcmC0D0c. Cross referencing with /etc/asound.names doesn't get us far, because I still don't know the mappings between that file and the stuff in /dev/snd. Some speculation may be in order. grep -i capture -B 1 /etc/asound.names --> <br/> name 'hw:0,4'<br/> comment 'Physical Device - ALC268 Analog (Capture)'<br/> --<br/> name 'plughw:0,4'<br/> comment 'Physical Device With Conversions - ALC268 Analog (Capture)'<br/> Hmm. Lets try: strace -e file arecord -v -d 5 -t au -D hw:0,4 test5.au<br/> This opens /dev/snd/pcmC0D4c, and says "Recording Sparc Audio 'test5.au' : Unsigned 8 bit, Rate 8000 Hz, Mono" but exits with "arecord: set_params:954: Sample format non available". strace -e file arecord -v -d 5 -t au -D hw:0,0 test5.au<br/> Same deal, but opens /dev/snd/pcmC0D0c instead. Strange, since that is the same as the default. TODO: Look at source code. Edit: nevermind. Let's try one more thing - that /etc/asound.names gave me an idea...<br/> strace -e file arecord -v -d 5 -t au -D plughw:0,0 test5.au<br/> Hot dog it worked!<br/> open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4<br/> open("test5.au", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3<br/> sox test5.au -d --> Lots of clipping, noisy.<br/> sox au: header size 24 is too small Input File : 'test5.au'<br/> Channels : 1<br/> Sample Rate : 8000<br/> Precision : 8-bit<br/> Duration : 00:05.00 = 40000 samples ~ 375 CDDA sectors<br/> Sample Encoding: 8-bit Signed Integer PCM<br/> 100% 00:05.00 [00:00.00] of 00:05.00 Out:240k [!=====|=====!]Hd:0.0 Clip:182k<br/> sox effects: rate clipped 120593 samples; decrease volume?<br/> sox sox: alsa: output clipped 61507 samples; decrease volume?<br/> Done.<br/> Aha! The recording is unsigned 8bit, but the playback was signed 8bit. How does one change this? man sox sox -u test5.au -d<br/> sox formats_i: `test5.au': overriding encoding type<br/> Sample Encoding: 8-bit Unsigned Integer PCM<br/> OK, it plays as unsigned 8bit. Success.<br/> == Simple tests from command line == netstat - man netstat look for services that you don't know, read their manual pages. See if the service would be better listening to fewer interfaces [like localhost]. Use the ps command to figure out what's running. Try the netstat flags "--inet -anp" and read what they mean in the netstat manual. look at /etc/fstab man fstab man mount Read a security article [fixme] about this file and the options. Skim the LVM and partitions pages here on slackwiki. Read about the noexec option (don't use this without understanding the consequences) Try "hostname --fqdn" and see what it does. Check the exim page or qmail page to see about local mail delivery. Some security tools (and other stuff too) will email you when important events occur. Read about the sudo and su commands. --[[User:Balsa|Balsa]] 16:15, 20 February 2011 (EST) == Exim - local mail only - setup and testing == Setup: not written yet. Testing / Debugging: The following are draft quality only. ps -efw | grep -i -e exim | grep -v grep #Lists running exim processes. netstat --inet -anp | grep -i -e exim -e 25 -e mail #See if anything is listening on port 25. ls -l /var/log look for mail or exim4 directory, and mail.??? and mail.???? files. ls -l /var/ look for mail, queue, or spool. Do a ls -l in any directories found above. Mail might be in ~/Mail Read the Mutt HOWTO on slackwiki.org. Read the qmail HOWTO as well. tail -f /var/log/exim4/mainlog (if it exists) The -f flag makes tail follow the file, so its best used on another virtual console or with screen. There are numerous guides for screen. My suggestion is to printout the most common commands on paper and keep it near your monitor. Try the mail command out. man mail echo "Testing local mail, sent on `date` to the local system" \ | mail -s "Test of Local Mail" username@localhost.localdomain Note that username@localhost.localdomain may not work. Try hostname --fqdn look in /etc/hosts Testing the MTA with telnet on a certain port: telnet localhost 25 HELO localhost MAIL FROM: username@localhost.localdomain RCPT TO: username@localhost.localdomain DATA SUBJECT: Testing mail via telnet This is the message body. Check if it worked with your favorite mail reader or by looking in the files listed above. End message body with a "." on a line by itself. . QUIT Once local mail delivery works, you can setup cron jobs (see cron page on slackwiki, and man cron) and the output (if any) will be mailed to you. == Octave: simple functions == Find the Octave tutorial by typing doc at the Octave command line.<br> Navigate to * Introduction:: A brief introduction to Octave.<br> Then go to * Simple Examples::<br> The tutorial is quite brief, and gives few examples of functions.<br> This page will demo how to make simple functions, and how to call one function from another.<br> octave:11> function fn = fn ( p )<br> > fn = p*20<br> > endfunction<br> octave:10> function sn = sn ( a )<br> > sn = a * (1/2)<br> > endfunction<br> octave:12> function tn = tn( p, a )<br> > tn = sn(a)+fn(p)<br> > endfunction<br> octave:17> function excess = excess( p, a, bs )<br> > excess = bs - tn(p,a)<br> > endfunction<br> octave:18> excess(p,a,bs)<br> sn = 517.50<br> fn = 2140<br> tn = 2657.5<br> excess = -1452.5<br> ans = -1452.5<br> octave:28> function trade = trade ( p, a, bs, lt )<br> > trade = excess(p,a,bs)/lt<br> > endfunction<br> octave:26> function newacres = newacres (p, a, bs, lt, na )<br> > newacres = a+trade(p,a,bs,lt)<br> > endfunction<br> octave:36> p=107; a=1013; bs=3017; lt=25;<br> octave:37> newacres(p,a,bs,lt,na)<br> sn = 506.50<br> fn = 2140<br> tn = 2646.5<br> excess = 370.50<br> trade = 14.820<br> newacres = 1027.8<br> ans = 1027.8<br> octave:38> p=114; a=1027; bs=3095; lt=23;<br> octave:39> newacres(p,a,bs,lt,na)<br> sn = 513.50<br> fn = 2280<br> tn = 2793.5<br> excess = 301.50<br> trade = 13.109<br> newacres = 1040.1<br> ans = 1040.1<br> --[[User:Balsa|Balsa]] 13:17, 21 February 2011 (EST) == Getmail == One of getmail's biggest features is writing directly to Maildir. This obviates the need for a Mail Transport Agent (MTA).<br> In a getmail configuration file: [destination]<br> type = Maildir<br> path = ~/Maildir/<br> This will write your email directly to the ~/Maildir/ directory in Maildir format.<br> --[[User:Balsa|Balsa]] 13:23, 21 February 2011 (EST) == Redirecting stderr and stdout to a file == /bin/true &> foo<br> This may be helpful in the "Piping" section here on slackwiki.<br> --[[User:Balsa|Balsa]] 13:34, 21 February 2011 (EST) == Sandbox and/or Editing Help pages on slackwiki? == If anyone knows if there exists a sandbox or an Help:Editing page here on slackwiki.org, please let me know. If not, I might try to create one. Advice welcome.<br> --[[User:Balsa|Balsa]] 13:38, 21 February 2011 (EST) b4ccf609c9d65d14a47cbbbfbe4152887fbefb66 463 462 2011-02-23T07:26:21Z Balsa 156 /* NTP log file configuration documentation */ new section wikitext text/x-wiki Hi. [[User:Balsa|Balsa]] 03:28, 3 February 2011 (EST) == ALSA == /etc/asound.names<br/> Gives names and descriptions for ALSA hardware devices. Very useful when using arecord and its '-D, --device=NAME' command line options. /etc/asound.conf<br/> I do not know what this is currently. /etc/asound.state<br/> Ditto. strace - handy utility to see what programs are doing. strace -e file [some program and its args if relevant] - only shows file related stuff. arecord - ALSA utility to record sound. It's what I'm having trouble with, and is the subject of most of this page. sox - "Sound eXchange, the Swiss Army knife of audio manipulation" - (man sox; GNU General Public License) strace -e file arecord -v -d 5 -t au test4.au ----> <snip><br/> Recording Sparc Audio 'test4.au' : Unsigned 8 bit, Rate 8000 Hz, Mono <snip><br/> Very interesting, indeed. This gives us the default ALSA device used by arecord, in my case it was /dev/snd/pcmC0D0c. Cross referencing with /etc/asound.names doesn't get us far, because I still don't know the mappings between that file and the stuff in /dev/snd. Some speculation may be in order. grep -i capture -B 1 /etc/asound.names --> <br/> name 'hw:0,4'<br/> comment 'Physical Device - ALC268 Analog (Capture)'<br/> --<br/> name 'plughw:0,4'<br/> comment 'Physical Device With Conversions - ALC268 Analog (Capture)'<br/> Hmm. Lets try: strace -e file arecord -v -d 5 -t au -D hw:0,4 test5.au<br/> This opens /dev/snd/pcmC0D4c, and says "Recording Sparc Audio 'test5.au' : Unsigned 8 bit, Rate 8000 Hz, Mono" but exits with "arecord: set_params:954: Sample format non available". strace -e file arecord -v -d 5 -t au -D hw:0,0 test5.au<br/> Same deal, but opens /dev/snd/pcmC0D0c instead. Strange, since that is the same as the default. TODO: Look at source code. Edit: nevermind. Let's try one more thing - that /etc/asound.names gave me an idea...<br/> strace -e file arecord -v -d 5 -t au -D plughw:0,0 test5.au<br/> Hot dog it worked!<br/> open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4<br/> open("test5.au", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3<br/> sox test5.au -d --> Lots of clipping, noisy.<br/> sox au: header size 24 is too small Input File : 'test5.au'<br/> Channels : 1<br/> Sample Rate : 8000<br/> Precision : 8-bit<br/> Duration : 00:05.00 = 40000 samples ~ 375 CDDA sectors<br/> Sample Encoding: 8-bit Signed Integer PCM<br/> 100% 00:05.00 [00:00.00] of 00:05.00 Out:240k [!=====|=====!]Hd:0.0 Clip:182k<br/> sox effects: rate clipped 120593 samples; decrease volume?<br/> sox sox: alsa: output clipped 61507 samples; decrease volume?<br/> Done.<br/> Aha! The recording is unsigned 8bit, but the playback was signed 8bit. How does one change this? man sox sox -u test5.au -d<br/> sox formats_i: `test5.au': overriding encoding type<br/> Sample Encoding: 8-bit Unsigned Integer PCM<br/> OK, it plays as unsigned 8bit. Success.<br/> == Simple tests from command line == netstat - man netstat look for services that you don't know, read their manual pages. See if the service would be better listening to fewer interfaces [like localhost]. Use the ps command to figure out what's running. Try the netstat flags "--inet -anp" and read what they mean in the netstat manual. look at /etc/fstab man fstab man mount Read a security article [fixme] about this file and the options. Skim the LVM and partitions pages here on slackwiki. Read about the noexec option (don't use this without understanding the consequences) Try "hostname --fqdn" and see what it does. Check the exim page or qmail page to see about local mail delivery. Some security tools (and other stuff too) will email you when important events occur. Read about the sudo and su commands. --[[User:Balsa|Balsa]] 16:15, 20 February 2011 (EST) == Exim - local mail only - setup and testing == Setup: not written yet. Testing / Debugging: The following are draft quality only. ps -efw | grep -i -e exim | grep -v grep #Lists running exim processes. netstat --inet -anp | grep -i -e exim -e 25 -e mail #See if anything is listening on port 25. ls -l /var/log look for mail or exim4 directory, and mail.??? and mail.???? files. ls -l /var/ look for mail, queue, or spool. Do a ls -l in any directories found above. Mail might be in ~/Mail Read the Mutt HOWTO on slackwiki.org. Read the qmail HOWTO as well. tail -f /var/log/exim4/mainlog (if it exists) The -f flag makes tail follow the file, so its best used on another virtual console or with screen. There are numerous guides for screen. My suggestion is to printout the most common commands on paper and keep it near your monitor. Try the mail command out. man mail echo "Testing local mail, sent on `date` to the local system" \ | mail -s "Test of Local Mail" username@localhost.localdomain Note that username@localhost.localdomain may not work. Try hostname --fqdn look in /etc/hosts Testing the MTA with telnet on a certain port: telnet localhost 25 HELO localhost MAIL FROM: username@localhost.localdomain RCPT TO: username@localhost.localdomain DATA SUBJECT: Testing mail via telnet This is the message body. Check if it worked with your favorite mail reader or by looking in the files listed above. End message body with a "." on a line by itself. . QUIT Once local mail delivery works, you can setup cron jobs (see cron page on slackwiki, and man cron) and the output (if any) will be mailed to you. == Octave: simple functions == Find the Octave tutorial by typing doc at the Octave command line.<br> Navigate to * Introduction:: A brief introduction to Octave.<br> Then go to * Simple Examples::<br> The tutorial is quite brief, and gives few examples of functions.<br> This page will demo how to make simple functions, and how to call one function from another.<br> octave:11> function fn = fn ( p )<br> > fn = p*20<br> > endfunction<br> octave:10> function sn = sn ( a )<br> > sn = a * (1/2)<br> > endfunction<br> octave:12> function tn = tn( p, a )<br> > tn = sn(a)+fn(p)<br> > endfunction<br> octave:17> function excess = excess( p, a, bs )<br> > excess = bs - tn(p,a)<br> > endfunction<br> octave:18> excess(p,a,bs)<br> sn = 517.50<br> fn = 2140<br> tn = 2657.5<br> excess = -1452.5<br> ans = -1452.5<br> octave:28> function trade = trade ( p, a, bs, lt )<br> > trade = excess(p,a,bs)/lt<br> > endfunction<br> octave:26> function newacres = newacres (p, a, bs, lt, na )<br> > newacres = a+trade(p,a,bs,lt)<br> > endfunction<br> octave:36> p=107; a=1013; bs=3017; lt=25;<br> octave:37> newacres(p,a,bs,lt,na)<br> sn = 506.50<br> fn = 2140<br> tn = 2646.5<br> excess = 370.50<br> trade = 14.820<br> newacres = 1027.8<br> ans = 1027.8<br> octave:38> p=114; a=1027; bs=3095; lt=23;<br> octave:39> newacres(p,a,bs,lt,na)<br> sn = 513.50<br> fn = 2280<br> tn = 2793.5<br> excess = 301.50<br> trade = 13.109<br> newacres = 1040.1<br> ans = 1040.1<br> --[[User:Balsa|Balsa]] 13:17, 21 February 2011 (EST) == Getmail == One of getmail's biggest features is writing directly to Maildir. This obviates the need for a Mail Transport Agent (MTA).<br> In a getmail configuration file: [destination]<br> type = Maildir<br> path = ~/Maildir/<br> This will write your email directly to the ~/Maildir/ directory in Maildir format.<br> --[[User:Balsa|Balsa]] 13:23, 21 February 2011 (EST) == Redirecting stderr and stdout to a file == /bin/true &> foo<br> This may be helpful in the "Piping" section here on slackwiki.<br> --[[User:Balsa|Balsa]] 13:34, 21 February 2011 (EST) == Sandbox and/or Editing Help pages on slackwiki? == If anyone knows if there exists a sandbox or an Help:Editing page here on slackwiki.org, please let me know. If not, I might try to create one. Advice welcome.<br> --[[User:Balsa|Balsa]] 13:38, 21 February 2011 (EST) == NTP log file configuration documentation == look for /usr/share/doc/ntp-doc/html/ntpd.html<br> It may be in a different place.<br> Use a http reader, like lynx to view it.<br> Go to "The Configuration File", then "Miscellaneous Options".<br> Scroll down to the "logconfig" and "logfile" headings.<br> There you will find a way to eliminate the "kernel time sync status change 6001" messages from syslog.<br> --[[User:Balsa|Balsa]] 02:26, 23 February 2011 (EST) 6376f927de695bd63172e431ee45ac03982d4670 466 463 2011-03-20T05:47:30Z Balsa 156 /* ALSA */ jack UDP draft added wikitext text/x-wiki Hi. [[User:Balsa|Balsa]] 03:28, 3 February 2011 (EST) == ALSA == /etc/asound.names<br/> Gives names and descriptions for ALSA hardware devices. Very useful when using arecord and its '-D, --device=NAME' command line options. /etc/asound.conf<br/> I do not know what this is currently. /etc/asound.state<br/> Ditto. strace - handy utility to see what programs are doing. strace -e file [some program and its args if relevant] - only shows file related stuff. arecord - ALSA utility to record sound. It's what I'm having trouble with, and is the subject of most of this page. sox - "Sound eXchange, the Swiss Army knife of audio manipulation" - (man sox; GNU General Public License) strace -e file arecord -v -d 5 -t au test4.au ----> <snip><br/> Recording Sparc Audio 'test4.au' : Unsigned 8 bit, Rate 8000 Hz, Mono <snip><br/> Very interesting, indeed. This gives us the default ALSA device used by arecord, in my case it was /dev/snd/pcmC0D0c. Cross referencing with /etc/asound.names doesn't get us far, because I still don't know the mappings between that file and the stuff in /dev/snd. Some speculation may be in order. grep -i capture -B 1 /etc/asound.names --> <br/> name 'hw:0,4'<br/> comment 'Physical Device - ALC268 Analog (Capture)'<br/> --<br/> name 'plughw:0,4'<br/> comment 'Physical Device With Conversions - ALC268 Analog (Capture)'<br/> Hmm. Lets try: strace -e file arecord -v -d 5 -t au -D hw:0,4 test5.au<br/> This opens /dev/snd/pcmC0D4c, and says "Recording Sparc Audio 'test5.au' : Unsigned 8 bit, Rate 8000 Hz, Mono" but exits with "arecord: set_params:954: Sample format non available". strace -e file arecord -v -d 5 -t au -D hw:0,0 test5.au<br/> Same deal, but opens /dev/snd/pcmC0D0c instead. Strange, since that is the same as the default. TODO: Look at source code. Edit: nevermind. Let's try one more thing - that /etc/asound.names gave me an idea...<br/> strace -e file arecord -v -d 5 -t au -D plughw:0,0 test5.au<br/> Hot dog it worked!<br/> open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4<br/> open("test5.au", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3<br/> sox test5.au -d --> Lots of clipping, noisy.<br/> sox au: header size 24 is too small Input File : 'test5.au'<br/> Channels : 1<br/> Sample Rate : 8000<br/> Precision : 8-bit<br/> Duration : 00:05.00 = 40000 samples ~ 375 CDDA sectors<br/> Sample Encoding: 8-bit Signed Integer PCM<br/> 100% 00:05.00 [00:00.00] of 00:05.00 Out:240k [!=====|=====!]Hd:0.0 Clip:182k<br/> sox effects: rate clipped 120593 samples; decrease volume?<br/> sox sox: alsa: output clipped 61507 samples; decrease volume?<br/> Done.<br/> Aha! The recording is unsigned 8bit, but the playback was signed 8bit. How does one change this? man sox sox -u test5.au -d<br/> sox formats_i: `test5.au': overriding encoding type<br/> Sample Encoding: 8-bit Unsigned Integer PCM<br/> OK, it plays as unsigned 8bit. Success.<br/> == JACK network audio over UDP == On the end with the physical sound hardware (master): jackd -r -T -d alsa -i1 -n 10 -o1 -p 4096 -r 8000 -S -i num input channels -n nperiods -o num output channels -p period, must be power of 2. -r sample rate -S prefer 16bit int over 32 bit. Do last (third): jack_netsource -h <hostname> jack_netsource -h <hostname> -m 1400 -P 1 -C 1 -o 0 -i 0 -l 10 -b 16 -m set maximum transmit unit (MTU) -P -C -o -i number of sound and midi in/out channels. -l buffer in number of periods. -b 16 bits per sample. FIXME - how to set sample rate? On the virtual end (remote): jackd -r -d net jackd -r -T -d net -i 1 -o 1 -I 0 -O 0 -r 8000 -p 4096 -n 10 -b 16 -r not realtime -c -a0 -T temporary, close when all clients gone. -d net use device net. -i -o -I -O num channels for sound/midi -r sample rate -p 4096 frames per period -n 10 buffer size in num periods -b 16 use 16 bits/sample -c use CELT compression -a 0 do not use autoconfig, just start --[[User:Balsa|Balsa]] 01:47, 20 March 2011 (EDT) == Simple tests from command line == netstat - man netstat look for services that you don't know, read their manual pages. See if the service would be better listening to fewer interfaces [like localhost]. Use the ps command to figure out what's running. Try the netstat flags "--inet -anp" and read what they mean in the netstat manual. look at /etc/fstab man fstab man mount Read a security article [fixme] about this file and the options. Skim the LVM and partitions pages here on slackwiki. Read about the noexec option (don't use this without understanding the consequences) Try "hostname --fqdn" and see what it does. Check the exim page or qmail page to see about local mail delivery. Some security tools (and other stuff too) will email you when important events occur. Read about the sudo and su commands. --[[User:Balsa|Balsa]] 16:15, 20 February 2011 (EST) == Exim - local mail only - setup and testing == Setup: not written yet. Testing / Debugging: The following are draft quality only. ps -efw | grep -i -e exim | grep -v grep #Lists running exim processes. netstat --inet -anp | grep -i -e exim -e 25 -e mail #See if anything is listening on port 25. ls -l /var/log look for mail or exim4 directory, and mail.??? and mail.???? files. ls -l /var/ look for mail, queue, or spool. Do a ls -l in any directories found above. Mail might be in ~/Mail Read the Mutt HOWTO on slackwiki.org. Read the qmail HOWTO as well. tail -f /var/log/exim4/mainlog (if it exists) The -f flag makes tail follow the file, so its best used on another virtual console or with screen. There are numerous guides for screen. My suggestion is to printout the most common commands on paper and keep it near your monitor. Try the mail command out. man mail echo "Testing local mail, sent on `date` to the local system" \ | mail -s "Test of Local Mail" username@localhost.localdomain Note that username@localhost.localdomain may not work. Try hostname --fqdn look in /etc/hosts Testing the MTA with telnet on a certain port: telnet localhost 25 HELO localhost MAIL FROM: username@localhost.localdomain RCPT TO: username@localhost.localdomain DATA SUBJECT: Testing mail via telnet This is the message body. Check if it worked with your favorite mail reader or by looking in the files listed above. End message body with a "." on a line by itself. . QUIT Once local mail delivery works, you can setup cron jobs (see cron page on slackwiki, and man cron) and the output (if any) will be mailed to you. == Octave: simple functions == Find the Octave tutorial by typing doc at the Octave command line.<br> Navigate to * Introduction:: A brief introduction to Octave.<br> Then go to * Simple Examples::<br> The tutorial is quite brief, and gives few examples of functions.<br> This page will demo how to make simple functions, and how to call one function from another.<br> octave:11> function fn = fn ( p )<br> > fn = p*20<br> > endfunction<br> octave:10> function sn = sn ( a )<br> > sn = a * (1/2)<br> > endfunction<br> octave:12> function tn = tn( p, a )<br> > tn = sn(a)+fn(p)<br> > endfunction<br> octave:17> function excess = excess( p, a, bs )<br> > excess = bs - tn(p,a)<br> > endfunction<br> octave:18> excess(p,a,bs)<br> sn = 517.50<br> fn = 2140<br> tn = 2657.5<br> excess = -1452.5<br> ans = -1452.5<br> octave:28> function trade = trade ( p, a, bs, lt )<br> > trade = excess(p,a,bs)/lt<br> > endfunction<br> octave:26> function newacres = newacres (p, a, bs, lt, na )<br> > newacres = a+trade(p,a,bs,lt)<br> > endfunction<br> octave:36> p=107; a=1013; bs=3017; lt=25;<br> octave:37> newacres(p,a,bs,lt,na)<br> sn = 506.50<br> fn = 2140<br> tn = 2646.5<br> excess = 370.50<br> trade = 14.820<br> newacres = 1027.8<br> ans = 1027.8<br> octave:38> p=114; a=1027; bs=3095; lt=23;<br> octave:39> newacres(p,a,bs,lt,na)<br> sn = 513.50<br> fn = 2280<br> tn = 2793.5<br> excess = 301.50<br> trade = 13.109<br> newacres = 1040.1<br> ans = 1040.1<br> --[[User:Balsa|Balsa]] 13:17, 21 February 2011 (EST) == Getmail == One of getmail's biggest features is writing directly to Maildir. This obviates the need for a Mail Transport Agent (MTA).<br> In a getmail configuration file: [destination]<br> type = Maildir<br> path = ~/Maildir/<br> This will write your email directly to the ~/Maildir/ directory in Maildir format.<br> --[[User:Balsa|Balsa]] 13:23, 21 February 2011 (EST) == Redirecting stderr and stdout to a file == /bin/true &> foo<br> This may be helpful in the "Piping" section here on slackwiki.<br> --[[User:Balsa|Balsa]] 13:34, 21 February 2011 (EST) == Sandbox and/or Editing Help pages on slackwiki? == If anyone knows if there exists a sandbox or an Help:Editing page here on slackwiki.org, please let me know. If not, I might try to create one. Advice welcome.<br> --[[User:Balsa|Balsa]] 13:38, 21 February 2011 (EST) == NTP log file configuration documentation == look for /usr/share/doc/ntp-doc/html/ntpd.html<br> It may be in a different place.<br> Use a http reader, like lynx to view it.<br> Go to "The Configuration File", then "Miscellaneous Options".<br> Scroll down to the "logconfig" and "logfile" headings.<br> There you will find a way to eliminate the "kernel time sync status change 6001" messages from syslog.<br> --[[User:Balsa|Balsa]] 02:26, 23 February 2011 (EST) 8253ae984890298c853d90c34c91dba9a7d84236 468 466 2011-04-08T09:02:03Z Balsa 156 Added link to sandbox. wikitext text/x-wiki Hi. [[User:Balsa|Balsa]] 03:28, 3 February 2011 (EST) == ALSA == /etc/asound.names<br/> Gives names and descriptions for ALSA hardware devices. Very useful when using arecord and its '-D, --device=NAME' command line options. /etc/asound.conf<br/> I do not know what this is currently. /etc/asound.state<br/> Ditto. strace - handy utility to see what programs are doing. strace -e file [some program and its args if relevant] - only shows file related stuff. arecord - ALSA utility to record sound. It's what I'm having trouble with, and is the subject of most of this page. sox - "Sound eXchange, the Swiss Army knife of audio manipulation" - (man sox; GNU General Public License) strace -e file arecord -v -d 5 -t au test4.au ----> <snip><br/> Recording Sparc Audio 'test4.au' : Unsigned 8 bit, Rate 8000 Hz, Mono <snip><br/> Very interesting, indeed. This gives us the default ALSA device used by arecord, in my case it was /dev/snd/pcmC0D0c. Cross referencing with /etc/asound.names doesn't get us far, because I still don't know the mappings between that file and the stuff in /dev/snd. Some speculation may be in order. grep -i capture -B 1 /etc/asound.names --> <br/> name 'hw:0,4'<br/> comment 'Physical Device - ALC268 Analog (Capture)'<br/> --<br/> name 'plughw:0,4'<br/> comment 'Physical Device With Conversions - ALC268 Analog (Capture)'<br/> Hmm. Lets try: strace -e file arecord -v -d 5 -t au -D hw:0,4 test5.au<br/> This opens /dev/snd/pcmC0D4c, and says "Recording Sparc Audio 'test5.au' : Unsigned 8 bit, Rate 8000 Hz, Mono" but exits with "arecord: set_params:954: Sample format non available". strace -e file arecord -v -d 5 -t au -D hw:0,0 test5.au<br/> Same deal, but opens /dev/snd/pcmC0D0c instead. Strange, since that is the same as the default. TODO: Look at source code. Edit: nevermind. Let's try one more thing - that /etc/asound.names gave me an idea...<br/> strace -e file arecord -v -d 5 -t au -D plughw:0,0 test5.au<br/> Hot dog it worked!<br/> open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4<br/> open("test5.au", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3<br/> sox test5.au -d --> Lots of clipping, noisy.<br/> sox au: header size 24 is too small Input File : 'test5.au'<br/> Channels : 1<br/> Sample Rate : 8000<br/> Precision : 8-bit<br/> Duration : 00:05.00 = 40000 samples ~ 375 CDDA sectors<br/> Sample Encoding: 8-bit Signed Integer PCM<br/> 100% 00:05.00 [00:00.00] of 00:05.00 Out:240k [!=====|=====!]Hd:0.0 Clip:182k<br/> sox effects: rate clipped 120593 samples; decrease volume?<br/> sox sox: alsa: output clipped 61507 samples; decrease volume?<br/> Done.<br/> Aha! The recording is unsigned 8bit, but the playback was signed 8bit. How does one change this? man sox sox -u test5.au -d<br/> sox formats_i: `test5.au': overriding encoding type<br/> Sample Encoding: 8-bit Unsigned Integer PCM<br/> OK, it plays as unsigned 8bit. Success.<br/> == JACK network audio over UDP == On the end with the physical sound hardware (master): jackd -r -T -d alsa -i1 -n 10 -o1 -p 4096 -r 8000 -S -i num input channels -n nperiods -o num output channels -p period, must be power of 2. -r sample rate -S prefer 16bit int over 32 bit. Do last (third): jack_netsource -h <hostname> jack_netsource -h <hostname> -m 1400 -P 1 -C 1 -o 0 -i 0 -l 10 -b 16 -m set maximum transmit unit (MTU) -P -C -o -i number of sound and midi in/out channels. -l buffer in number of periods. -b 16 bits per sample. FIXME - how to set sample rate? On the virtual end (remote): jackd -r -d net jackd -r -T -d net -i 1 -o 1 -I 0 -O 0 -r 8000 -p 4096 -n 10 -b 16 -r not realtime -c -a0 -T temporary, close when all clients gone. -d net use device net. -i -o -I -O num channels for sound/midi -r sample rate -p 4096 frames per period -n 10 buffer size in num periods -b 16 use 16 bits/sample -c use CELT compression -a 0 do not use autoconfig, just start --[[User:Balsa|Balsa]] 01:47, 20 March 2011 (EDT) == Simple tests from command line == netstat - man netstat look for services that you don't know, read their manual pages. See if the service would be better listening to fewer interfaces [like localhost]. Use the ps command to figure out what's running. Try the netstat flags "--inet -anp" and read what they mean in the netstat manual. look at /etc/fstab man fstab man mount Read a security article [fixme] about this file and the options. Skim the LVM and partitions pages here on slackwiki. Read about the noexec option (don't use this without understanding the consequences) Try "hostname --fqdn" and see what it does. Check the exim page or qmail page to see about local mail delivery. Some security tools (and other stuff too) will email you when important events occur. Read about the sudo and su commands. --[[User:Balsa|Balsa]] 16:15, 20 February 2011 (EST) == Exim - local mail only - setup and testing == Setup: not written yet. Testing / Debugging: The following are draft quality only. ps -efw | grep -i -e exim | grep -v grep #Lists running exim processes. netstat --inet -anp | grep -i -e exim -e 25 -e mail #See if anything is listening on port 25. ls -l /var/log look for mail or exim4 directory, and mail.??? and mail.???? files. ls -l /var/ look for mail, queue, or spool. Do a ls -l in any directories found above. Mail might be in ~/Mail Read the Mutt HOWTO on slackwiki.org. Read the qmail HOWTO as well. tail -f /var/log/exim4/mainlog (if it exists) The -f flag makes tail follow the file, so its best used on another virtual console or with screen. There are numerous guides for screen. My suggestion is to printout the most common commands on paper and keep it near your monitor. Try the mail command out. man mail echo "Testing local mail, sent on `date` to the local system" \ | mail -s "Test of Local Mail" username@localhost.localdomain Note that username@localhost.localdomain may not work. Try hostname --fqdn look in /etc/hosts Testing the MTA with telnet on a certain port: telnet localhost 25 HELO localhost MAIL FROM: username@localhost.localdomain RCPT TO: username@localhost.localdomain DATA SUBJECT: Testing mail via telnet This is the message body. Check if it worked with your favorite mail reader or by looking in the files listed above. End message body with a "." on a line by itself. . QUIT Once local mail delivery works, you can setup cron jobs (see cron page on slackwiki, and man cron) and the output (if any) will be mailed to you. == Octave: simple functions == Find the Octave tutorial by typing doc at the Octave command line.<br> Navigate to * Introduction:: A brief introduction to Octave.<br> Then go to * Simple Examples::<br> The tutorial is quite brief, and gives few examples of functions.<br> This page will demo how to make simple functions, and how to call one function from another.<br> octave:11> function fn = fn ( p )<br> > fn = p*20<br> > endfunction<br> octave:10> function sn = sn ( a )<br> > sn = a * (1/2)<br> > endfunction<br> octave:12> function tn = tn( p, a )<br> > tn = sn(a)+fn(p)<br> > endfunction<br> octave:17> function excess = excess( p, a, bs )<br> > excess = bs - tn(p,a)<br> > endfunction<br> octave:18> excess(p,a,bs)<br> sn = 517.50<br> fn = 2140<br> tn = 2657.5<br> excess = -1452.5<br> ans = -1452.5<br> octave:28> function trade = trade ( p, a, bs, lt )<br> > trade = excess(p,a,bs)/lt<br> > endfunction<br> octave:26> function newacres = newacres (p, a, bs, lt, na )<br> > newacres = a+trade(p,a,bs,lt)<br> > endfunction<br> octave:36> p=107; a=1013; bs=3017; lt=25;<br> octave:37> newacres(p,a,bs,lt,na)<br> sn = 506.50<br> fn = 2140<br> tn = 2646.5<br> excess = 370.50<br> trade = 14.820<br> newacres = 1027.8<br> ans = 1027.8<br> octave:38> p=114; a=1027; bs=3095; lt=23;<br> octave:39> newacres(p,a,bs,lt,na)<br> sn = 513.50<br> fn = 2280<br> tn = 2793.5<br> excess = 301.50<br> trade = 13.109<br> newacres = 1040.1<br> ans = 1040.1<br> --[[User:Balsa|Balsa]] 13:17, 21 February 2011 (EST) == Getmail == One of getmail's biggest features is writing directly to Maildir. This obviates the need for a Mail Transport Agent (MTA).<br> In a getmail configuration file: [destination]<br> type = Maildir<br> path = ~/Maildir/<br> This will write your email directly to the ~/Maildir/ directory in Maildir format.<br> --[[User:Balsa|Balsa]] 13:23, 21 February 2011 (EST) == Redirecting stderr and stdout to a file == /bin/true &> foo<br> This may be helpful in the "Piping" section here on slackwiki.<br> --[[User:Balsa|Balsa]] 13:34, 21 February 2011 (EST) == Sandbox and/or Editing Help pages on slackwiki? == If anyone knows if there exists a sandbox or an Help:Editing page here on slackwiki.org, please let me know. If not, I might try to create one. Advice welcome.<br> --[[User:Balsa|Balsa]] 13:38, 21 February 2011 (EST) A [[User:Balsa/Sandbox|sand-filled box]] labelled "Testing" --[[User:Balsa|Balsa]] 05:02, 8 April 2011 (EDT) == NTP log file configuration documentation == look for /usr/share/doc/ntp-doc/html/ntpd.html<br> It may be in a different place.<br> Use a http reader, like lynx to view it.<br> Go to "The Configuration File", then "Miscellaneous Options".<br> Scroll down to the "logconfig" and "logfile" headings.<br> There you will find a way to eliminate the "kernel time sync status change 6001" messages from syslog.<br> --[[User:Balsa|Balsa]] 02:26, 23 February 2011 (EST) 9758cf230d495f1c24840c2028a4fd25a29487ae VirtualBox Compilation 0 237 453 2011-02-09T03:11:01Z Merge-delete 261 Created page with "[[category:tutorials]] '''VirtualBox''' is a general-purpose full virtualizer for x86 hardware, targeted at server, desktop and embedded use. It comes in two editions * Open Sour..." wikitext text/x-wiki [[category:tutorials]] '''VirtualBox''' is a general-purpose full virtualizer for x86 hardware, targeted at server, desktop and embedded use. It comes in two editions * Open Source Edition (OSE) - open-source licensed under GPLv2 * Personal Use and Evaluation License (PUEL) - closed-source with additional features (USB support, Remote desktop support, ...) == Disclaimer == This tutorial applies to slackware-''current'' (-current after stable versions 13.1) and VirtualBox 4.0.x OSE == Prerequisites == See this [http://www.virtualbox.org/wiki/Linux%20build%20instructions list] Below lies additional, not obvious or not mentioned prerequisites. === Source packages === * VirtualBox - get it here: [http://download.virtualbox.org/virtualbox/4.0.2/VirtualBox-4.0.2.tar.bz2 http://download.virtualbox.org/virtualbox/4.0.2/VirtualBox-x.y.z.tar.bz2] where x.y.z stands for version numbers (eg. 4.0.2) * PulseAudio - no SlackBuild available (note: applies to 09-01-2010); download sources from [http://www.pulseaudio.org http://www.pulseaudio.org] * makeself - get it here: [http://megastep.org/makeself/ http://megastep.org/makeself/] === Slackware packages === * jdk * gcc-java === SlackBuilds === * iasl - contained in SlackBuild [http://slackbuilds.org/repository/13.1/development/acpica/ acpica] == Compilation == Unpack sources somewhere <pre> tar xjvf VirtualBox-x.y.z.tar.bz2 -C build/ cd build/VirtualBox-x.y.z_OSE/ </pre> Run configure script which will generate Makefile.kmk and env.sh scripts <pre> $ ./configure --nofatal --disable-hardening --disable-docs </pre> <code>--nofatal</code> configure won't stop on non-fatal errors; it usually fails on <code>makeself variable</code> <code>--disable-hardening</code> - set some environment variable; use when you don't want to build package <code>--disable-docs</code> - for some reason, build fails when building documentation. If you don't mind using online documentation it's safe to disable building it Update build environment variables with auto-generated script <pre> $ source ./env.sh </pre> Now it's time to compile sources, but there are few pitfalls ==== PAM ==== Slackware doesn't ship PAM, so you have to change one line in Config.kmk to disable it <pre> if1of ($(KBUILD_TARGET), linux solaris) # VBOX_WITH_PAM = 1 VBOX_WITH_PAM = endif </pre> Note: It's really blank space, 0 doesn't work as logical False ==== Java path ==== Inside Config.kmk there is block with few possible locations of JDK binaries. Unfortunately, JDK in Slackware has different path, so you have to add right path. <pre> ifeq ($(KBUILD_TARGET),linux) ifeq ($(origin VBOX_JAVA_HOME),undefined) # Add correct detection for you distro after the /usr/../java-6-sun line. # Slackware JDK resides in /usr/lib/jdk1.6.0_23 (JDK 1.6 update 23; type what version suits you) VBOX_JAVA_HOME := $(firstword $(wildcard \ $(PATH_DEVTOOLS)/linux.x86/jdk1.6.0_21 \ /usr/lib/jvm/java-6-sun \ /usr/lib/jvm/java-6-openjdk \ /usr/lib/jdk1.6.0_23 \ /usr/lib/jvm/sun-jdk-1.6 \ ) /usr/lib/jvm/java-6-sun) endif endif </pre> 0827be8f254126d14b8b6a3ec5b23e15cf3d624b 454 453 2011-02-09T03:16:01Z Merge-delete 261 add missing step + few minor changes wikitext text/x-wiki [[category:tutorials]] '''VirtualBox''' is a general-purpose full virtualizer for x86 hardware, targeted at server, desktop and embedded use. It comes in two editions * Open Source Edition (OSE) - open-source licensed under GPLv2 * Personal Use and Evaluation License (PUEL) - closed-source with additional features (USB support, Remote desktop support, ...) == Disclaimer == This tutorial applies to slackware-''current'' (-current after stable versions 13.1) and VirtualBox 4.0.x OSE == Prerequisites == See this [http://www.virtualbox.org/wiki/Linux%20build%20instructions list] Below lies additional, not obvious or not mentioned prerequisites. === Source packages === * VirtualBox - get it here: [http://download.virtualbox.org/virtualbox/4.0.2/VirtualBox-4.0.2.tar.bz2 http://download.virtualbox.org/virtualbox/4.0.2/VirtualBox-x.y.z.tar.bz2] where x.y.z stands for version numbers (eg. 4.0.2) * PulseAudio - no SlackBuild available (note: applies to 09-01-2010); download sources from [http://www.pulseaudio.org http://www.pulseaudio.org] * makeself - get it here: [http://megastep.org/makeself/ http://megastep.org/makeself/] === Slackware packages === * jdk * gcc-java === SlackBuilds === * iasl - contained in SlackBuild [http://slackbuilds.org/repository/13.1/development/acpica/ acpica] == Compilation == Unpack sources somewhere <pre> tar xjvf VirtualBox-x.y.z.tar.bz2 -C build/ cd build/VirtualBox-x.y.z_OSE/ </pre> Run configure script which will generate Makefile.kmk and env.sh scripts <pre> $ ./configure --nofatal --disable-hardening --disable-docs </pre> <code>--nofatal</code> configure won't stop on non-fatal errors; it usually fails on <code>makeself variable</code> <code>--disable-hardening</code> - set some environment variable; use when you don't want to build package <code>--disable-docs</code> - for some reason, build fails when building documentation. If you don't mind using online documentation it's safe to disable building it Update build environment variables with auto-generated script <pre> $ source ./env.sh </pre> Now it's time to compile sources, but there are few pitfalls === Troubleshooting & Pitfalls === ==== PAM ==== Slackware doesn't ship PAM, so you have to change one line in Config.kmk to disable it <pre> if1of ($(KBUILD_TARGET), linux solaris) # VBOX_WITH_PAM = 1 VBOX_WITH_PAM = endif </pre> Note: It's really blank space, 0 doesn't work as logical False ==== Java path ==== Inside Config.kmk there is block with few possible locations of JDK binaries. Unfortunately, JDK in Slackware has different path, so you have to add right path. <pre> ifeq ($(KBUILD_TARGET),linux) ifeq ($(origin VBOX_JAVA_HOME),undefined) # Add correct detection for you distro after the /usr/../java-6-sun line. # Slackware JDK resides in /usr/lib/jdk1.6.0_23 (JDK 1.6 update 23; type what version suits you) VBOX_JAVA_HOME := $(firstword $(wildcard \ $(PATH_DEVTOOLS)/linux.x86/jdk1.6.0_21 \ /usr/lib/jvm/java-6-sun \ /usr/lib/jvm/java-6-openjdk \ /usr/lib/jdk1.6.0_23 \ /usr/lib/jvm/sun-jdk-1.6 \ ) /usr/lib/jvm/java-6-sun) endif endif </pre> === Build === Everything should be prepared by now. Type following command to build VirtualBox <pre> $ kmk </pre> c4d8f6e15a463bfddf127cd71a9d44e1751f4014 464 454 2011-02-27T01:15:12Z Merge-delete 261 little update; not complete yet wikitext text/x-wiki [[category:tutorials]] '''VirtualBox''' is a general-purpose full virtualizer for x86 hardware, targeted at server, desktop and embedded use. It comes in two editions * Open Source Edition (OSE) - open-source licensed under GPLv2 * Personal Use and Evaluation License (PUEL) - closed-source with additional features (USB support, Remote desktop support, ...) == Disclaimer == This tutorial applies to slackware-''current'' (-current after stable versions 13.1) and VirtualBox 4.0.x OSE == Prerequisites == See this [http://www.virtualbox.org/wiki/Linux%20build%20instructions list] Below lies additional, not obvious or not mentioned prerequisites. === Source packages === * VirtualBox - get it here: [http://download.virtualbox.org/virtualbox/4.0.2/VirtualBox-4.0.2.tar.bz2 http://download.virtualbox.org/virtualbox/4.0.2/VirtualBox-x.y.z.tar.bz2] where x.y.z stands for version numbers (eg. 4.0.2) * PulseAudio - no SlackBuild available (note: applies to 09-01-2010); download sources from [http://www.pulseaudio.org http://www.pulseaudio.org] * makeself - get it here: [http://megastep.org/makeself/ http://megastep.org/makeself/] === Slackware packages === * jdk * gcc-java === SlackBuilds === * iasl - contained in SlackBuild [http://slackbuilds.org/repository/13.1/development/acpica/ acpica] == Compilation == Unpack sources somewhere <pre> tar xjvf VirtualBox-x.y.z.tar.bz2 -C build/ cd build/VirtualBox-x.y.z_OSE/ </pre> Run configure script which will generate Makefile.kmk and env.sh scripts <pre> $ ./configure --nofatal --disable-hardening --disable-docs </pre> <code>--nofatal</code> configure won't stop on non-fatal errors; it usually fails on <code>makeself</code> variable <code>--disable-hardening</code> - automatically set few symbolic links so you can run VirtualBox binaries from bin/ directory of your build environment; '''don't''' use this switch if you're building package for redistribution <code>--disable-docs</code> - for some reason, build fails when building documentation. If you don't mind using online documentation it's safe to disable building it Update build environment variables with auto-generated script <pre> $ source ./env.sh </pre> Now it's time to compile sources, but there are few pitfalls === Troubleshooting & Pitfalls === ==== PAM ==== Slackware doesn't ship PAM, so you have to change one line in Config.kmk to disable it <pre> if1of ($(KBUILD_TARGET), linux solaris) # VBOX_WITH_PAM = 1 VBOX_WITH_PAM = endif </pre> Note: It's really blank space, 0 doesn't work as logical False ==== Java path ==== Inside Config.kmk there is block with few possible locations of JDK binaries. Unfortunately, JDK in Slackware has different path, so you have to add right path. <pre> ifeq ($(KBUILD_TARGET),linux) ifeq ($(origin VBOX_JAVA_HOME),undefined) # Add correct detection for you distro after the /usr/../java-6-sun line. # Slackware JDK resides in /usr/lib/jdk1.6.0_23 (JDK 1.6 update 23; type what version suits you) VBOX_JAVA_HOME := $(firstword $(wildcard \ $(PATH_DEVTOOLS)/linux.x86/jdk1.6.0_21 \ /usr/lib/jvm/java-6-sun \ /usr/lib/jvm/java-6-openjdk \ /usr/lib/jdk1.6.0_23 \ /usr/lib/jvm/sun-jdk-1.6 \ ) /usr/lib/jvm/java-6-sun) endif endif </pre> === Build === Everything should be prepared by now. Type following command to build VirtualBox <pre> $ kmk </pre> Build VirtualBox kernel module <pre> $ cd out/linux.x86/release/bin/src $ make $ su <password> $ make install $ cd .. </pre> Load kernel module (as root) <pre> $ modprobe vboxdrv </pre> Now you can start VirtualBox front-end from local bin/ directory <pre> $ ./VirtualBox </pre> f9aa19a84c606f2d4ab862a4a779a12c51b7057e 470 464 2011-04-10T13:33:04Z Merge-delete 261 /* Source packages */ wikitext text/x-wiki [[category:tutorials]] '''VirtualBox''' is a general-purpose full virtualizer for x86 hardware, targeted at server, desktop and embedded use. It comes in two editions * Open Source Edition (OSE) - open-source licensed under GPLv2 * Personal Use and Evaluation License (PUEL) - closed-source with additional features (USB support, Remote desktop support, ...) == Disclaimer == This tutorial applies to slackware-''current'' (-current after stable versions 13.1) and VirtualBox 4.0.x OSE == Prerequisites == See this [http://www.virtualbox.org/wiki/Linux%20build%20instructions list] Below lies additional, not obvious or not mentioned prerequisites. === Source packages === * VirtualBox - get it here: [http://download.virtualbox.org/virtualbox/4.0.2/VirtualBox-4.0.2.tar.bz2 http://download.virtualbox.org/virtualbox/x.y.z/VirtualBox-x.y.z.tar.bz2] where x.y.z stands for version numbers (eg. 4.0.2) * PulseAudio - no SlackBuild available (note: applies to 09-01-2010); download sources from [http://www.pulseaudio.org http://www.pulseaudio.org] * makeself - get it here: [http://megastep.org/makeself/ http://megastep.org/makeself/] === Slackware packages === * jdk * gcc-java === SlackBuilds === * iasl - contained in SlackBuild [http://slackbuilds.org/repository/13.1/development/acpica/ acpica] == Compilation == Unpack sources somewhere <pre> tar xjvf VirtualBox-x.y.z.tar.bz2 -C build/ cd build/VirtualBox-x.y.z_OSE/ </pre> Run configure script which will generate Makefile.kmk and env.sh scripts <pre> $ ./configure --nofatal --disable-hardening --disable-docs </pre> <code>--nofatal</code> configure won't stop on non-fatal errors; it usually fails on <code>makeself</code> variable <code>--disable-hardening</code> - automatically set few symbolic links so you can run VirtualBox binaries from bin/ directory of your build environment; '''don't''' use this switch if you're building package for redistribution <code>--disable-docs</code> - for some reason, build fails when building documentation. If you don't mind using online documentation it's safe to disable building it Update build environment variables with auto-generated script <pre> $ source ./env.sh </pre> Now it's time to compile sources, but there are few pitfalls === Troubleshooting & Pitfalls === ==== PAM ==== Slackware doesn't ship PAM, so you have to change one line in Config.kmk to disable it <pre> if1of ($(KBUILD_TARGET), linux solaris) # VBOX_WITH_PAM = 1 VBOX_WITH_PAM = endif </pre> Note: It's really blank space, 0 doesn't work as logical False ==== Java path ==== Inside Config.kmk there is block with few possible locations of JDK binaries. Unfortunately, JDK in Slackware has different path, so you have to add right path. <pre> ifeq ($(KBUILD_TARGET),linux) ifeq ($(origin VBOX_JAVA_HOME),undefined) # Add correct detection for you distro after the /usr/../java-6-sun line. # Slackware JDK resides in /usr/lib/jdk1.6.0_23 (JDK 1.6 update 23; type what version suits you) VBOX_JAVA_HOME := $(firstword $(wildcard \ $(PATH_DEVTOOLS)/linux.x86/jdk1.6.0_21 \ /usr/lib/jvm/java-6-sun \ /usr/lib/jvm/java-6-openjdk \ /usr/lib/jdk1.6.0_23 \ /usr/lib/jvm/sun-jdk-1.6 \ ) /usr/lib/jvm/java-6-sun) endif endif </pre> === Build === Everything should be prepared by now. Type following command to build VirtualBox <pre> $ kmk </pre> Build VirtualBox kernel module <pre> $ cd out/linux.x86/release/bin/src $ make $ su <password> $ make install $ cd .. </pre> Load kernel module (as root) <pre> $ modprobe vboxdrv </pre> Now you can start VirtualBox front-end from local bin/ directory <pre> $ ./VirtualBox </pre> 58aa6df952022ccd419799467d4ce3e4baf7414a Slack-desc 0 17 465 252 2011-03-19T12:51:24Z Alienbob 9 Define the layout of the slack-desc's first line. wikitext text/x-wiki =Overview= A proper slack-desc file should be written as follows: # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| appname: appname (Short description of the application) appname: <this line is generally left blank> appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname: The "appname" string must *exactly* match the application name portion of the Slackware package (for example, a package titled "gaim-1.5-i486-1.tgz" must have a slack-desc file with the <appname> string of "gaim: " rather than "Gaim: " or "GAIM: " or something else. The first line ''must'' show the application name followed by a short description (enclosed in parentheses). The "handy ruler" is meant to stop you at 79 characters, because the standard console is 80x25 and if you go beyond this the words will wrap. The space after the : is needed only when there is text after the : In the above example lines 2,9 & 11 should not have a space after the : =See Also= man makepkg man pkgtool [[Category:Tutorials]] e88c3e7826710ad58f73b854e50f86d611e1ddd7 472 465 2011-04-16T10:49:51Z John Harris 170 wikitext text/x-wiki =Overview= A proper slack-desc file should be written as follows: # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| appname: appname (Short description of the application) appname: <this line is generally left blank> appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname: The "appname" string must *exactly* match the application name portion of the Slackware package (for example, a package titled "gaim-1.5-i486-1.tgz" must have a slack-desc file with the <appname> string of "gaim: " rather than "Gaim: " or "GAIM: " or something else. The first line ''must'' show the application name followed by a short description (enclosed in parentheses). The "handy ruler" is meant to stop you at 79 characters, because the standard console is 80x25 and if you go beyond this the words will wrap. The space after the : is needed only when there is text after the : In the above example lines 9 & 11 should not have a space after the : =See Also= man makepkg man pkgtool [[Category:Tutorials]] faf2f112bca2d0053c023fadeb6dbdceaa94e906 User:Balsa/Sandbox 2 239 467 2011-04-08T08:56:58Z Balsa 156 A prototype sandbox. wikitext text/x-wiki '''Some bold text''' ''Some italicised text'' '''''Some bold and italicised text ''''' <s>Strike-through</s><br> An internal link: [[User_talk:Balsa]]<br> Math: <math>2+2=4</math> *A really short list<br> A space at the beginning of the line. <p>A paragraph tag. <font color="blue"> Font tag colour test. </font> {| | style="background:green; color:blue" | Test | of | style="background:black; color:green" | Colours. |} A signature with timestamp: --[[User:Balsa|Balsa]] 04:56, 8 April 2011 (EDT) 2c79fbc6b8aa028c8d67f732ba75e17e329d1297 Hibernate 0 223 469 368 2011-04-10T13:20:31Z Merge-delete 261 wikitext text/x-wiki In Slackware, hibernation works out-of-the-box and can be easily done from KDE's menu. Resuming from hibernation, however, is not set up, so when you turn on your computer again, it starts as normal. That is, if your hardware supports it and if you've set up a swap space larger than your RAM. To tell your kernel where to resume from, you need to write the info to ''lilo.conf'': append=" resume=/dev/sda6" Replace ''/dev/sda6'' with your actual swap space. Swap partitions are perfect, I think swap files should work too. If you don't know where your swap lies, look at ''/proc/swaps''. If you're using generic or your own kernel, you need to adjust initrd image as well. Append -h /dev/sdx to mkinitrd command so it may look like this: mkinitrd -c -k 2.6.33.4 -r /dev/sdx -f <fs_type> -m <fs_type> -h /dev/sdy Replace ''/dev/sdx'' with your actual root partition and ''/dev/sdy'' with your actual swap space. Afterwards, run lilo. ---- The above is everything I needed to do with my Slackware64 13.1 on a new laptop. I hope that works for you as well, but there are many requirements and intricacies not mentioned above. Google might help you. Please edit this document accordingly if you find out more. Some more info at [http://www.linuxquestions.org/linux/answers/Hardware/Mini_HOW_TO_Hibernate_and_resume_0] [[Category:Tutorials]] bae31355a75c9790a0b525c5e2b5ab0b61fabaf8 471 469 2011-04-13T11:39:54Z Merge-delete 261 wikitext text/x-wiki In Slackware, hibernation works out-of-the-box and can be easily done from KDE's menu. Resuming from hibernation, however, is not set up, so when you turn on your computer again, it starts as normal. That is, if your hardware supports it and if you've set up a swap space larger than your RAM. == Huge kernel == To tell your kernel where to resume from, you need to write the info to ''lilo.conf'': append=" resume=/dev/sda6" Replace ''/dev/sda6'' with your actual swap space. Swap partitions are perfect, I think swap files should work too. If you don't know where your swap lies, look at ''/proc/swaps''. == Generic kernel + initrd == If you're using generic or your own kernel, you need to adjust initrd image as well. Append -h /dev/sdx to mkinitrd command so it may look like this: mkinitrd -c -k 2.6.33.4 -f <fs_type> -m <fs_type> -r /dev/sdx -h /dev/sdy Replace ''/dev/sdx'' with your actual root partition and ''/dev/sdy'' with your actual swap space. If you're using LVM, don't forget to append '''-L''' to mkinitrd command mkinitrd -c -k 2.6.33.4 -f <fs_type> -m <fs_type> -r /dev/sdx -h /dev/volumegroup/swap -L Afterwards, run lilo. == Further reading == * [http://www.linuxquestions.org/linux/answers/Hardware/Mini_HOW_TO_Hibernate_and_resume_0 Mini_HOW_TO_Hibernate_and_resume_0] * Hibernate to encrypted swap - [http://slackware.osuosl.org/slackware-13.1/README_CRYPT.TXT REAME_CRYPT.TXT] [[Category:Tutorials]] a6898d54a798f54bf51a06d439975fbf20bacd73 Fstab 0 94 473 116 2011-04-19T23:08:37Z Merge-delete 261 /* Useful Examples */ wikitext text/x-wiki The /etc/fstab file tells the system how and where to mount filesystems by default. ==Syntax== The syntax of the file is this: <table cellspacing="10"> <tr> <td align="right"><b>MAN PAGE-ese:</b></td> <td align="center">FS_SPEC</td> <td align="center">FS_FILE</td> <td align="center">FS_VFSTYPE</td> <td align="center">FS_MNTOPS</td> <td align="center">FS_FREQ</td> <td align="center">FS_PASSNO</td> </tr><tr> <td align="right"><b>IN ENGLISH:</b></td> <td align="center">DEVICE</td> <td align="center">MOUNT_POINT</td> <td align="center">FILESYSTEM</td> <td align="center">OPTIONS</td> <td align="center">DUMP</td> <td align="center">FSCK_ORDER</td> </tr><tr> <td align="right"><b>EXAMPLE:</b></td> <td align="center">/dev/hdb1</td> <td align="center">/mnt/windows</td> <td align="center">vfat</td> <td align="center">default</td> <td align="center">0</td> <td align="center">1</td> </tr> </table> ==Field Descriptions== FS_SPEC (DEVICE) - the device or remote filesystem to be mounted. FS_FILE (MOUNT_POINT) - the mount point for the filesystem. <i>NOTE: For swap partitions, this field should be specified as `none'. If the name of the mount point contains spaces these can be escaped as `\040'.</i> FS_VFSTYPE (FILESYSTEM)- the type of the filesystem. As of Slackware 10.2, the FILE_SYSTEM choices are: :auto, adfs, affs, autofs, coda, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, nfs4, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf, ufs, umsdos, vfat, xfs, xiafs and possibly others. <i>NOTE: for swap-able and portable devices (e.g. memory sticks and CDROMs), <code>auto</code> is the best choice because it allows the computer to determine the correct filesystem.</i> FS_MNTOPS (OPTION) - the (comma seperated) mount options. See the MOUNT command's MAN PAGE for the options because there are MANY! The most commonly used options are:<br> :noauto - do not mount this device/partition automatically on boot-up. :ro - mount this device/partition READ-ONLY (e.g. CDROM). :owner - Only allow the owner to mount and un-mount this device/partition. :users - Allow any user to mount or unmount this device/partition. FS_FREQ (DUMP) - used for these filesystems by the dump command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped. For the most part, this should be "0" (zero). FS_PASSNO (FSCK_ORDER) - used by the fsck program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked. ==Benefits Of fstab Entries== Once you have a device in the fstab, mounting become VERY easy. Instead of having to: :<code>mount -t iso9660 /dev/hdb1 /mnt/cdrom</code> every time you want to use the CDROM, you can just type: :<code>mount /mnt/cdrom</code> IF you have the entry in your fstab. ==Useful Examples== CDROM:<br> :/dev/hdc1 /mnt/cdrom auto noauto,ro,owner,users 0 0 [[USB Memory Stick]]:<br> :/dev/sda1 /mnt/memstick auto noauto,owner,users 0 0<br> (make sure to <code>mkdir /mnt/memstick</code> after changing your /etc/fstab). [[External USB Drive / NTFS partition]] :/dev/sdd1 /media/1T ntfs-3g defaults 2 0 (/dev/sdd1 is your external USB hard drive and /media/1T is destination folder) Note: For changing who can access the filesystem on NON-Native linux formats see [[Permissions and Umasks]] and [[Windows Partitions]] [[Category:Tutorials]] 4f8b9a74914041582acae1aea1665adb5422ef4a 474 473 2011-04-19T23:16:06Z Merge-delete 261 /* Useful Examples */ wikitext text/x-wiki The /etc/fstab file tells the system how and where to mount filesystems by default. ==Syntax== The syntax of the file is this: <table cellspacing="10"> <tr> <td align="right"><b>MAN PAGE-ese:</b></td> <td align="center">FS_SPEC</td> <td align="center">FS_FILE</td> <td align="center">FS_VFSTYPE</td> <td align="center">FS_MNTOPS</td> <td align="center">FS_FREQ</td> <td align="center">FS_PASSNO</td> </tr><tr> <td align="right"><b>IN ENGLISH:</b></td> <td align="center">DEVICE</td> <td align="center">MOUNT_POINT</td> <td align="center">FILESYSTEM</td> <td align="center">OPTIONS</td> <td align="center">DUMP</td> <td align="center">FSCK_ORDER</td> </tr><tr> <td align="right"><b>EXAMPLE:</b></td> <td align="center">/dev/hdb1</td> <td align="center">/mnt/windows</td> <td align="center">vfat</td> <td align="center">default</td> <td align="center">0</td> <td align="center">1</td> </tr> </table> ==Field Descriptions== FS_SPEC (DEVICE) - the device or remote filesystem to be mounted. FS_FILE (MOUNT_POINT) - the mount point for the filesystem. <i>NOTE: For swap partitions, this field should be specified as `none'. If the name of the mount point contains spaces these can be escaped as `\040'.</i> FS_VFSTYPE (FILESYSTEM)- the type of the filesystem. As of Slackware 10.2, the FILE_SYSTEM choices are: :auto, adfs, affs, autofs, coda, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, nfs4, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf, ufs, umsdos, vfat, xfs, xiafs and possibly others. <i>NOTE: for swap-able and portable devices (e.g. memory sticks and CDROMs), <code>auto</code> is the best choice because it allows the computer to determine the correct filesystem.</i> FS_MNTOPS (OPTION) - the (comma seperated) mount options. See the MOUNT command's MAN PAGE for the options because there are MANY! The most commonly used options are:<br> :noauto - do not mount this device/partition automatically on boot-up. :ro - mount this device/partition READ-ONLY (e.g. CDROM). :owner - Only allow the owner to mount and un-mount this device/partition. :users - Allow any user to mount or unmount this device/partition. FS_FREQ (DUMP) - used for these filesystems by the dump command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped. For the most part, this should be "0" (zero). FS_PASSNO (FSCK_ORDER) - used by the fsck program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked. ==Benefits Of fstab Entries== Once you have a device in the fstab, mounting become VERY easy. Instead of having to: :<code>mount -t iso9660 /dev/hdb1 /mnt/cdrom</code> every time you want to use the CDROM, you can just type: :<code>mount /mnt/cdrom</code> IF you have the entry in your fstab. ==Useful Examples== CDROM:<br> :/dev/hdc1 /mnt/cdrom auto noauto,ro,owner,users 0 0 [[USB Memory Stick]]:<br> :/dev/sda1 /mnt/memstick auto noauto,owner,users 0 0<br> (make sure to <code>mkdir /mnt/memstick</code> after changing your /etc/fstab). [[External USB Drive / NTFS partition]] :/dev/sdd1 /media/1T ntfs-3g auto 0 0 (/dev/sdd1 is your external USB hard drive and /media/1T is destination folder) Note: For changing who can access the filesystem on NON-Native linux formats see [[Permissions and Umasks]] and [[Windows Partitions]] [[Category:Tutorials]] c69a8885981e743863cca0c15caf6135bb4cfa07 NVIDIA-comercial-drivers-13.37 0 240 475 2011-04-28T21:36:54Z Toymachine 172 Initial tutorial on how to install commercial Nvidia drivers in Slackware 13.37 x86_64 wikitext text/x-wiki == Installing commercial Nvidia drivers in 64-bit Slackware 13.37 == This tutorial assumes you have a fresh '''full''' install of Slackware 13.37 '''x86_64'''. What you'll need: *'''NVIDIA-Linux-x86_64-270.41.06.run''' [Version from official nvidia website as of 4-28-11] *'''xf86-video-nouveau-blacklist-noarch-1.txz''' [This package can be found on the slackware 13.37 DVD in /extra] *A reboot Once you've obtained these files, stick them somewhere (for example, /tmp). To get the Commercial Nvidia driver working you'll need to remove the nouveau driver, and for good measure, make sure it is blacklisted. Do the following as root: '''removepkg xf86-video-nouveau''' '''installpkg /tmp/xf86-video-nouveau-blacklist-noarch-1.txz''' '''chmod a+x /tmp/NVIDIA-Linux-x86_64-270.41.06.run''' Now it's time to install the NVIDIA Driver: '''cd /tmp && ./NVIDIA-Linux-x86_64-270.41.06.run''' Follow the on-screen prompts to complete the install. Also be sure to include the 32-bit gl content. (Sorry for lack of detail here, I'll try and add more detail later) If the driver builds successfully without error then proceed. Invoke the following: '''nvidia-xconfig''' Allow it to make the change to /etc/X11/xorg.conf Now reboot: '''reboot''' Once your system has rebooted ensure that the 'nouveau' driver is NOT present and that the 'nvidia' driver is. The following command should return nothing: lsmod | grep nouveau Now check for the nvidia driver: lsmod | grep nvidia You should see something like: root@slackbox:~# lsmod | grep nvidia nvidia 10486926 40 agpgart 28874 1 nvidia i2c_core 19769 2 nvidia,i2c_piix4 aa5bd84cbd194184aeb42c4aad291e7ce536fb2e 476 475 2011-04-28T21:38:27Z Toymachine 172 moving this to a more appropriate title wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 NVIDIA-Commercial-Drivers 0 241 477 2011-04-28T21:39:37Z Toymachine 172 Initial page for commercial nvidia drivers on Slackware 13.37 x86_64 wikitext text/x-wiki == Installing commercial Nvidia drivers in 64-bit Slackware 13.37 == This tutorial assumes you have a fresh '''full''' install of Slackware 13.37 '''x86_64'''. What you'll need: *'''NVIDIA-Linux-x86_64-270.41.06.run''' [Version from official nvidia website as of 4-28-11] *'''xf86-video-nouveau-blacklist-noarch-1.txz''' [This package can be found on the slackware 13.37 DVD in /extra] *A reboot Once you've obtained these files, stick them somewhere (for example, /tmp). To get the Commercial Nvidia driver working you'll need to remove the nouveau driver, and for good measure, make sure it is blacklisted. Do the following as root: '''removepkg xf86-video-nouveau''' '''installpkg /tmp/xf86-video-nouveau-blacklist-noarch-1.txz''' '''chmod a+x /tmp/NVIDIA-Linux-x86_64-270.41.06.run''' Now it's time to install the NVIDIA Driver: '''cd /tmp && ./NVIDIA-Linux-x86_64-270.41.06.run''' Follow the on-screen prompts to complete the install. Also be sure to include the 32-bit gl content. (Sorry for lack of detail here, I'll try and add more detail later) If the driver builds successfully without error then proceed. Invoke the following: '''nvidia-xconfig''' Allow it to make the change to /etc/X11/xorg.conf Now reboot: '''reboot''' Once your system has rebooted ensure that the 'nouveau' driver is NOT present and that the 'nvidia' driver is. The following command should return nothing: lsmod | grep nouveau Now check for the nvidia driver: lsmod | grep nvidia You should see something like: root@slackbox:~# lsmod | grep nvidia nvidia 10486926 40 agpgart 28874 1 nvidia i2c_core 19769 2 nvidia,i2c_piix4 aa5bd84cbd194184aeb42c4aad291e7ce536fb2e NVIDIA-Commercial-Drivers 0 241 478 477 2011-04-28T21:41:56Z Toymachine 172 Made the last to lsmod commands bold now. wikitext text/x-wiki == Installing commercial Nvidia drivers in 64-bit Slackware 13.37 == This tutorial assumes you have a fresh '''full''' install of Slackware 13.37 '''x86_64'''. What you'll need: *'''NVIDIA-Linux-x86_64-270.41.06.run''' [Version from official nvidia website as of 4-28-11] *'''xf86-video-nouveau-blacklist-noarch-1.txz''' [This package can be found on the slackware 13.37 DVD in /extra] *A reboot Once you've obtained these files, stick them somewhere (for example, /tmp). To get the Commercial Nvidia driver working you'll need to remove the nouveau driver, and for good measure, make sure it is blacklisted. Do the following as root: '''removepkg xf86-video-nouveau''' '''installpkg /tmp/xf86-video-nouveau-blacklist-noarch-1.txz''' '''chmod a+x /tmp/NVIDIA-Linux-x86_64-270.41.06.run''' Now it's time to install the NVIDIA Driver: '''cd /tmp && ./NVIDIA-Linux-x86_64-270.41.06.run''' Follow the on-screen prompts to complete the install. Also be sure to include the 32-bit gl content. (Sorry for lack of detail here, I'll try and add more detail later) If the driver builds successfully without error then proceed. Invoke the following: '''nvidia-xconfig''' Allow it to make the change to /etc/X11/xorg.conf Now reboot: '''reboot''' Once your system has rebooted ensure that the 'nouveau' driver is NOT present and that the 'nvidia' driver is. The following command should return nothing: '''lsmod | grep nouveau''' Now check for the nvidia driver: '''lsmod | grep nvidia ''' You should see something like: root@slackbox:~# lsmod | grep nvidia nvidia 10486926 40 agpgart 28874 1 nvidia i2c_core 19769 2 nvidia,i2c_piix4 9b655cb4b1efd3cad4edd359355969d8900c2dbd 479 478 2011-04-28T21:44:00Z Toymachine 172 Added conclusion. wikitext text/x-wiki == Installing commercial Nvidia drivers in 64-bit Slackware 13.37 == This tutorial assumes you have a fresh '''full''' install of Slackware 13.37 '''x86_64'''. What you'll need: *'''NVIDIA-Linux-x86_64-270.41.06.run''' [Version from official nvidia website as of 4-28-11] *'''xf86-video-nouveau-blacklist-noarch-1.txz''' [This package can be found on the slackware 13.37 DVD in /extra] *A reboot Once you've obtained these files, stick them somewhere (for example, /tmp). To get the Commercial Nvidia driver working you'll need to remove the nouveau driver, and for good measure, make sure it is blacklisted. Do the following as root: '''removepkg xf86-video-nouveau''' '''installpkg /tmp/xf86-video-nouveau-blacklist-noarch-1.txz''' '''chmod a+x /tmp/NVIDIA-Linux-x86_64-270.41.06.run''' Now it's time to install the NVIDIA Driver: '''cd /tmp && ./NVIDIA-Linux-x86_64-270.41.06.run''' Follow the on-screen prompts to complete the install. Also be sure to include the 32-bit gl content. (Sorry for lack of detail here, I'll try and add more detail later) If the driver builds successfully without error then proceed. Invoke the following: '''nvidia-xconfig''' Allow it to make the change to /etc/X11/xorg.conf Now reboot: '''reboot''' Once your system has rebooted ensure that the 'nouveau' driver is NOT present and that the 'nvidia' driver is. The following command should return nothing: '''lsmod | grep nouveau''' Now check for the nvidia driver: '''lsmod | grep nvidia ''' You should see something like: root@slackbox:~# lsmod | grep nvidia nvidia 10486926 40 agpgart 28874 1 nvidia i2c_core 19769 2 nvidia,i2c_piix4 You should now have a working commercial Nvidia driver and be able to start X11 without issue. a09c573f688627ab3a29587cfec355ee52c918f6 480 479 2011-04-28T21:46:26Z Toymachine 172 Added Tutorials category wikitext text/x-wiki [[Category:Tutorials]] == Installing commercial Nvidia drivers in 64-bit Slackware 13.37 == This tutorial assumes you have a fresh '''full''' install of Slackware 13.37 '''x86_64'''. What you'll need: *'''NVIDIA-Linux-x86_64-270.41.06.run''' [Version from official nvidia website as of 4-28-11] *'''xf86-video-nouveau-blacklist-noarch-1.txz''' [This package can be found on the slackware 13.37 DVD in /extra] *A reboot Once you've obtained these files, stick them somewhere (for example, /tmp). To get the Commercial Nvidia driver working you'll need to remove the nouveau driver, and for good measure, make sure it is blacklisted. Do the following as root: '''removepkg xf86-video-nouveau''' '''installpkg /tmp/xf86-video-nouveau-blacklist-noarch-1.txz''' '''chmod a+x /tmp/NVIDIA-Linux-x86_64-270.41.06.run''' Now it's time to install the NVIDIA Driver: '''cd /tmp && ./NVIDIA-Linux-x86_64-270.41.06.run''' Follow the on-screen prompts to complete the install. Also be sure to include the 32-bit gl content. (Sorry for lack of detail here, I'll try and add more detail later) If the driver builds successfully without error then proceed. Invoke the following: '''nvidia-xconfig''' Allow it to make the change to /etc/X11/xorg.conf Now reboot: '''reboot''' Once your system has rebooted ensure that the 'nouveau' driver is NOT present and that the 'nvidia' driver is. The following command should return nothing: '''lsmod | grep nouveau''' Now check for the nvidia driver: '''lsmod | grep nvidia ''' You should see something like: root@slackbox:~# lsmod | grep nvidia nvidia 10486926 40 agpgart 28874 1 nvidia i2c_core 19769 2 nvidia,i2c_piix4 You should now have a working commercial Nvidia driver and be able to start X11 without issue. 969a5bc82fcbe847bb57278f13e19ad1e5f1143c Bootsplash 0 192 481 259 2011-05-11T01:30:50Z Netrixtardis 146 /* Prerequisites */ wikitext text/x-wiki [[Category:Tutorials]] == Prerequisites == * kernel source * a bootsplash patch for your kernel version [http://www.mcbeister.de/bootsplash/index.html] bootsplash patch. * A bootsplash theme [http://kde-look.org/index.php?xcontentmode=61 kde-look themes] * Bootsplash utilites [http://www.yzzerdd.net/slackware/files/bootsplash/bootsplash-3.1.tar.bz2 download] == Setup == Start by patching and building a new kernel. Assuming Stock kernel configuration/source. And all your downloads are in /home/username/Downloads. <sub> cd /usr/src/linux patch -p1</home/username/Downloads/bootsplash*.diff rm .config zcat /proc/config.gz > .config make menuconfig</sub> *Note: If you insist on using the generic kernel. And are currently using it. Check to see if the .config in your /usr/src/linux directory matches /proc/config.gz <sub> zdiff /proc/config.gz /usr/src/linux/.config </sub> If they match, skip the "rm .config && zcat ..." part above You'll also want to converge your initrd.gz and bootsplash's initrd. More on that below. Edit these 2 options: <sub> Device Drivers ---> Graphics support ---> Logo configuration ---> [ ] Bootup logo Bootsplash configuration ---> [*] Bootup splash screen</sub> * If you aren't using a stock kernel configuration, or on another distro check these settings whileyou are still in the kernel configuration dialog: <sub><nowiki> Device Drivers ---> Block devices ---> <*> RAM disk support Graphics support ---> <*> Support for frame buffer devices</nowiki></sub> Now to make the patched kernel and install it <sub> make ; cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-bootsplash</sub> For slamd64, thats: <sub> make ; cp /usr/src/linux/arch/x86_64/boot/bzImage /boot/vmlinuz-bootsplash</sub> On to making a new bootsplash initrd. Compile and install the splash utility. <sub> cd /home/username/Downloads tar xf bootsplash-3.0.7.tar.bz2 cd bootsplash-3.0.7/Utilities/ make splash cp splash /usr/bin/ </sub> And use it to build your new initrd. Untar the theme file you downloaded, and check to see if it has a config directory and an image/s directory. Look in the config directory for an appropriately sized config file (usually bootsplash-1024x768.cfg). Edit this file, changing the directory it looks for images in (jpeg= option and silentjpeg= option) to point to the correct directory of the images for that theme. Example: /home/username/Downloads/bootsplashtheme/images/foo-bar.jpg Finish by making the initrd with splash: <sub> splash -s -f /home/username/Downloads/bootsplashtheme/config/bootsplash-1024x768.cfg >> /boot/initrd.splash </sub> For generic kernel users, you'll have to converge your stock initrd.gz and the bootsplash initrds. For example: <sub>mkinitrd -c -m reiserfs</sub> <sub> cp /boot/initrd.splash /boot/initrd-tree/bootsplash </sub> After putting the initrd-splash into the mkinitrd's initrd-tree you'll need to run mkinitrd again. Remember to do this every time you make a new initrd.splash. Now edit /etc/lilo.conf with your favorite editor, adding the new kernel and bootsplash options. Sample: <sub> boot = /dev/hda message = /boot/boot_message.txt prompt timeout = 300 change-rules reset vga = 791 image = /boot/vmlinuz root = /dev/hda1 label = Linux read-only image = /boot/vmlinuz-bootsplash root = /dev/hda1 label = Bootsplash initrd=/boot/initrd.splash append="splash=silent" </sub> Substitue "initrd=/boot/initrd.gz" if you had to run mkinitrd for a generic kernel, then run lilo to update and you're set. <sub>root@slackware:~# lilo Added Linux Added Bootsplash </sub> Now you can Reboot to test everything. If boot fails for some reason. You still have your stock kernel and entry in lilo to boot into without worries. == Progressbar - rc.progress == Theres no set way to do this, you just need init to update /proc/splash correctly. The way I do it (with help from LinuxQuestiosn forums): create a new file in /etc/rc.d/ named rc.progress <sub> cd /etc/rc.d/ ; touch rc.progress </sub> edit it, and add this script: <sub><nowiki> #!/bin/sh # #rc.progress This file has a common subroutine used to update a # bootsplash progress bar. # # Count the number of times the progress bar is likely to gbe increased numu=$((`cat /etc/rc.d/rc.* | grep -c "^progressup"`)); numd=$((`cat /etc/rc.d/rc.* | grep -c "^progressdown"`)); function progressup(){ progress=$((`cat /var/run/progressbar`)); progress=$(($progress+1)); echo $progress > /var/run/progressbar echo "show $(( 65523 * $progress / $numu ))" > /proc/splash } function progressdown(){ progress=$((`cat /var/run/progressbar`)); progress=$(($progress-1)); echo $progress > /var/run/progressbar echo "show $(( 65523 * $progress / $numd ))" > /proc/splash } </nowiki></sub> Now *CAREFULLY* edit /etc/rc.d/rc.S at the top add the line (a new line by itself) <sub> . /etc/rc.d/rc.progress </sub> The . tells your system to include the functionality described in /etc/rc.d/rc.progress. Now scroll through and add "progressup" (the defined trigger in rc.progress) on a new line at the end of every subroutine where you want the progressbar to incriment up. Example section of my rc.S: <sub><nowiki> #!/bin/sh # # /etc/rc.d/rc.S: System initialization script. # # Mostly written by: Patrick J. Volkerding, <volkerdi@slackware.com> # . /etc/rc.d/rc.progress PATH=/sbin:/usr/sbin:/bin:/usr/bin # Mount /proc right away: </nowiki></sub> Don't add progressup till after your partition is mounted read/write it'll be at the end of a long segment of echo .. echo.. echo like this. <sub><nowiki> echo -n "Press ENTER to continue. " read junk; fi # Done checking root filesystem progressup </nowiki></sub> Do the same for /etc/rc.d/rc.6 adding progressdown instead of progressup. After you've finished that, you need to delete your temporary progressbar output cache. Since rc.local is run last during startup, it's best to accomplish this here. Edit rc.local: <sub><nowiki> #!/bin/sh # # /etc/rc.d/rc.local: Local system initialization script. # # Put any local startup commands in here. Also, if you have # anything that needs to be run at shutdown time you can # make an /etc/rc.d/rc.local_shutdown script and put those # commands in there. rm -fr /var/run/progressbar </nowiki></sub> == Progressbar - rc.bootsplash == An alternate script can also be used if you should have problems implementing the rc.progress script. In my case the prior script was not able to delete its progressbar file, and adding progressdown entries to rc.6 resulted in odd behaviors even during bootup when rc.6 should not of been a factor. Create a new file in /etc/rc.d/ named rc.bootsplash <sub> cd /etc/rc.d/ ; touch rc.bootsplash </sub> edit it, and add this script: <sub><nowiki> #! /bin/sh # # /etc/rc.d/rc.bootsplash: bootsplash functions. # This file does nothing if run, and is called by other rc. # files in order to make the progress bar and animations works. function progressbar() { if [ $# != 1 ] then echo "Usage: progressbar {progress}" exit 1 fi if [ -a /proc/splash ] ; then echo "show $(( 65534 * $1 / 100 ))" > /proc/splash fi } # function animate() { if [ $# = 0 ] then echo "Usage: animate {hook}" exit 1 fi splash "$*" } </nowiki></sub> Now *CAREFULLY* edit /etc/rc.d/rc.S at the top add the line (a new line by itself) <sub> . /etc/rc.d/rc.bootsplash </sub> Now scroll through and add "progressbar X" (where X is a number representing the percent to incriment to) on a new line at the end of every subroutine where you want the progressbar to incriment up. 0 is not a valid incriment. Only 1 - 100 are valid. Example rc.S <sub><nowiki> # Scan for new volume groups: /sbin/vgscan --mknodes --ignorelockingfailure 2> /dev/null if [ $? = 0 ]; then # Make volume groups available to the kernel. # This should also make logical volumes available. /sbin/vgchange -ay --ignorelockingfailure fi fi progressbar 5 # Open any volumes created by cryptsetup: if [ -f /etc/crypttab -a -x /sbin/cryptsetup.static ]; then # First, check for device-mapper support. if ! grep -wq device-mapper /proc/devices ; then # If device-mapper exists as a module, try to load it. # Try to load a device-mapper kernel module: /sbin/modprobe -q dm-mod fi cat /etc/crypttab | grep -v "^#" | grep -v "^$" | while read line; do LUKS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f1 -d' ') DEV=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f2 -d' ') PASS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f3 -d' ') OPTS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f4 -d' ') LUKSOPTS="" if echo $OPTS | grep -wq ro ; then LUKSOPTS="${LUKSOPTS} --readonly" ; fi # NOTE: we only support LUKS formatted volumes (except for swap)! if /sbin/cryptsetup.static isLuks $DEV 2>/dev/null ; then echo "Unlocking LUKS crypt volume '${LUKS}' on device '$DEV':" if [ -n "${PASS}" ]; then if [ -f ${PASS} ]; then /sbin/cryptsetup.static ${LUKSOPTS} --key-file=${PASS} luksOpen $DEV $LUKS elif [ "${PASS}" != "none" ]; then echo "${PASS}" | /sbin/cryptsetup.static ${LUKSOPTS} luksOpen $DEV $LUKS fi else for i in seq 1 3 ; do /sbin/cryptsetup.static ${LUKSOPTS} luksOpen $DEV $LUKS </dev/tty0 >/dev/tty0 2>&1 [ $? -eq 0 ] && break done fi elif echo $OPTS | grep -wq swap ; then # If any of the volumes is to be used as encrypted swap, # then encrypt it using a random key and run mkswap: echo "Creating encrypted swap on device '$DEV' mapped to '${LUKS}':" /sbin/cryptsetup.static --cipher=aes --key-file=/dev/urandom --key-size=256 create $LUKS $DEV mkswap /dev/mapper/$LUKS fi done fi # Enable swapping: /sbin/swapon -a progressbar 10 </nowiki></sub> Continue adding "progressbar X" entries in both rc.S and rc.M Do the same for rc.6 but instead incrimenting down 'X'. Example rc.6 <sub><nowiki> #! /bin/sh # # rc.6 This file is executed by init when it goes into runlevel # 0 (halt) or runlevel 6 (reboot). It kills all processes, # unmounts file systems and then either halts or reboots. # # Version: @(#)/etc/rc.d/rc.6 2.47 Sat Jan 13 13:37:26 PST 2001 # # Author: Miquel van Smoorenburg <miquels@drinkel.nl.mugnet.org> # Modified by: Patrick J. Volkerding, <volkerdi@slackware.com> # . /etc/rc.d/rc.bootsplash # Set the path. PATH=/sbin:/etc:/bin:/usr/bin progressbar 100 # If there are SystemV init scripts for this runlevel, run them. if [ -x /etc/rc.d/rc.sysvinit ]; then . /etc/rc.d/rc.sysvinit fi progressbar 90 # Set linefeed mode to avoid staircase effect. /bin/stty onlcr echo "Running shutdown script $0:" # Find out how we were called. case "$0" in *0) command="halt" ;; *6) command=reboot ;; *) echo "$0: call me as \"rc.0\" or \"rc.6\" please!" exit 1 ;; esac # Save the system time to the hardware clock using hwclock --systohc. if [ -x /sbin/hwclock ]; then # Check for a broken motherboard RTC clock (where ioports for rtc are # unknown) to prevent hwclock causing a hang: if ! grep -q -w rtc /proc/ioports ; then CLOCK_OPT="--directisa" fi if grep -q "^UTC" /etc/hardwareclock 2> /dev/null ; then echo "Saving system time to the hardware clock (UTC)." /sbin/hwclock $CLOCK_OPT --utc --systohc else echo "Saving system time to the hardware clock (localtime)." /sbin/hwclock $CLOCK_OPT --localtime --systohc fi fi progressbar 80 </nowiki></sub> 469af6549d2c3b04e94ab848706350e7046801bc Bootsplash (old) 0 55 482 257 2011-05-11T01:31:32Z Netrixtardis 146 /* Prerequisites */ wikitext text/x-wiki [[Category:Tutorials]] == Prerequisites == * kernel source * a bootsplash patch for your kernel version [http://www.mcbeister.de/bootsplash/index.html] bootsplash patch. * A bootsplash theme [http://kde-look.org/index.php?xcontentmode=61 kde-look themes] * Bootsplash utilites [http://www.yzzerdd.net/slackware/files/bootsplash/bootsplash-3.1.tar.bz2 download] == Setup == Start by patching and building a new kernel. Assuming Stock kernel configuration/source. And all your downloads are in /home/username/Downloads. <sub> cd /usr/src/linux patch -p1</home/username/Downloads/bootsplash*.diff rm .config zcat /proc/config.gz > .config make menuconfig</sub> *Note: If you insist on using the generic kernel. And are currently using it. Check to see if the .config in your /usr/src/linux directory matches /proc/config.gz <sub> zdiff /proc/config.gz /usr/src/linux/.config </sub> If they match, skip the "rm .config && zcat ..." part above You'll also want to converge your initrd.gz and bootsplash's initrd. More on that below. Edit these 2 options: <sub> Device Drivers ---> Graphics support ---> Logo configuration ---> [ ] Bootup logo Bootsplash configuration ---> [*] Bootup splash screen</sub> * If you aren't using a stock kernel configuration, or on another distro check these settings whileyou are still in the kernel configuration dialog: <sub><nowiki> Device Drivers ---> Block devices ---> <*> RAM disk support Graphics support ---> <*> Support for frame buffer devices</nowiki></sub> Now to make the patched kernel and install it <sub> make ; cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-bootsplash</sub> For slamd64, thats: <sub> make ; cp /usr/src/linux/arch/x86_64/boot/bzImage /boot/vmlinuz-bootsplash</sub> On to making a new bootsplash initrd. Compile and install the splash utility. <sub> cd /home/username/Downloads tar xf bootsplash-3.0.7.tar.bz2 cd bootsplash-3.0.7/Utilities/ make splash cp splash /usr/bin/ </sub> And use it to build your new initrd. Untar the theme file you downloaded, and check to see if it has a config directory and an image/s directory. Look in the config directory for an appropriately sized config file (usually bootsplash-1024x768.cfg). Edit this file, changing the directory it looks for images in (jpeg= option and silentjpeg= option) to point to the correct directory of the images for that theme. Example: /home/username/Downloads/bootsplashtheme/images/foo-bar.jpg Finish by making the initrd with splash: <sub> splash -s -f /home/username/Downloads/bootsplashtheme/config/bootsplash-1024x768.cfg >> /boot/initrd.splash </sub> For generic kernel users, you'll have to converge your stock initrd.gz and the bootsplash initrds. <sub>mkinitrd cp /boot/initrd.splash /boot/initrd-tree/ </sub> After putting the initrd-splash into the mkinitrd's initrd-tree you'll need to run mkinitrd again with some computer specific options. Example: <sub>mkinitrd -c -m reiserfs</sub> Remember to do this every time you make a new initrd.splash. Now edit /etc/lilo.conf with your favorite editor, adding the new kernel and bootsplash options. Sample: <sub> boot = /dev/hda message = /boot/boot_message.txt prompt timeout = 300 change-rules reset vga = 791 image = /boot/vmlinuz root = /dev/hda1 label = Linux read-only image = /boot/vmlinuz-bootsplash root = /dev/hda1 label = Bootsplash initrd=/boot/initrd.splash append="splash=silent" </sub> Substitue "initrd=/boot/initrd.gz" if you had to run mkinitrd for a generic kernel, then run lilo to update and you're set. <sub>root@slackware:~# lilo Added Linux Added Bootsplash </sub> Now you can Reboot to test everything. If boot fails for some reason. You still have your stock kernel and entry in lilo to boot into without worries. == Progressbar - rc.progress == Theres no set way to do this, you just need init to update /proc/splash correctly. The way I do it (with help from LinuxQuestiosn forums): create a new file in /etc/rc.d/ named rc.progress <sub> cd /etc/rc.d/ ; touch rc.progress </sub> edit it, and add this script: <sub><nowiki> #!/bin/sh # #rc.progress This file has a common subroutine used to update a # bootsplash progress bar. # # Count the number of times the progress bar is likely to gbe increased numu=$((`cat /etc/rc.d/rc.* | grep -c "^progressup"`)); numd=$((`cat /etc/rc.d/rc.* | grep -c "^progressdown"`)); function progressup(){ progress=$((`cat /var/run/progressbar`)); progress=$(($progress+1)); echo $progress > /var/run/progressbar echo "show $(( 65523 * $progress / $numu ))" > /proc/splash } function progressdown(){ progress=$((`cat /var/run/progressbar`)); progress=$(($progress-1)); echo $progress > /var/run/progressbar echo "show $(( 65523 * $progress / $numd ))" > /proc/splash } </nowiki></sub> Now *CAREFULLY* edit /etc/rc.d/rc.S at the top add the line (a new line by itself) <sub> . /etc/rc.d/rc.progress </sub> The . tells your system to include the functionality described in /etc/rc.d/rc.progress. Now scroll through and add "progressup" (the defined trigger in rc.progress) on a new line at the end of every subroutine where you want the progressbar to incriment up. Example section of my rc.S: <sub><nowiki> #!/bin/sh # # /etc/rc.d/rc.S: System initialization script. # # Mostly written by: Patrick J. Volkerding, <volkerdi@slackware.com> # . /etc/rc.d/rc.progress PATH=/sbin:/usr/sbin:/bin:/usr/bin # Mount /proc right away: </nowiki></sub> Don't add progressup till after your partition is mounted read/write it'll be at the end of a long segment of echo .. echo.. echo like this. <sub><nowiki> echo -n "Press ENTER to continue. " read junk; fi # Done checking root filesystem progressup </nowiki></sub> Do the same for /etc/rc.d/rc.6 adding progressdown instead of progressup. After you've finished that, you need to delete your temporary progressbar output cache. Since rc.local is run last during startup, it's best to accomplish this here. Edit rc.local: <sub><nowiki> #!/bin/sh # # /etc/rc.d/rc.local: Local system initialization script. # # Put any local startup commands in here. Also, if you have # anything that needs to be run at shutdown time you can # make an /etc/rc.d/rc.local_shutdown script and put those # commands in there. rm -fr /var/run/progressbar </nowiki></sub> == Progressbar - rc.bootsplash == An alternate script can also be used if you should have problems implementing the rc.progress script. In my case the prior script was not able to delete its progressbar file, and adding progressdown entries to rc.6 resulted in odd behaviors even during bootup when rc.6 should not of been a factor. Create a new file in /etc/rc.d/ named rc.bootsplash <sub> cd /etc/rc.d/ ; touch rc.bootsplash </sub> edit it, and add this script: <sub><nowiki> #! /bin/sh # # /etc/rc.d/rc.bootsplash: bootsplash functions. # This file does nothing if run, and is called by other rc. # files in order to make the progress bar and animations works. function progressbar() { if [ $# != 1 ] then echo "Usage: progressbar {progress}" exit 1 fi if [ -a /proc/splash ] ; then echo "show $(( 65534 * $1 / 100 ))" > /proc/splash fi } # function animate() { if [ $# = 0 ] then echo "Usage: animate {hook}" exit 1 fi splash "$*" } </nowiki></sub> Now *CAREFULLY* edit /etc/rc.d/rc.S at the top add the line (a new line by itself) <sub> . /etc/rc.d/rc.bootsplash </sub> Now scroll through and add "progressbar X" (where X is a number representing the percent to incriment to) on a new line at the end of every subroutine where you want the progressbar to incriment up. 0 is not a valid incriment. Only 1 - 100 are valid. Example rc.S <sub><nowiki> # Scan for new volume groups: /sbin/vgscan --mknodes --ignorelockingfailure 2> /dev/null if [ $? = 0 ]; then # Make volume groups available to the kernel. # This should also make logical volumes available. /sbin/vgchange -ay --ignorelockingfailure fi fi progressbar 5 # Open any volumes created by cryptsetup: if [ -f /etc/crypttab -a -x /sbin/cryptsetup.static ]; then # First, check for device-mapper support. if ! grep -wq device-mapper /proc/devices ; then # If device-mapper exists as a module, try to load it. # Try to load a device-mapper kernel module: /sbin/modprobe -q dm-mod fi cat /etc/crypttab | grep -v "^#" | grep -v "^$" | while read line; do LUKS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f1 -d' ') DEV=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f2 -d' ') PASS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f3 -d' ') OPTS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f4 -d' ') LUKSOPTS="" if echo $OPTS | grep -wq ro ; then LUKSOPTS="${LUKSOPTS} --readonly" ; fi # NOTE: we only support LUKS formatted volumes (except for swap)! if /sbin/cryptsetup.static isLuks $DEV 2>/dev/null ; then echo "Unlocking LUKS crypt volume '${LUKS}' on device '$DEV':" if [ -n "${PASS}" ]; then if [ -f ${PASS} ]; then /sbin/cryptsetup.static ${LUKSOPTS} --key-file=${PASS} luksOpen $DEV $LUKS elif [ "${PASS}" != "none" ]; then echo "${PASS}" | /sbin/cryptsetup.static ${LUKSOPTS} luksOpen $DEV $LUKS fi else for i in seq 1 3 ; do /sbin/cryptsetup.static ${LUKSOPTS} luksOpen $DEV $LUKS </dev/tty0 >/dev/tty0 2>&1 [ $? -eq 0 ] && break done fi elif echo $OPTS | grep -wq swap ; then # If any of the volumes is to be used as encrypted swap, # then encrypt it using a random key and run mkswap: echo "Creating encrypted swap on device '$DEV' mapped to '${LUKS}':" /sbin/cryptsetup.static --cipher=aes --key-file=/dev/urandom --key-size=256 create $LUKS $DEV mkswap /dev/mapper/$LUKS fi done fi # Enable swapping: /sbin/swapon -a progressbar 10 </nowiki></sub> Continue adding "progressbar X" entries in both rc.S and rc.M Do the same for rc.6 but instead incrimenting down 'X'. Example rc.6 <sub><nowiki> #! /bin/sh # # rc.6 This file is executed by init when it goes into runlevel # 0 (halt) or runlevel 6 (reboot). It kills all processes, # unmounts file systems and then either halts or reboots. # # Version: @(#)/etc/rc.d/rc.6 2.47 Sat Jan 13 13:37:26 PST 2001 # # Author: Miquel van Smoorenburg <miquels@drinkel.nl.mugnet.org> # Modified by: Patrick J. Volkerding, <volkerdi@slackware.com> # . /etc/rc.d/rc.bootsplash # Set the path. PATH=/sbin:/etc:/bin:/usr/bin progressbar 100 # If there are SystemV init scripts for this runlevel, run them. if [ -x /etc/rc.d/rc.sysvinit ]; then . /etc/rc.d/rc.sysvinit fi progressbar 90 # Set linefeed mode to avoid staircase effect. /bin/stty onlcr echo "Running shutdown script $0:" # Find out how we were called. case "$0" in *0) command="halt" ;; *6) command=reboot ;; *) echo "$0: call me as \"rc.0\" or \"rc.6\" please!" exit 1 ;; esac # Save the system time to the hardware clock using hwclock --systohc. if [ -x /sbin/hwclock ]; then # Check for a broken motherboard RTC clock (where ioports for rtc are # unknown) to prevent hwclock causing a hang: if ! grep -q -w rtc /proc/ioports ; then CLOCK_OPT="--directisa" fi if grep -q "^UTC" /etc/hardwareclock 2> /dev/null ; then echo "Saving system time to the hardware clock (UTC)." /sbin/hwclock $CLOCK_OPT --utc --systohc else echo "Saving system time to the hardware clock (localtime)." /sbin/hwclock $CLOCK_OPT --localtime --systohc fi fi progressbar 80 </nowiki></sub> 9d811d340b6a1aa9238315f236c1d8e9c271a30e Slack-desc 0 17 483 472 2011-05-12T19:37:41Z Merge-delete 261 Added Tools section, with links to tools that generate slack-desc files wikitext text/x-wiki =Overview= A proper slack-desc file should be written as follows: # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| appname: appname (Short description of the application) appname: <this line is generally left blank> appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname: The "appname" string must *exactly* match the application name portion of the Slackware package (for example, a package titled "gaim-1.5-i486-1.tgz" must have a slack-desc file with the <appname> string of "gaim: " rather than "Gaim: " or "GAIM: " or something else. The first line ''must'' show the application name followed by a short description (enclosed in parentheses). The "handy ruler" is meant to stop you at 79 characters, because the standard console is 80x25 and if you go beyond this the words will wrap. The space after the : is needed only when there is text after the : In the above example lines 9 & 11 should not have a space after the : =Tools= 1. There is a command-line tool that automates the creation of slack-desc files and helps you generate legal slack-desc files with minimal effort: http://slack-desc.sourceforge.net/ 2. A web-based tool is also available at: http://www.linuxpackages.net/slackcreator.php =See Also= man makepkg man pkgtool [[Category:Tutorials]] 242781af77d76a443f16591f75a566dad0467aa2 Building A Package 0 23 484 358 2011-05-12T20:39:39Z Merge-delete 261 Added link to slack-desc section and link to slack-desc generation tool wikitext text/x-wiki [[Category:Tutorials]] = Intro = This is a rough outline for building Slackware packages. Some steps may not be neccessary, some steps might be missing. Use the discussion page for side-notes such as using slacktrack (when DESTDIR fails) and other utilities like checkinstall. == The good and decent way == Configure and compile the source as you usually do: ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc make Make a temporary destination directory available: mkdir /tmp/build Install into the temporary directory: make install DESTDIR=/tmp/build Now strip libs/bins within the temporary directory: strip -s /tmp/build/usr/lib/* /tmp/build/usr/bin/* You also want to make sure that anything in <tt>/usr/man</tt> is gzipped before you make the package: gzip -9 /tmp/build/usr/man/man?/*.? Create the <tt>install</tt> directory, this is where the description and install script will be stored: cd /tmp/build mkdir install cd install Using a text editor (or a [http://slack-desc.sourceforge.net/ tool]]), create a file called [[slack-desc]] and fill it with the following contents: |-----handy-ruler------------------------------------------------------| app: Application Name (Short/Brief description) app: app: Enter a description of the package you are building. app: All 11 "app:" lines must be present app: "app" needs to be your application name. app: The handy-ruler is there to help you, these lines should not exceed app: 79 characters. app: app: app: app: Create the actual package: cd /tmp/build makepkg ../app-version-arch-tag.tgz ''(The dashes should appear as above, so if the version has a subversion like say "1.0 RC2" make sure you use 1.0_RC2 not 1.0-RC2. The arch should be something like "i486" for example. The tag should consist of the build number and your initals, e.g. 1zb for Zaphod Beeblebrox's first build, 2zb for his second build, etc. Official slackware packages have only numbers as tags.)'' When prompted to recreate symbolic links, say <tt>yes</tt><br> When prompted to reset permissions, say <tt>no</tt> ''Note: Using '''makepkg -l y -c n''' will give you the same behaviour as answering yes to the symlinks question, and no to the permissions question.'' If all went well, you can now install the package. cd .. installpkg app-version-arch-tag.tgz == The "i don't have time" way == Fortunately, Slackware are pretty flexible too. If you don't mind much about what is the source (beware!) that you're compiling you can burn some stages and do something like this: ./configure --prefix=/usr make install DESTDIR=$(pwd)/PACKAGE cd $(pwd)/PACKAGE makepkg -l y -c n ../app-version-arch-tag.tgz installpkg ../app-version-arch-tag.tgz Of course, you will have a package without description, (probably) uncompressed man pages and unstripped binaries. ---- For more information, also see the pages on [[SlackBuild_Scripts]] and [[Different_Approach_To_Buildscripts]]. ---- e243a2544503cedcd63bcf8a9d895edfb2280bb1 SLiM 0 212 486 311 2011-05-27T05:05:25Z Netrixtardis 146 use '-nodaemon' for rc.4 wikitext text/x-wiki [[category:tutorials]] '''SLiM (Simple Login Manager)''' is a Desktop-independent graphical login manager for X11, derived from [http://largo.windowmaker.org/Login.app/ Login.app]. It aims to be light and simple, although completely configurable through themes and an option file; is suitable for machines on which remote login functionalities are not needed. == Features == * PNG and XFT support for alpha transparency and antialiased fonts * External themes support * Configurable runtime options: X server, login / shutdown / reboot commands * Single (GDM-like) or double (XDM-like) input control * Can load predefined user at startup * Configurable welcome / shutdown messages * Random theme selection == Requirements == * X11 * libpng * libjpeg * freetype == Instalation == Use package, SlackBuild or compile it from source. == Configuration == === Themes === Themes are located in /usr/share/slim/themes. If you want more themes, try themepack or standalone theme from [http://developer.berlios.de/project/showfiles.php?group_id=2663 project download page]. Unpack file there <pre> $ tar xvzf themefile.tar.gz -C /usr/share/slim/themes </pre> By default SLiM use ''default'' theme. You can change it in it's configuration file /etc/slim.conf by rewriting ''current_theme'' line <pre> # current theme, use comma separated list to specify a set to # randomly choose from #current_theme default current_theme theme_you_like </pre> If you use SlackBuild (at least for 13.0) it comes with nice Slackware theme. Rewrite ''current_theme'' line to <pre> current_theme slackware-black </pre> === Startup === Edit run level 4 init script - /etc/rc.d/rc.4 - to try start SLiM as default graphical login manager. You have to add these lines '''before''' GDM (or whatever graphical login manager you have as default; GDM is set as first to start by default) <pre> #! /bin/sh # # rc.4 This file is executed by init(8) when the system is being # initialized for run level 4 (XDM) # # Version: @(#)/etc/rc.d/rc.4 2.00 02/17/93 # # Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> # At least 47% rewritten by: Patrick J. Volkerding <volkerdi@slackware.com> # # Tell the viewers what's going to happen... echo "Starting up X11 session manager..." # Add this if statement to the top # If you have SliM, it goes first #--------------------------------- if [ -x /usr/bin/slim ]; then exec /usr/bin/slim -nodaemon fi #--------------------------------- # end of new if statement # Try to use GNOME's gdm session manager. This comes first because if # gdm is on the machine then the user probably installed it and wants # to use it by default: if [ -x /usr/bin/gdm ]; then exec /usr/bin/gdm -nodaemon fi </pre> If you aren't already using this, set run level to 4 in /etc/inittab <pre> # These are the default runlevels in Slackware: # 0 = halt # 1 = single user mode # 2 = unused (but configured the same as runlevel 3) # 3 = multiuser mode (default Slackware runlevel) # 4 = X11 with KDM/GDM/XDM (session managers) # 5 = unused (but configured the same as runlevel 3) # 6 = reboot # Default runlevel. (Do not set to 0 or 6) id:4:initdefault: </pre> Reboot and you have nice simple login manager running :~) == Links == [http://slim.berlios.de Project homepage] 21af03cd3620a8ad884e51029b1fe799a1a1dcd4 User:Erik 2 2 488 301 2011-06-07T09:21:29Z Erik 1 wikitext text/x-wiki Name: [mailto:erik@sl1200.org Erik Hanson]<br> Web: [http://sl1200.org/~erik/ http://sl1200s.org/~erik/]<br> IRC: erik @ [irc://frop.taphouse.org/ Taphouse Cabal] and [irc://chat.freenode.net The Freenode Network]<br> 6945a61c62172eecffa218ed6621095b7653f6ad Links 0 3 489 418 2011-06-07T09:22:29Z Erik 1 wikitext text/x-wiki [[Category:Information]] ==Slackware Links== * http://www.slackware.com - the home of Slackware * http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ - Slackware FAQ by [[User:juhl|juhl]] (Jesper Juhl) * http://www.slackbook.org - updated version of the slackware book * http://www.slackware.com/getslack - Extensive listing of Slackware mirrors * http://www.linuxquestions.org/questions/slackware-14/ - Slackware forum * http://slackbuilds.org/ - Build scripts for additional software * http://sbopkg.org - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository * http://www.kde-look.org/content/show.php?content=23384 - Slack-Track - a superkaramba theme to track the slackware-current changelog on your desktop, created by [[User:omal|omal]] * http://jtgzmanager.sf.net/ - A new frontend to pkgtools built with Qt4 C++ libs - by Alexandre Arnt * http://slackbot.sourceforge.net - Buildsystem and buildtools for Slackware * http://slackware.linux.or.id - Indonesian Slackware Community - by [[User:Willysr|Willysr]] * http://open-eslack.org/ - Spanish Slackware community * http://www.slack-world.com - Iranian Slackware Community ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==Free packages== * [http://slackware.com/~alien/ http://slackware.com/~alien/] Eric Hameleers' packages * [http://rlworkman.net/pkgs/ http://rlworkman.net/pkgs/] rworkman's packages * http://www.linuxpackages.net/ * [http://www.slacky.eu/repository/slackware-11.0/ Slacky.eu] Italian Slackware site * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware * [http://scxd.info/en/ Slackware Current eXtended Desktop] Packages for Slackware Current ==.SlackBuild Repositories== * http://slackbuilds.org - The SlackBuilds.org Project * http://slackbuilds.net - The French SlackBuilds Repository * http://www.slackware.com/~alien/slackbuilds/ - Eric "Alien" Hameleer's SlackBuilds * http://slackbuild.strangeworlds.co.uk - cathectic's SlackBuilds * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. * http://scxd.info/pub/slackbuilds/ - Slackware Current eXtended Desktop's SlackBuilds ==Live CD's based on Slackware== * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://alien.slackbook.org/ Alien Bob's Wiki] * http://open-eslack.org/wiki/ - Wiki of the Slackware spanish community * http://slackware.linux.or.id/wiki/ - Indonesian Slackware Wiki ==RSS Feeds== * http://dev.slackware.it/rss/ - RSS feeds for stable Slackware release and -current ChangeLog * http://slackbuilds.org/mirror/rss/ - ChangeLog RSS feeds for stable and current 0aba648d3f75ab0d38e426c5a7c21a0407e257a6 516 489 2011-09-09T12:32:09Z Klickback 198 Added new links, Improved formatting, and removed obsolete links wikitext text/x-wiki [[Category:Information]] ==Slackware Links== * http://www.slackware.com - the home of Slackware * [http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ Slackware FAQ by] [[User:juhl|juhl]] (Jesper Juhl) * [http://www.nielshorn.net/slackware/slack_versions.php A complete overview of all Slackware versions] by Niels Horn * [http://www.slackbook.org Updated version of the slackware book] * [http://www.slackware.com/getslack Extensive listing of Slackware mirrors] * [http://www.linuxquestions.org/questions/slackware-14/ Slackware forum] on LinuxQuestions.org * [http://slackbuilds.org/ slackbuilds.org - Build scripts for additional software] * [http://sbopkg.org sbopkg.org] - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository * [http://gitorious.org/sbopkg-slackware-queues Build queues for all Slackware packages from SlackBuilds.org] * [http://slackworld.berlios.de/ The Slack World page on berlios] * [http://slacky.eu European Slackware community] * [http://slackware.linux.or.id Indonesian Slackware Community] - by [[User:Willysr|Willysr]] * [http://open-eslack.org/ Spanish Slackware community] * [http://www.slack-world.com Iranian Slackware Community] * http://jtgzmanager.sf.net/ A new frontend to pkgtools built with Qt4 C++ libs - by Alexandre Arnt * http://slackbot.sourceforge.net - Buildsystem and buildtools for Slackware * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. ==Free packages== * [http://connie.slackware.com/~alien/slackbuilds/ Eric Hameleers' packages] [http://slackware.org.uk/people/alien/slackbuilds/ mirror] * [http://rlworkman.net/pkgs/ rworkman's packages] [http://slackware.org.uk/people/rlworkman/ mirror] * [http://www.nielshorn.net/slackware/slack_pkg.php Niels Horn's packages] * http://www.linuxpackages.net/ * [http://repository.slacky.eu/ Slacky.eu] Italian Slackware site * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware ==SlackBuild Repositories== * [http://slackbuilds.org The SlackBuilds.org Project] * [http://www.slackware.com/~alien/slackbuilds/ Eric "Alien" Hameleer's SlackBuilds] * [http://slackware.org.uk/people/rlworkman/sources/ rworkman's SlackBuilds] ==Live CD's based on Slackware== * [http://porteus.org/ Porteus] - A fast, portable and modular live CD/USB, originally started as a community remix of Slax * [http://www.imagineos.com.br/ ImagineOS] (formerly GoblinX) * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://alien.slackbook.org/ Alien Bob's Wiki] * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://open-eslack.org/wiki/ A Spanish Slackware Wiki] ==RSS Feeds== * http://dev.slackware.it/rss/ - RSS feeds for stable Slackware release and -current ChangeLog * http://slackbuilds.org/mirror/rss/ - ChangeLog RSS feeds for stable and current ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs 96e64aefdbf0a3842352843fd95b2c61044005ba Install Slackware Using A USB Flash Drive 0 233 490 439 2011-06-07T11:08:05Z Merge-delete 261 Installation quirks wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk Make it hybrid: isohybrid slackware-13.1-install-dvd.iso == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. The following command will overwrite all the files currently present on the USB drive so prior backups are highly advisable: dd if=slackware-13.1-install-dvd.iso of=/dev/sdX PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. Before running '''setup''', look up (with '''fdisk -l''') which device your USB drive is, and mount the device to some location: mkdir flash && mount /dev/sdX1 flash When installing, choose "Install from a hard drive partition", with the USB drive as source partition. Other than that, installation process should be no different than when installing from a DVD. b2496012dc8976cf5aa9abd4bea7454bcceeae11 Main Page 0 1 492 449 2011-06-13T22:55:35Z Erik 1 Upgraded Mediawiki wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. [[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) e5c6152fa1fae19926f4ca8f6569dc15cebcb2fb ALSA 0 35 493 420 2011-06-13T23:00:14Z Erik 1 Added sepaker-test wikitext text/x-wiki [[Category:Tutorials]] Sound problems *should* be rare these days, and of the ones that still exist, they are likely related to suspend/resume. Those are driver issues which are largely out of your control, but see the documentation with the pm-utils package for details on handling those issues. : <code>alsaconf</code> used to be needed to set up sound cards in linux, but even that shouldn't be needed in recent linux distributions - everything should be handled automatically. : <code>alsamixer</code> can be used to change the volume. : <code>alsactl store</code> is used to save the volume settings. : <code>alsactl restore</code> is used to restore the volume settings. This is automatically run on boot, so you usually won't need to run this command. : <code>speaker-test</code> is used to test speaker output. There is one tip for the Sound Baster 5.1 cards: sometimes you want to MUTE digital out so you can hear on all the speakers; in alsamixer, you just press M on the <tt>Analog/Digital Output Jack</tt> item. c8426a3bd290171f0e6312a45822c49ebfa153a4 494 493 2011-06-13T23:04:09Z Erik 1 Added aplay wikitext text/x-wiki [[Category:Tutorials]] Sound problems *should* be rare these days, and of the ones that still exist, they are likely related to suspend/resume. Those are driver issues which are largely out of your control, but see the documentation with the pm-utils package for details on handling those issues. : <code>alsaconf</code> used to be needed to set up sound cards in linux, but even that shouldn't be needed in recent linux distributions - everything should be handled automatically. : <code>alsamixer</code> can be used to change the volume. : <code>alsactl store</code> is used to save the volume settings. : <code>alsactl restore</code> is used to restore the volume settings. This is automatically run on boot, so you usually won't need to run this command. : <code>aplay</code> a command-line sound player. : <code>speaker-test</code> is used to test speaker output. There is one tip for the Sound Baster 5.1 cards: sometimes you want to MUTE digital out so you can hear on all the speakers; in alsamixer, you just press M on the <tt>Analog/Digital Output Jack</tt> item. 8f0b882893fcba71080a7162dc2be988833aebcf 495 494 2011-06-13T23:27:45Z Erik 1 Checking ConfirmEdit extension wikitext text/x-wiki [[Category:Tutorials]] Sound problems *should* be rare these days, and of the ones that still exist, they are likely related to suspend/resume. Those are driver issues which are largely out of your control, but see the documentation with the pm-utils package for details on handling those issues. : <code>alsaconf</code> used to be needed to set up sound cards in linux, but even that shouldn't be needed in recent linux distributions - everything should be handled automatically. : <code>alsamixer</code> can be used to change the volume. : <code>alsactl store</code> is used to save the volume settings. : <code>alsactl restore</code> is used to restore the volume settings. This is automatically run on boot, so you usually won't need to run this command. There is one tip for the Sound Baster 5.1 cards: sometimes you want to MUTE digital out so you can hear on all the speakers; in alsamixer, you just press M on the <tt>Analog/Digital Output Jack</tt> item. ccf2823bf01fa3c8f6a7ea8413679d96cbcfe20c The Regulars 0 4 496 455 2011-06-24T22:02:36Z Alisonken1 38 /* Others */ wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Alisonken1[Alisonken1]] * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:cpunches|cpunches]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|dchmelik]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jcm |jcm]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:robert-brown|robert-brown]] * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] * [[User:natex|natex]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. 9512faa000cd4d66f9acbe5e5ac2dc9652a51ac2 497 496 2011-06-24T22:03:26Z Alisonken1 38 /* Others */ wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Alisonken1|Alisonken1]] * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:cpunches|cpunches]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|dchmelik]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jcm |jcm]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:robert-brown|robert-brown]] * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] * [[User:natex|natex]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. e5853917ce5c345599ba8784e314c0f4ce79e7cb 517 497 2011-09-09T13:05:46Z Adioe3 199 /* Others */ wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Adioe3|adioe3]] * [[User:Alisonken1|Alisonken1]] * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:cpunches|cpunches]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|dchmelik]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jcm |jcm]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:robert-brown|robert-brown]] * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] * [[User:natex|natex]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. d9e481250835d2428c0c318d6b0a3c8b70ab9079 User:Alisonken1 2 242 498 2011-06-24T22:05:15Z Alisonken1 38 Created page with "Real name: Ken Roberts IRC Nickname: alisonken1 Slackware mirror that I maintain: http://slackware.dreamhost.com/slackware" wikitext text/x-wiki Real name: Ken Roberts IRC Nickname: alisonken1 Slackware mirror that I maintain: http://slackware.dreamhost.com/slackware fb1b30215caa521c33a510c99773cf52c6d13b87 499 498 2011-06-24T22:06:02Z Alisonken1 38 wikitext text/x-wiki * Real name: Ken Roberts * IRC Nickname: alisonken1 * Slackware mirror that I maintain: http://slackware.dreamhost.com/slackware 03f96b3ce662091c29ffa3d5048f2220743361b7 Slapt-get 0 161 500 189 2011-06-25T17:03:12Z Merge-delete 261 /* Distributions */ wikitext text/x-wiki '''slapt-get''' is an [[APT]]-like system for [http://en.wikipedia.org/wiki/Slackware Slackware] [[package management]]. It tries to emulate the features of [[Debian]]'s [[apt-get]] as closely as possible. ==Features== * uses native [http://en.wikipedia.org/wiki/Slackware Slackware] tools (installpkg, upgradepkg, and removepkg) * supports multiple package sources (including http://linuxpackages.net) * cache data concerning packages and updates from package sources * supports sources from ftp, ftps, http, https, file:/// and more (libcurl) * resumes broken downloads and will verify package integrity with [http://en.wikipedia.org/wiki/Md5 MD5] checksum * show packages that are available (from cached data) and installed * search package listing using [http://en.wikipedia.org/wiki/POSIX POSIX] and extended [http://en.wikipedia.org/wiki/Regular_expressions regular expressions] by package name, location, and description * retrieve, install, and remove packages by name or by specific version * retrieve and apply updates * upgrade from one Slackware release to another in a few simple steps - see [[Upgrade_Using_Slapt-get]] * show description of packages, including mirror location, version, size, dependencies (where available, see [http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ10 FAQ]), conflicts (where available, see [http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ31 FAQ]), suggestions (where available, see [http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ44 FAQ]), description, and installation status * exclude (hold) packages from upgrades, by name or by regular expression * transaction engine for install, remove, and upgrades, reporting concise information on what is to be done, ensuring each step happens correctly * "compare package version" algorithm to prevent downgrades * recursive dependency resolution using slack-required meta-data ([http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ10 see FAQ]) supporting hard, soft, and conditional dependencies * package conflict resolution using slack-conflicts meta-data ([http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ31 see FAQ]) * package suggestion support for complimentary packages ([http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ44 see FAQ]) * Package data download robustness, only writing changes if all sources download successfully as well as only downloading those sources that have changed since the last download * [http://en.wikipedia.org/wiki/I18n i18n] support via [http://en.wikipedia.org/wiki/GNU GNU] gettext with over 20 language translations * extremely fast and easy to script with ==Dependencies== slapt-get does not provide dependency resolution for packages included within the Slackware distribution. It does, however, provide a framework for dependency resolution in Slackware compatible packages similar in fashion to the hand-tuned method [http://en.wikipedia.org/wiki/Advanced_Packaging_Tool Advanced Packaging Tool|APT] utilizes. Several package sources and Slackware based distributions take advantage of this functionality. Adding dependency information requires no modification to the packages themselves. Rather, the package listing file, PACKAGES.TXT, is used to specify these relationships. This file is provided by [http://en.wikipedia.org/wiki/Patrick_Volkerding Patrick Volkerding] and is similar to the Packages.gz file in use by [http://en.wikipedia.org/wiki/Debian Debian]. Several scripts are available to generate the PACKAGES.TXT file from a group of packages (See [http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ17 FAQ #17]). The file format used by [http://en.wikipedia.org/wiki/Patrick_Volkerding Patrick Volkerding] is extended by adding a few extra lines per package. slapt-get then parses this file during source downloads. Typically, third party packages store the dependency information within the package itself for later extraction into the PACKAGES.TXT ([http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ19 See FAQ #19]). The inclusion of this information within the Slackware package format does not inhibit the ability for Slackware pkgtools to install these packages. This information is silently ignored and discarded after the package is installed. [http://www.stabellini.net/depslack.html Other methods] exist for adding dependency information for official Slackware packages without altering the packages themselves. ==Package Sources== slapt-get works with official Slackware mirrors and third party package repositories. slapt-get looks for support files, PACKAGES.TXT and CHECKSUMS.md5, in the repository for package information. These files provide package names, versions, sizes (both compressed and uncompressed), checksums, as well as a package description. These files can be extended, as discussed in the previous section, to add dependency listings, conflict information, and package suggestions. These files can also proxy for other remote sources by specifying a MIRROR declaration for each package. ==libslapt== slapt-get exports a [http://en.wikipedia.org/wiki/C_programming_language C] [http://en.wikipedia.org/wiki/Library_(computer_science) library] that is used by [http://en.wikipedia.org/wiki/gslapt gslapt] to provide similar functionality through a [http://en.wikipedia.org/wiki/GTK+ GTK+] frontend. ==Distributions== Besides Slackware, slapt-get may be used with or included by the following distributions: * [http://www.vectorlinux.com Vector Linux] * [http://www.mutagenix.org Mutagenix] * [http://slax.linux-live.org SLAX] * [http://www.slamd64.com/ Slamd64] * [http://gsb.sourceforge.net/ Freerock GNOME] * [http://www.gware.org/ GWARE GNOME] * [http://slampp.abangadek.com/ SLAMPP] * [http://getopenlab.com/ OpenLab GNU/Linux] * [http://ocsid.spaghettilinux.org/ Open Community Slackware Install DVD] * [http://floyd-linux.pappapc.com/ Floyd GNU/Linux] * [http://www.stibs.cc/stx/ STX GNU/Linux] * [http://www.nnlinux.com/ Nonux GNU/Linux] * [http://wolvix.org/ Wolvix LiveCD] * [http://www.collegelinux.org College Linux] * [http://www.zenwalk.org/ Zenwalk Linux] * [http://www.truvalinux.org.tr Truva Linux] * [http://sms.it-ccs.com SMS(Superb Mini Server)] ==Examples== $ slapt-get --update Retrieving package data http://www.slackware.at/data/slackware-10.0/ ...Done Retrieving patch list http://www.slackware.at/data/slackware-10.0/ ...Done Retrieving checksum list http://www.slackware.at/data/slackware-10.0/ ...Done Reading Package Lists...Done Retrieving package data http://software.jaos.org/slackpacks/10.0/ ...Cached Retrieving patch list http://software.jaos.org/slackpacks/10.0/ ...Cached Retrieving checksum list http://software.jaos.org/slackpacks/10.0/ ...Cached Reading Package Lists...Done $ slapt-get --upgrade Reading Package Lists... Done The following packages have been EXCLUDED: devs kernel-headers The following packages will be upgraded: binutils bash bin bind cdrtools bzip2 kbd cups cxxlibs e2fsprogs etc gawk gcc gdb inetd infozip less links logrotate lynx man man-pages openssh openssl openssl-solibs pidentd pkgtools procps sed shadow slocate sysklogd sysvinit tar tcpip util-linux vim wget zlib 39 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. Need to get 36710K of archives. After unpacking 17880K of additional disk space will be used. Do you want to continue? [y/N] $ slapt-get --show slapt-get Package Name: slapt-get Package Mirror: http://software.jaos.org/slackpacks/10.0/ Package Location: . Package Version: 0.9.9f-i386-1 Package Size: 147 K Package Installed Size: 530 K Package Required: curl >= 7.12.0-i486-1,glibc-solibs >= 2.3.2-i486-7,binutils,openssl >= 0.9.7d-i486-1,pkgtools,zlib Package Conflicts: Package Suggests: Package MD5 Sum: cb4b44cbb4efee4e993109231b107828 Package Description: slapt-get: slapt-get (APT like system for Slackware) slapt-get: slapt-get is an APT like system for Slackware package management. slapt-get: slapt-get: * See /usr/doc/slapt-get-0.9.9f/ for complete documentation. slapt-get: * You will also want to customize /etc/slapt-get/slapt-getrc, slapt-get: using a local mirror. www.slackware.com may be very busy. slapt-get: * Support: slapt-get: http://software.jaos.org/cgi-bin/mailman/listinfo/slapt-get-user slapt-get: * Please translate slapt-get: http://software.jaos.org/BUILD/slapt-get/po/slapt-get.pot slapt-get: then send to slapt-get-devel@software.jaos.org slapt-get: Package Installed: yes ==External links== *[http://software.jaos.org/#slapt-get Homepage] [[Category:Information]] fa97bc4ad0e9d8c334d8edb2b1e551172ef82772 Upgrade Using Slapt-get 0 174 501 202 2011-06-26T10:37:24Z Merge-delete 261 wikitext text/x-wiki [[Category:Tutorials]] = Introduction = See the [[Slapt-get]] page for an introduction to slapt-get and its functionality. Prior to using slapt-get, you should really be familiar with proper usage of the native Slackware package management tools: man pkgtool man installpkg man upgradepkg man removepkg As indicated in the link above, slapt-get is *not* a replacement for those utilities - it *uses* those utilities. As such, any inherent "limitations" (yes, I use that term loosely) in the pkgtool suite will also apply to slapt-get. = Installation and Configuration = Get the [[slapt-get]] package for your version of Slackware. Once it's installed, configure it to point to your favourite mirror (edit '''/etc/slapt-get/slaptgetrc''') # See /usr/doc/slapt-get-0.10.1/example.slapt-getrc # for example source entries and configuration hints. WORKINGDIR=/var/slapt-get EXCLUDE=^kernel-.*,^alsa-.*,^glibc.*,.*-[0-9]dl$,^devs$,^udev$,aaa_elflibs,x86_64 SOURCE=http://slackware.osuosl.org/slackware-12.2/:OFFICIAL SOURCE=http://software.jaos.org/slackpacks/12.2/:OFFICIAL = Usage Hints = Depending upon your individual goals of using slapt-get, the usage hints will vary. An individual wishing to upgrade from one release of Slackware to another will have more issues with which to contend than another individual who simply wants to keep up-to-date with official security/stability patches. The biggest piece of advice I can give to *anyone* regardless of how/why you're using slapt-get is this: READ THE CHANGELOG! The pertinent portions of the changelog are also viewable for each package using --show option. You'll be okay most of the time if you ignore this advice, but don't come crying to ##slackware if you do... :) From '''man slapt-get''': UPGRADE.TXT and ChangeLog.txt is still required reading, the latter is especially true when running -current. By the way, don't even consider trying to follow the Slackware -current development using slapt-get; that's just *asking* for a problem (for reasons which will hopefully be clear later). Official ChangeLog is at ftp://ftp.slackware.com/pub/slackware/slackware-12.2/ChangeLog.txt Replace the "12.2" with the release version you're using. Rather than using the official ChangeLog (and Slackware.com bandwidth), it's better to use one of the official Slackware mirrors (you'll notice faster connections with the mirrors): <SlackwareMirror>/slackware-<version>/ChangeLog.txt See the Slackware site [[http://slackware.com/getslack/]] to find an official mirror site. == Usage Hint #1: Security and Stability Patches == If your only goal is to stay up-to-date with official security and stability patches for your version of Slackware, then the default configuration of slapt-get should work fine for you. While I'm not the author of slapt-get (Jason, feel free to jump in here), it seems to me that this was the original intent of slapt-get (and it works *extremely* well for that task, might I add). The only exception of which I can think is kernel upgrades; thankfully, those haven't happened *too* often in official releases in recent memory, but they do occur frequently enough to be worth considering. The default configuration of slapt-get will ignore kernel upgrades, so the only way you'll know about those is by reading the official ChangeLog. Anyway, every time you upgrade your kernel, you'll need to make sure the paths in '''/etc/lilo.conf''' point to a valid kernel, and then run '''/sbin/lilo''' to reinstall LILO. If you use some other boot loader, then I'm going to assume you know enough about its usage to perform the corresponding operation (if required) after upgrading your kernel. I would recommend that you keep your old kernel around when installing a new one; it's always good to have a known-good kernel lying around just in case the new one doesn't boot. However, you'll notice that by default, running this command: slapt-get --install kernel-$VERSION will *upgrade* the kernel; in other words, it will *remove* the old kernel package and *install* the new one. This is not desirable if you wanted to keep your old kernel, so you can run this command instead: slapt-get --install --no-upgrade kernel-$VERSION From '''man slapt-get''': --no-upgrade Install the package rather than attempting to detect if a previous version is installed and upgrading it. This is useful for installing kernel packages. This option is only valid for --install targets. You might also find this option useful for installing multiple versions of the alsa-* packages; if you're running both 2.4.x and 2.6.x kernels, you'll need the alsa-driver packages for both kernels, so an *upgrade* of the 2.4.x version to 2.6.x will remove the 2.4.x version. == Usage Hint #2: Upgrade From One Release To Another == Every Slackware release includes a file named UPGRADE.TXT - it was included for a reason, so READ IT! Once you are familiar with its contents, the rationale behind the information below will make more sense. === Step 1: Edit your /etc/slapt-get/slaptgetrc === Edit your '''/etc/slapt-get/slaptgetrc''' file to reflect the new Slackware version This: SOURCE=http://slackware.osuosl.org/slackware-12.1/ SOURCE=http://software.jaos.org/slackpacks/12.1/ becomes this: SOURCE=http://slackware.osuosl.org/slackware-12.2/:OFFICIAL SOURCE=http://software.jaos.org/slackpacks/12.2/:OFFICIAL === Step 2: Download all updated packages === Download all updated packages to slapt-get's working directory; by default, this is '''/var/slapt-get''' slapt-get --dist-upgrade --ignore-excludes --download-only === Step 3: Put your machine in single-user mode === Make sure you have already performed step 2, because the network will not be available in runlevel 1. telinit 1 === Step 4: Upgrade main packages === Versions >= 0.9.11 upgrade glibc-solibs, pkgtools, and sed first , and then upgrade the remainder of the packages. If you have read the UPGRADE.TXT file, you already know why this is needed. (hint, hint) * '''Step 4a:''' If you are using slapt-get version earlier than 0.9.11, do: slapt-get --install kernel --no-upgrade slapt-get --install glibc-solibs pkgtools sed slapt-get --dist-upgrade * '''Step 4b:''' If you are using slapt-get version 0.9.11 or later, do: slapt-get --install kernel --no-upgrade slapt-get --dist-upgrade --ignore-excludes The '''--dist-upgrade''' option will prompt you to install all *new* packages in the ./a series, and you should say "yes" to ensure that you have a working system after the upgrade. See step 8 below for more information on installing new packages. === Step 5: Update LILO and config files === * Make sure the paths in '''/etc/lilo.conf''' point to a valid kernel image, and then run '''/sbin/lilo''' * Fix your config files in '''/etc'''; the new ones are named with a *.new suffix. You should be able to use '''diff -u file file.new''' to show the differences between file and file.new. You'll have to decide whether to completely replace the old files with the new ones or merge your changes into the new ones first, but you *must* use the new files. === Step 6: Go back to multi-user mode === Sometimes the screen stays blank when you return to runlevel 3, and you might be worried that something went wrong. Before you panic, type '''clear''' and press Enter - you'll probably get your root prompt back :) telinit 3 === Step 7: Remove obsolete packages === There is an option to do this automatically with slapt-get: slapt-get [--remove|--dist-upgrade] --remove-obsolete From '''man slapt-get''' --remove-obsolete Remove installed packages that are no longer available. This works for dist-upgrade only. This removes packages that are no longer available from any current package sources, but are currently installed. Be careful as this will also remove custom built packages. As you see, this option will be fine ''if you don't have any custom-compiled packages'' installed (such as with [[checkinstall]] or using [[SlackBuild_Scripts]]). Read through the official ChangeLog to find all packages that were removed from Slackware during the development phase; you might be able use something like this to make the process go a bit more quickly: grep -i removed ChangeLog.txt OR grep Removed ChangeLog.txt === Step 8: Add new packages === Similar to removing obsolete packages, there is an option to do this automatically with slapt-get using the '''--install-set''' option: slapt-get --upgrade --install-set a ap d f k kde l n t tcl x xap y From '''man slapt-get''': --install-set [disk set(s)] Install specified disk set(s). example: --install-set xap n l This option will upgrade (or install, if not already installed) every package in every disk set. For reasons already detailed (kernel/alsa versions), this may not be desirable; additionally, if you don't have a full installation of Slackware for whatever reason, this will not be desirable. The safest option is to read through the official ChangeLog.txt, make a note of new packages added during the release cycle, and install them now with this command: slapt-get --install <newpackage1> <newpackage2> <...> You might be able to use something like this to make the process go a bit more quickly, but it will return quite a few extraneous results. grep -i added ChangeLog.txt === Step 9: Admire the Results :) === At this point, you should be running the latest version of Slackware. == Usage Hint #3: Keep Up With Slackware -current Development == After modifying your <code>/etc/slapt-get/slaptgetrc</code> file to reflect -current sources, the most important advice you should hear is: <b>READ THE CHANGELOG</b> Seriously, always read the ChangeLog.txt file associated with the -current tree; so long as you read it prior to running the <code>slapt-get --upgrade</code> command, you should be familiar with any issues that might be encountered. One idea you might consider is to use slapt-get as a "double checking" tool to ensure you haven't accidentally overlooked any packages. While the concerns detailed earlier in this article apply here (you won't be informed of any new packages added to -current), you can use the following lines to see if you missed anything that needed to be upgraded: slapt-get --update slapt-get --upgrade --simulate = Related Links = * [[Release_Changes|Changes in Slackware Release Versions]] df3bf55267bb730328f7c4bfd1cbafb979c1c770 Fluxbox Newbie 0 243 503 2011-07-31T13:20:08Z Kevcortez 194 basic fluxbox configuration and installing openoffice wikitext text/x-wiki [[Category:Tutorials]] == Fluxbox Desktop -- basic configuration == This is my attempt to contribute to Slackware documentation with a newbie oriented how-to for initially setting up a usable Fluxbox desktop. There is also a section on installing OpenOffice, since many desktop users will want that program. <br /> '''Use at your own risk!''' <br /> I assume a default Slackware install.<br /> Reference:<br /> http://www.fluxbox.org <br /> http://fluxbox-wiki.org<br /> Fluxbox is a very nice desktop window manager that has most everything you need. It is minimal, which allows good desktop performance on older or moderate hardware. Plus, it can be configured to really simplify things so you don't have to deal with lots of programs you don't understand or ever use. Besides simplification, the right configuration of Fluxbox can add quite a bit to your computing productivity. Note: One time fluxbox refused to start for me. As I recall, the problem was fixed by removing the .Xauthority and .ICEauthority files from my home folder and trying again. Note: the ''' [user@host] ~/ $ ''' represents the command prompt with '''~''' being a shortcut for your /home/username folder. <blockquote> Tip: Use "bash completion" when working with directories and files from the command prompt. Type the first few letters of the directory or file you want and the "tab" key. If the text completes, then ''you are on the right path.'' Pressing "tab" twice will give a list of possible matches. </blockquote> <blockquote> Tip2: use the command "pwd" to show your present working directory and "whoami" to show your username. </blockquote> == Choosing Fluxbox == * <big>Choose Fluxbox as the the default window manager</big> After you log in, from the console or a terminal screen in X: <br /> <code> [user@host] ~/ $ xwmconfig </code> : ( select fluxbox and OK ) If you are in X, close the current X session, log out, close, exit, or end. Start up the (new) default fluxbox <br /> <code> [user@host] ~/ $ startx </code> == Fluxbox Configuration == Now, let us get fluxbox configured. You will need to look into your ''' ~/.fluxbox ''' directory Right-click on the desktop to display the menu and select rxvt or xterm which will open a terminal window.<br /> The Fluxbox configuration is kept in a hidden folder (dotfile) which may or may not be visible in an ordinary file browser, but won't be shown with a plain "ls" command, unless it is specified. <br /> <code> [user@host] ~/ $ ls .fluxbox apps keys menu init slitlist init windowmenu overlay startup backgrounds styles </code> You should see something resembling this. <br /> Fluxbox should be started once before you modify it because it writes initial configurations in your .fluxbox folder.<br /> * <big>Format the clock</big> From the menu, select '''Fluxbox-menu | Configure | Toolbar | Edit clock format''' <br /> A small edit box opens and you can modify the format string and then press "enter." Here is a suggestion: <br /> <code> %I:%M %a %b %e </code> * <big>Add keyboard access to main menu</big> Use the command below or right-click on the desktop to display the menu and select an editor from the Editors section -- gvim is good, but kate or kwrite are easier and more intuitive to use. In fact, with kate you have a built-in terminal, which might make things easier. <br /> <code> [user@host] ~/ $ kate .fluxbox/keys & </code> Edit the keys file by inserting the following at the very beginning, so it is easy to find if you want to change it later. (I assume you have a US pc105 keyboard, with two "windows" keys and one "menu" key on the bottom row.) <code> # keyboard access to main menu # Menu key is next to right Control key None Menu :RootMenu Shift Menu :HideMenus # optional, Super_L is the left windows key None Super_L :RootMenu Shift Super_L :HideMenus </code> You can use the "xev" command to see the names and keycodes of your keyboard keys. <br /> <code> [user@host] ~/ $ xev </code> When done, save the keys file. <br /> Test it by pressing the Menu key and the Shift-Menu to show/hide the Fluxbox menu. <br /> You may reload the configuration by using the menu ''' Fluxbox-menu | Reload config ''' Right click on the desktop to get this from the Fluxbox menu. * Create a simple menu. <code> [user@host] ~/ $ kate .fluxbox/menu.simple & </code> kate may say it cannot read the file, but continue on. It will give you a blank file.<br /> Copy/paste the following menu: <br /> <code> # My Fluxbox menu [begin] (Fluxbox menu.simple) {} < > [encoding] {UTF-8} [exec] (Terminal) {konsole} < > [exec] (Browser) {firefox} < > [exec] (Editor) {kate} < > [exec] (Reader) {okular} < > [exec] (Audio) {audacious} < > [separator] [submenu] (Net) {} <> [exec] (Browser) {seamonkey} < > [exec] (Mail) {thunderbird} < > [exec] (IM) {pidgin} < > [exec] (Chat) {xchat} < > [exec] (FTP) {gftp} < > [end] [submenu] (Media) {} < > [exec] (Graphics) {gimp} < > [exec] (Photos) {gqview} < > [exec] (Media Player) {xine} < > [exec] (Scanner) {xsane} < > [exec] (CD Copy) {k3b} < > [end] [submenu] (Office) {} <> # openoffice and acrobat are not included in Slackware [submenu] (OpenOffice) {} <> [exec] (Writer) {swriter} <> [exec] (Spreadsheet) {scalc} <> [exec] (Presentation) {simpress} <> [exec] (Draw) {sdraw} <> [end] [exec] (OfficeSuite) {soffice} < > [exec] (PIM kde) {kontact} < > [exec] (Acrobat) {acroread} < > [exec] (Accounts) {kmymoney} < > [end] [submenu] (Tools) {} < > [exec] (Kill) {xkill} < > [exec] (Xterm) {xterm} < > [exec] (Files) {dolphin} < > [exec] (Calculator) {kcalc} < > [exec] (System) {ksysguard} < > [exec] (Manual) {xman} < > [exec] (Help) {khelpcenter} < > [exec] (Lock) {xlock} < > [end] [separator] [submenu] (Fluxbox-menu) {} <> [config] (Configure) {} <> [submenu] (Styles) {Choose a style...} <> [stylesdir] (/usr/X11R6/share/fluxbox/styles) {} <> [stylesdir] (~/.fluxbox/styles) {} <> [end] [workspaces] (Workspace List) {} <> [submenu] (Tools) {} <> [exec] (Windowname) {xprop|grep WM_CLASS|cut -d \" -f 2|xmessage -file - -center} <> [exec] (Screenshot - JPG) {import screenshot.jpg && display -resize 50% screenshot.jpg} [exec] (Screenshot - PNG) {import screenshot.png && display -resize 50% screenshot.png} [exec] (Run) {fbrun } [exec] (Regen Menu) {fluxbox-generate_menu } [end] [reconfig] (Reload config) {} <> [restart] (Restart) {} <> [exec] (Shutdown) {/usr/bin/sudo /sbin/shutdown -h now} <> [separator] [exit] (Exit) {} <> [end] [separator] [exit] (Exit) {} <> [endencoding] [end] </code> To add a program, the syntax is: <code> [exec] (Label) {command} < optional path to .xpm icon > </code> Also, every '''[submenu]''' tag must have a matching ''' [end] ''' tag. Save this file as .fluxbox/menu.simple (kate '''File | Save''') <br /> '''Do not overwrite your .fluxbox/menu file.''' You may want it later.<br /> Open the file .fluxbox/init <br /> <code> kate .fluxbox/init & </code> Or just use kate's '''File | Open.''' Since .fluxbox should be the current directory, the file dialog should show the file, or you can enter .fluxbox/init in the Name box at the bottom of the dialog.<br /> <code> Find the following line (near the bottom)<br /> session.menuFile: ~/.fluxbox/menu </code> Change "menu" to "menu.simple" and save/close the init file.<br /> * <big>Now for the desktop background.</big> Copy your favorite background .jpeg file to .fluxbox/backgrounds/my_favorite_background.jpg <code> [user@host] ~/ $ cp path-to/my_favorite_background.jpg .fluxbox/backgrounds/ [user@host] ~/ $ chmod 644 .fluxbox/backgrounds/* </code> Now open the overlay file .fluxbox/overlay and add these lines: <code> background: fullscreen background.pixmap: ~/.fluxbox/backgrounds/my_favorite_background.jpg </code> Your overlay file should look like this: <code> ! The following line will prevent styles from setting the background. ! background: none background: fullscreen background.pixmap: ~/.fluxbox/backgrounds/my_favorite_background.jpg </code> Save/close the overlay file.<br /> See what it looks like with the fbsetbg command<br /> <code> [user@host] ~/ $ fbsetbg ~/.fluxbox/backgrounds/my_favorite_background.jpg </code> Now, make sure all your modified files are saved and select Restart from the Fluxbox menu --select '''Fluxbox-menu | Restart'''<br /> * <big>Learn more from the man pages:</big> <code> [user@host] ~/ $ man fluxbox | less [user@host] ~/ $ man fluxstyle | less </code> (press "q" to quit the less pager or man page) Or use the Help --> khelpcenter; select Unix Manuals, section 1, fluxbox; or even xman. I also suggest doing a web search for .Xdefaults or .Xresources files. Hopefully, you will like the look and feel of Fluxbox. Of course, there are more things you can do with your configuration, but hopefully this introduction has shown you some possibilities and got you off to a good start. == Installing Open Office == Since OpenOffice is probably wanted by many desktop users, but not included in Slackware, I have these directions for getting it installed. <br /> * Uninstalling OpenOffice for Upgrade See if you have OpenOffice packages installed. The packages have names containing ooobasis or openoffice.<br /> <code> [user@host] ~/ $ ls /var/log/packages | grep ooo [user@host] ~/ $ ls /var/log/packages | grep openoffice </code> If you are going to upgrade, first uninstall your existing packages. If you did not use Slackware compatible packages, then you can probably simply delete the openoffice.org directories under /opt. Otherwise, use pkgtool.<br /> <code> [user@host] ~/ $ su password [root@host] ~/ # pkgtool </code> : Choose Remove Packages and scroll down to the openoffice packages. : Select them with the space bar and then tab to OK and press enter. '''Be careful with pkgtool or you will remove the wrong packages.''' Or, to just remove the directories (this does not update Slackware's package tracking). <br /> <code> [root@host] ~/ # cd /opt [root@host] opt/ # rm -f openoffice3.org [root@host] opt/ # rm -f openoffice3.org3 </code> <br /> * <big>Downloading OpenOffice.org</big> Point your browser to http://www.openoffice.org Click on "I want to download OpenOffice.org" Choose "Searching for another version" : This takes you to the alternate downloads page '''Uncheck''' the box [] "include the JRE to the download"<br /> Slackware includes the java JRE and it is usable by OpenOffice.<br /> Choose the "Linux Intel RPM" for your language (2nd column). <br /> Save the '''OOo_3.3.0_Linux_x86_install-rpm_en-US.tar.gz''' to your downloads or Downloads directory (wherever you put tarballs) (version may vary). Open a terminal and untar the tarball.<br /> <code> [user@host] ~/ $ cd <path-to-download-folder> [user@host] downloads/ $ tar -xzf OOo_3.3.0_Linux_x86_install-rpm_en-US.tar.gz </code> This creates a folder named OOO330_m20_native_packed-1_en-US.9567, with an RPMS subdirectory and other things.<br /> Change to the OOO... /RPMS folder and see what you have<br /> <code> [user@host] downloads/ $ cd OOO330_m20_native_packed-1_en-US.9567/RPMS [user@host] RPMS/ $ ls </code> There should be quite a few .rpm files. We will change these to .tgz files with '''rpm2tgz'''.<br /> <code> [user@host] RPMS/ $ rpm2tgz *.rpm </code> This takes a little while. When done there should be a matching .tgz file for each .rpm file. * <big>Installing OpenOffice.org</big> Now change to root and install the packages.<br /> <code> [user@host] RPMS/ $ su password [root@host] RPMS/ # installpkg *.tgz </code> This also takes a little while. Now create symbolic links to put the OpenOffice executables in your path. Note: OpenOffice creates two directories in /opt, ''/opt/openoffice3.org'' and ''/opt/openoffice3.org3''<br /> The /opt/openoffice3.org3 is the directory that contains the executables.<br /> <code> [root@host] RPMS/ # cd /usr/bin </code> : (The '''ln -s TARGET [LINK_NAME]''' command creates symbolic links)<br /> : Use the bash completion with these commands ln -s /opt/openo[tab] ... /program/s[tab] to be sure you are correctly referencing the executable programs. <br /> <code> [root@host] bin/ # ln -s /opt/openoffice3.org3/program/soffice [root@host] bin/ # ln -s /opt/openoffice3.org3/program/sbase [root@host] bin/ # ln -s /opt/openoffice3.org3/program/scalc [root@host] bin/ # ln -s /opt/openoffice3.org3/program/sdraw [root@host] bin/ # ln -s /opt/openoffice3.org3/program/simpress [root@host] bin/ # ln -s /opt/openoffice3.org3/program/swriter [root@host] bin/ # exit </code> * <big>Try it out</big> Just select OpenOffice or OfficeSuite in your fluxbox menu.simple. * <big>I hope this all worked for you.</big> Check out http://slackbuilds.org for more packages. The accounting program '''kmymoney''' is found there. As far as installing Adobe Acrobat goes, there is also a package at slackbuilds.org, but you may have better luck just downloading it from Adobe and running their AdbeRdr9...sh installation program. Same for Adobe flashplayer. IMHO, flashplayer is the more necessary program.<br /> Have fun! 563f763bda4c54a6d32aad3daedbd296d2cc7aff 504 503 2011-07-31T14:18:11Z Kevcortez 194 format edit wikitext text/x-wiki [[Category:Tutorials]] == Fluxbox Desktop -- basic configuration == This is my attempt to contribute to Slackware documentation with a newbie oriented how-to for initially setting up a usable Fluxbox desktop. There is also a section on installing OpenOffice, since many desktop users will want that program. <br /> '''Use at your own risk!''' <br /> I assume a default Slackware install.<br /> Reference:<br /> http://www.fluxbox.org <br /> http://fluxbox-wiki.org<br /> Fluxbox is a very nice desktop window manager that has most everything you need. It is minimal, which allows good desktop performance on older or moderate hardware. Plus, it can be configured to really simplify things so you don't have to deal with lots of programs you don't understand or ever use. Besides simplification, the right configuration of Fluxbox can add quite a bit to your computing productivity. Note: One time fluxbox refused to start for me. As I recall, the problem was fixed by removing the .Xauthority and .ICEauthority files from my home folder and trying again. Note: the ''' [user@host] ~/ $ ''' represents the command prompt with '''~''' being a shortcut for your /home/username folder. <blockquote> Tip: Use "bash completion" when working with directories and files from the command prompt. Type the first few letters of the directory or file you want and the "tab" key. If the text completes, then ''you are on the right path.'' Pressing "tab" twice will give a list of possible matches. </blockquote> <blockquote> Tip2: use the command "pwd" to show your present working directory and "whoami" to show your username. </blockquote> == Choosing Fluxbox == * <big>Choose Fluxbox as the the default window manager</big> After you log in, from the console or a terminal screen in X: <br /> <code> [user@host] ~/ $ xwmconfig </code> : ( select fluxbox and OK ) If you are in X, close the current X session, log out, close, exit, or end. Start up the (new) default fluxbox <br /> <code> [user@host] ~/ $ startx </code> == Fluxbox Configuration == Now, let us get fluxbox configured. You will need to look into your ''' ~/.fluxbox ''' directory Right-click on the desktop to display the menu and select rxvt or xterm which will open a terminal window.<br /> The Fluxbox configuration is kept in a hidden folder (dotfile) which may or may not be visible in an ordinary file browser, but won't be shown with a plain "ls" command, unless it is specified. <br /> <code> [user@host] ~/ $ ls .fluxbox apps keys menu init slitlist init windowmenu overlay startup backgrounds styles </code> You should see something resembling this. <br /> Fluxbox should be started once before you modify it because it writes initial configurations in your .fluxbox folder.<br /> * <big>Format the clock</big> From the menu, select '''Fluxbox-menu | Configure | Toolbar | Edit clock format''' <br /> A small edit box opens and you can modify the format string and then press "enter." Here is a suggestion: <br /> <code> %I:%M %a %b %e </code> * <big>Add keyboard access to main menu</big> Use the command below or right-click on the desktop to display the menu and select an editor from the Editors section -- gvim is good, but kate or kwrite are easier and more intuitive to use. In fact, with kate you have a built-in terminal, which might make things easier. <br /> <code> [user@host] ~/ $ kate .fluxbox/keys & </code> Edit the keys file by inserting the following at the very beginning, so it is easy to find if you want to change it later. (I assume you have a US pc105 keyboard, with two "windows" keys and one "menu" key on the bottom row.) <code> # keyboard access to main menu # Menu key is next to right Control key None Menu :RootMenu Shift Menu :HideMenus # optional, Super_L is the left windows key None Super_L :RootMenu Shift Super_L :HideMenus </code> You can use the "xev" command to see the names and keycodes of your keyboard keys. <br /> <code> [user@host] ~/ $ xev </code> When done, save the keys file. <br /> Test it by pressing the Menu key and the Shift-Menu to show/hide the Fluxbox menu. <br /> You may reload the configuration by using the menu ''' Fluxbox-menu | Reload config ''' Right click on the desktop to get this from the Fluxbox menu. * <big>Create a simple menu.</big> <code> [user@host] ~/ $ kate .fluxbox/menu.simple & </code> kate may say it cannot read the file, but continue on. It will give you a blank file.<br /> Copy/paste the following menu: <br /> <code> # My Fluxbox menu [begin] (Fluxbox menu.simple) {} < > [encoding] {UTF-8} [exec] (Terminal) {konsole} < > [exec] (Browser) {firefox} < > [exec] (Editor) {kate} < > [exec] (Reader) {okular} < > [exec] (Audio) {audacious} < > [separator] [submenu] (Net) {} <> [exec] (Browser) {seamonkey} < > [exec] (Mail) {thunderbird} < > [exec] (IM) {pidgin} < > [exec] (Chat) {xchat} < > [exec] (FTP) {gftp} < > [end] [submenu] (Media) {} < > [exec] (Graphics) {gimp} < > [exec] (Photos) {gqview} < > [exec] (Media Player) {xine} < > [exec] (Scanner) {xsane} < > [exec] (CD Copy) {k3b} < > [end] [submenu] (Office) {} <> # openoffice and acrobat are not included in Slackware [submenu] (OpenOffice) {} <> [exec] (Writer) {swriter} <> [exec] (Spreadsheet) {scalc} <> [exec] (Presentation) {simpress} <> [exec] (Draw) {sdraw} <> [end] [exec] (OfficeSuite) {soffice} < > [exec] (PIM kde) {kontact} < > [exec] (Acrobat) {acroread} < > [exec] (Accounts) {kmymoney} < > [end] [submenu] (Tools) {} < > [exec] (Kill) {xkill} < > [exec] (Xterm) {xterm} < > [exec] (Files) {dolphin} < > [exec] (Calculator) {kcalc} < > [exec] (System) {ksysguard} < > [exec] (Manual) {xman} < > [exec] (Help) {khelpcenter} < > [exec] (Lock) {xlock} < > [end] [separator] [submenu] (Fluxbox-menu) {} <> [config] (Configure) {} <> [submenu] (Styles) {Choose a style...} <> [stylesdir] (/usr/X11R6/share/fluxbox/styles) {} <> [stylesdir] (~/.fluxbox/styles) {} <> [end] [workspaces] (Workspace List) {} <> [submenu] (Tools) {} <> [exec] (Windowname) {xprop|grep WM_CLASS|cut -d \" -f 2|xmessage -file - -center} <> [exec] (Screenshot - JPG) {import screenshot.jpg && display -resize 50% screenshot.jpg} [exec] (Screenshot - PNG) {import screenshot.png && display -resize 50% screenshot.png} [exec] (Run) {fbrun } [exec] (Regen Menu) {fluxbox-generate_menu } [end] [reconfig] (Reload config) {} <> [restart] (Restart) {} <> [exec] (Shutdown) {/usr/bin/sudo /sbin/shutdown -h now} <> [separator] [exit] (Exit) {} <> [end] [separator] [exit] (Exit) {} <> [endencoding] [end] </code> To add a program, the syntax is: <code> [exec] (Label) {command} < optional path to .xpm icon > </code> Also, every '''[submenu]''' tag must have a matching ''' [end] ''' tag. Save this file as .fluxbox/menu.simple (kate '''File | Save''') <br /> '''Do not overwrite your .fluxbox/menu file.''' You may want it later.<br /> Open the file .fluxbox/init <br /> <code> kate .fluxbox/init & </code> Or just use kate's '''File | Open.''' Since .fluxbox should be the current directory, the file dialog should show the file, or you can enter .fluxbox/init in the Name box at the bottom of the dialog.<br /> <code> Find the following line (near the bottom)<br /> session.menuFile: ~/.fluxbox/menu </code> Change "menu" to "menu.simple" and save/close the init file.<br /> * <big>Now for the desktop background.</big> Copy your favorite background .jpeg file to .fluxbox/backgrounds/my_favorite_background.jpg <code> [user@host] ~/ $ cp path-to/my_favorite_background.jpg .fluxbox/backgrounds/ [user@host] ~/ $ chmod 644 .fluxbox/backgrounds/* </code> Now open the overlay file .fluxbox/overlay and add these lines: <code> background: fullscreen background.pixmap: ~/.fluxbox/backgrounds/my_favorite_background.jpg </code> Your overlay file should look like this: <code> ! The following line will prevent styles from setting the background. ! background: none background: fullscreen background.pixmap: ~/.fluxbox/backgrounds/my_favorite_background.jpg </code> Save/close the overlay file.<br /> See what it looks like with the fbsetbg command<br /> <code> [user@host] ~/ $ fbsetbg ~/.fluxbox/backgrounds/my_favorite_background.jpg </code> Now, make sure all your modified files are saved and select Restart from the Fluxbox menu --select '''Fluxbox-menu | Restart'''<br /> * <big>Learn more from the man pages:</big> <code> [user@host] ~/ $ man fluxbox | less [user@host] ~/ $ man fluxstyle | less </code> (press "q" to quit the less pager or man page) Or use the Help --> khelpcenter; select Unix Manuals, section 1, fluxbox; or even xman. I also suggest doing a web search for .Xdefaults or .Xresources files. Hopefully, you will like the look and feel of Fluxbox. Of course, there are more things you can do with your configuration, but hopefully this introduction has shown you some possibilities and got you off to a good start. == Installing Open Office == Since OpenOffice is probably wanted by many desktop users, but not included in Slackware, I have these directions for getting it installed. <br /> * Uninstalling OpenOffice for Upgrade See if you have OpenOffice packages installed. The packages have names containing ooobasis or openoffice.<br /> <code> [user@host] ~/ $ ls /var/log/packages | grep ooo [user@host] ~/ $ ls /var/log/packages | grep openoffice </code> If you are going to upgrade, first uninstall your existing packages. If you did not use Slackware compatible packages, then you can probably simply delete the openoffice.org directories under /opt. Otherwise, use pkgtool.<br /> <code> [user@host] ~/ $ su password [root@host] ~/ # pkgtool </code> : Choose Remove Packages and scroll down to the openoffice packages. : Select them with the space bar and then tab to OK and press enter. '''Be careful with pkgtool or you will remove the wrong packages.''' Or, to just remove the directories (this does not update Slackware's package tracking). <br /> <code> [root@host] ~/ # cd /opt [root@host] opt/ # rm -f openoffice3.org [root@host] opt/ # rm -f openoffice3.org3 </code> <br /> * <big>Downloading OpenOffice.org</big> Point your browser to http://www.openoffice.org Click on "I want to download OpenOffice.org" Choose "Searching for another version" : This takes you to the alternate downloads page '''Uncheck''' the box [] "include the JRE to the download"<br /> Slackware includes the java JRE and it is usable by OpenOffice.<br /> Choose the "Linux Intel RPM" for your language (2nd column). <br /> Save the '''OOo_3.3.0_Linux_x86_install-rpm_en-US.tar.gz''' to your downloads or Downloads directory (wherever you put tarballs) (version may vary). Open a terminal and untar the tarball.<br /> <code> [user@host] ~/ $ cd <path-to-download-folder> [user@host] downloads/ $ tar -xzf OOo_3.3.0_Linux_x86_install-rpm_en-US.tar.gz </code> This creates a folder named OOO330_m20_native_packed-1_en-US.9567, with an RPMS subdirectory and other things.<br /> Change to the OOO... /RPMS folder and see what you have<br /> <code> [user@host] downloads/ $ cd OOO330_m20_native_packed-1_en-US.9567/RPMS [user@host] RPMS/ $ ls </code> There should be quite a few .rpm files. We will change these to .tgz files with '''rpm2tgz'''.<br /> <code> [user@host] RPMS/ $ rpm2tgz *.rpm </code> This takes a little while. When done there should be a matching .tgz file for each .rpm file. * <big>Installing OpenOffice.org</big> Now change to root and install the packages.<br /> <code> [user@host] RPMS/ $ su password [root@host] RPMS/ # installpkg *.tgz </code> This also takes a little while. Now create symbolic links to put the OpenOffice executables in your path. Note: OpenOffice creates two directories in /opt, ''/opt/openoffice3.org'' and ''/opt/openoffice3.org3''<br /> The /opt/openoffice3.org3 is the directory that contains the executables.<br /> <code> [root@host] RPMS/ # cd /usr/bin </code> : (The '''ln -s TARGET [LINK_NAME]''' command creates symbolic links)<br /> : Use the bash completion with these commands ln -s /opt/openo[tab] ... /program/s[tab] to be sure you are correctly referencing the executable programs. <br /> <code> [root@host] bin/ # ln -s /opt/openoffice3.org3/program/soffice [root@host] bin/ # ln -s /opt/openoffice3.org3/program/sbase [root@host] bin/ # ln -s /opt/openoffice3.org3/program/scalc [root@host] bin/ # ln -s /opt/openoffice3.org3/program/sdraw [root@host] bin/ # ln -s /opt/openoffice3.org3/program/simpress [root@host] bin/ # ln -s /opt/openoffice3.org3/program/swriter [root@host] bin/ # exit </code> * <big>Try it out</big> Just select OpenOffice or OfficeSuite in your fluxbox menu.simple. * <big>I hope this all worked for you.</big> Check out http://slackbuilds.org for more packages. The accounting program '''kmymoney''' is found there. As far as installing Adobe Acrobat goes, there is also a package at slackbuilds.org, but you may have better luck just downloading it from Adobe and running their AdbeRdr9...sh installation program. Same for Adobe flashplayer. IMHO, flashplayer is the more necessary program.<br /> Have fun! dbd1ab1cc596a6a7c409ed8e340216cf0f307975 Customizing Bash Prompt 0 77 505 99 2011-08-01T11:33:56Z Supyrow 196 wikitext text/x-wiki [[Category:Tips]] There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from "\033" or "ESC" commands into text commands for better reading, modifying, or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes. <pre> #.bashrc DULL=0 BRIGHT=1 FG_BLACK=30 FG_RED=31 FG_GREEN=32 FG_YELLOW=33 FG_BLUE=34 FG_VIOLET=35 FG_CYAN=36 FG_WHITE=37 FG_NULL=00 BG_BLACK=40 BG_RED=41 BG_GREEN=42 BG_YELLOW=43 BG_BLUE=44 BG_VIOLET=45 BG_CYAN=46 BG_WHITE=47 BG_NULL=00 ESC="\033" NORMAL="\[$ESC[m\]" RESET="\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]" BLACK="\[$ESC[${DULL};${FG_BLACK}m\]" RED="\[$ESC[${DULL};${FG_RED}m\]" GREEN="\[$ESC[${DULL};${FG_GREEN}m\]" YELLOW="\[$ESC[${DULL};${FG_YELLOW}m\]" BLUE="\[$ESC[${DULL};${FG_BLUE}m\]" VIOLET="\[$ESC[${DULL};${FG_VIOLET}m\]" CYAN="\[$ESC[${DULL};${FG_CYAN}m\]" WHITE="\[$ESC[${DULL};${FG_WHITE}m\]" BRIGHT_BLACK="\[$ESC[${BRIGHT};${FG_BLACK}m\]" BRIGHT_RED="\[$ESC[${BRIGHT};${FG_RED}m\]" BRIGHT_GREEN="\[$ESC[${BRIGHT};${FG_GREEN}m\]" BRIGHT_YELLOW="\[$ESC[${BRIGHT};${FG_YELLOW}m\]" BRIGHT_BLUE="\[$ESC[${BRIGHT};${FG_BLUE}m\]" BRIGHT_VIOLET="\[$ESC[${BRIGHT};${FG_VIOLET}m\]" BRIGHT_CYAN="\[$ESC[${BRIGHT};${FG_CYAN}m\]" BRIGHT_WHITE="\[$ESC[${BRIGHT};${BG_WHITE}m\]" REV_CYAN="\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]" REV_RED="\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]" PROMPT_COMMAND='export ERR=$?' </pre> If you happen to use Eterm or other advanced terminal its possible you need a ".bash_profile" here is one you can use if you don't have one, or just want some more in it. <pre> #.bash_profile source .bashrc if [ -f ~/.bashrc ]; then . ~/.bashrc fi #End Script </pre> Lets put it to work: I personally would comment out my currently working ##"PS1=" and put it below it in case you need to change it back for some reason. <pre> PS1="${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@yahoo.com${BRIGHT_YELLOW}]\n ${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} | ${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n ${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %> ${RESET}" </pre> Should look like this minus the colors: <pre> YOUR COMPANY NAME HERE[su_pyrow@yahoo.com] [13:57:23][590.478 MB|563.316 MiB][/media/cdrom] [503] %> </pre> Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past. Now... To get the sum of files in current working directory, I made two files which do the summing. "lsMB" and "lsMiB" which on my system are both located in ~/bin as executable. Here is lsMB: <pre> #!/bin/bash #lsMB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) suffix="kB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) suffix="MB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) suffix="GB" fi fi fi fi echo -n "$TotalSize $suffix" #End Script </pre> Finally, this is the lsMiB executable file located in "~/bin" This has the modification for the conversion to KiB, MiB & GiB one could further the code to handle TiB easily by doing some research on it... Try wiki! <pre> #!/bin/bash #lsMiB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix2="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1024*.976 \nquit" | bc) suffix2="KiB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1048576*.954 \nquit" | bc) suffix2="MiB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1073741824*.931 \nquit" | bc) suffix2="GiB" fi fi fi fi echo -n "$TotalSize2 $suffix2" #End Script </pre> One would be able to see the changes if 1) Restart the Terminal or 2) type:<pre>$ source ~/.bashrc</pre> and you will instantly see the changes. Try it out, and see if it grows on you! 7c82e582fd230bbd86f3cd1b8dad0dda4ba0f1c6 506 505 2011-08-01T11:42:51Z Supyrow 196 wikitext text/x-wiki [[Category:Tips]] # Originally posted by SU_PyRoW # <a href="http://compelitepc.host56.com">CompElitePC, Inc.</a> There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from "\033" or "ESC" commands into text commands for better reading, modifying, or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes. <pre> #.bashrc DULL=0 BRIGHT=1 FG_BLACK=30 FG_RED=31 FG_GREEN=32 FG_YELLOW=33 FG_BLUE=34 FG_VIOLET=35 FG_CYAN=36 FG_WHITE=37 FG_NULL=00 BG_BLACK=40 BG_RED=41 BG_GREEN=42 BG_YELLOW=43 BG_BLUE=44 BG_VIOLET=45 BG_CYAN=46 BG_WHITE=47 BG_NULL=00 ESC="\033" NORMAL="\[$ESC[m\]" RESET="\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]" BLACK="\[$ESC[${DULL};${FG_BLACK}m\]" RED="\[$ESC[${DULL};${FG_RED}m\]" GREEN="\[$ESC[${DULL};${FG_GREEN}m\]" YELLOW="\[$ESC[${DULL};${FG_YELLOW}m\]" BLUE="\[$ESC[${DULL};${FG_BLUE}m\]" VIOLET="\[$ESC[${DULL};${FG_VIOLET}m\]" CYAN="\[$ESC[${DULL};${FG_CYAN}m\]" WHITE="\[$ESC[${DULL};${FG_WHITE}m\]" BRIGHT_BLACK="\[$ESC[${BRIGHT};${FG_BLACK}m\]" BRIGHT_RED="\[$ESC[${BRIGHT};${FG_RED}m\]" BRIGHT_GREEN="\[$ESC[${BRIGHT};${FG_GREEN}m\]" BRIGHT_YELLOW="\[$ESC[${BRIGHT};${FG_YELLOW}m\]" BRIGHT_BLUE="\[$ESC[${BRIGHT};${FG_BLUE}m\]" BRIGHT_VIOLET="\[$ESC[${BRIGHT};${FG_VIOLET}m\]" BRIGHT_CYAN="\[$ESC[${BRIGHT};${FG_CYAN}m\]" BRIGHT_WHITE="\[$ESC[${BRIGHT};${BG_WHITE}m\]" REV_CYAN="\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]" REV_RED="\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]" PROMPT_COMMAND='export ERR=$?' </pre> If you happen to use Eterm or other advanced terminal its possible you need a ".bash_profile" here is one you can use if you don't have one, or just want some more in it. <pre> #.bash_profile source .bashrc if [ -f ~/.bashrc ]; then . ~/.bashrc fi #End Script </pre> Lets put it to work: I personally would comment out my currently working ##"PS1=" and put it below it in case you need to change it back for some reason. <pre> PS1="${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@yahoo.com${BRIGHT_YELLOW}]\n ${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} | ${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n ${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %> ${RESET}" </pre> Should look like this minus the colors: <pre> YOUR COMPANY NAME HERE[su_pyrow@yahoo.com] [13:57:23][590.478 MB|563.316 MiB][/media/cdrom] [503] %> </pre> Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past. Now... To get the sum of files in current working directory, I made two files which do the summing. "lsMB" and "lsMiB" which on my system are both located in ~/bin as executable. Here is lsMB: <pre> #!/bin/bash #lsMB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) suffix="kB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) suffix="MB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) suffix="GB" fi fi fi fi echo -n "$TotalSize $suffix" #End Script </pre> Finally, this is the lsMiB executable file located in "~/bin" This has the modification for the conversion to KiB, MiB & GiB one could further the code to handle TiB easily by doing some research on it... Try wiki! <pre> #!/bin/bash #lsMiB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix2="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1024*.976 \nquit" | bc) suffix2="KiB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1048576*.954 \nquit" | bc) suffix2="MiB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1073741824*.931 \nquit" | bc) suffix2="GiB" fi fi fi fi echo -n "$TotalSize2 $suffix2" #End Script </pre> One would be able to see the changes if 1) Restart the Terminal or 2) type:<pre>$ source ~/.bashrc</pre> and you will instantly see the changes. Try it out, and see if it grows on you! 1eed9626997929c47450b28fddcfc02f257bde22 507 506 2011-08-01T11:44:13Z Supyrow 196 wikitext text/x-wiki [[Category:Tips]] Originally posted by SU_PyRoW http://compelitepc.host56.com There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from "\033" or "ESC" commands into text commands for better reading, modifying, or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes. <pre> #.bashrc DULL=0 BRIGHT=1 FG_BLACK=30 FG_RED=31 FG_GREEN=32 FG_YELLOW=33 FG_BLUE=34 FG_VIOLET=35 FG_CYAN=36 FG_WHITE=37 FG_NULL=00 BG_BLACK=40 BG_RED=41 BG_GREEN=42 BG_YELLOW=43 BG_BLUE=44 BG_VIOLET=45 BG_CYAN=46 BG_WHITE=47 BG_NULL=00 ESC="\033" NORMAL="\[$ESC[m\]" RESET="\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]" BLACK="\[$ESC[${DULL};${FG_BLACK}m\]" RED="\[$ESC[${DULL};${FG_RED}m\]" GREEN="\[$ESC[${DULL};${FG_GREEN}m\]" YELLOW="\[$ESC[${DULL};${FG_YELLOW}m\]" BLUE="\[$ESC[${DULL};${FG_BLUE}m\]" VIOLET="\[$ESC[${DULL};${FG_VIOLET}m\]" CYAN="\[$ESC[${DULL};${FG_CYAN}m\]" WHITE="\[$ESC[${DULL};${FG_WHITE}m\]" BRIGHT_BLACK="\[$ESC[${BRIGHT};${FG_BLACK}m\]" BRIGHT_RED="\[$ESC[${BRIGHT};${FG_RED}m\]" BRIGHT_GREEN="\[$ESC[${BRIGHT};${FG_GREEN}m\]" BRIGHT_YELLOW="\[$ESC[${BRIGHT};${FG_YELLOW}m\]" BRIGHT_BLUE="\[$ESC[${BRIGHT};${FG_BLUE}m\]" BRIGHT_VIOLET="\[$ESC[${BRIGHT};${FG_VIOLET}m\]" BRIGHT_CYAN="\[$ESC[${BRIGHT};${FG_CYAN}m\]" BRIGHT_WHITE="\[$ESC[${BRIGHT};${BG_WHITE}m\]" REV_CYAN="\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]" REV_RED="\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]" PROMPT_COMMAND='export ERR=$?' </pre> If you happen to use Eterm or other advanced terminal its possible you need a ".bash_profile" here is one you can use if you don't have one, or just want some more in it. <pre> #.bash_profile source .bashrc if [ -f ~/.bashrc ]; then . ~/.bashrc fi #End Script </pre> Lets put it to work: I personally would comment out my currently working ##"PS1=" and put it below it in case you need to change it back for some reason. <pre> PS1="${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@yahoo.com${BRIGHT_YELLOW}]\n ${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} | ${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n ${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %> ${RESET}" </pre> Should look like this minus the colors: <pre> YOUR COMPANY NAME HERE[su_pyrow@yahoo.com] [13:57:23][590.478 MB|563.316 MiB][/media/cdrom] [503] %> </pre> Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past. Now... To get the sum of files in current working directory, I made two files which do the summing. "lsMB" and "lsMiB" which on my system are both located in ~/bin as executable. Here is lsMB: <pre> #!/bin/bash #lsMB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) suffix="kB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) suffix="MB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) suffix="GB" fi fi fi fi echo -n "$TotalSize $suffix" #End Script </pre> Finally, this is the lsMiB executable file located in "~/bin" This has the modification for the conversion to KiB, MiB & GiB one could further the code to handle TiB easily by doing some research on it... Try wiki! <pre> #!/bin/bash #lsMiB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix2="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1024*.976 \nquit" | bc) suffix2="KiB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1048576*.954 \nquit" | bc) suffix2="MiB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1073741824*.931 \nquit" | bc) suffix2="GiB" fi fi fi fi echo -n "$TotalSize2 $suffix2" #End Script </pre> One would be able to see the changes if 1) Restart the Terminal or 2) type:<pre>$ source ~/.bashrc</pre> and you will instantly see the changes. Try it out, and see if it grows on you! 092c7642162dff0d2261eb8a8cb8f91450be7d08 508 507 2011-08-01T11:50:09Z Supyrow 196 moved [[Customizing Bash Prompt]] to [[Customising Bash Prompt]]: spelling wikitext text/x-wiki [[Category:Tips]] Originally posted by SU_PyRoW http://compelitepc.host56.com There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from "\033" or "ESC" commands into text commands for better reading, modifying, or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes. <pre> #.bashrc DULL=0 BRIGHT=1 FG_BLACK=30 FG_RED=31 FG_GREEN=32 FG_YELLOW=33 FG_BLUE=34 FG_VIOLET=35 FG_CYAN=36 FG_WHITE=37 FG_NULL=00 BG_BLACK=40 BG_RED=41 BG_GREEN=42 BG_YELLOW=43 BG_BLUE=44 BG_VIOLET=45 BG_CYAN=46 BG_WHITE=47 BG_NULL=00 ESC="\033" NORMAL="\[$ESC[m\]" RESET="\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]" BLACK="\[$ESC[${DULL};${FG_BLACK}m\]" RED="\[$ESC[${DULL};${FG_RED}m\]" GREEN="\[$ESC[${DULL};${FG_GREEN}m\]" YELLOW="\[$ESC[${DULL};${FG_YELLOW}m\]" BLUE="\[$ESC[${DULL};${FG_BLUE}m\]" VIOLET="\[$ESC[${DULL};${FG_VIOLET}m\]" CYAN="\[$ESC[${DULL};${FG_CYAN}m\]" WHITE="\[$ESC[${DULL};${FG_WHITE}m\]" BRIGHT_BLACK="\[$ESC[${BRIGHT};${FG_BLACK}m\]" BRIGHT_RED="\[$ESC[${BRIGHT};${FG_RED}m\]" BRIGHT_GREEN="\[$ESC[${BRIGHT};${FG_GREEN}m\]" BRIGHT_YELLOW="\[$ESC[${BRIGHT};${FG_YELLOW}m\]" BRIGHT_BLUE="\[$ESC[${BRIGHT};${FG_BLUE}m\]" BRIGHT_VIOLET="\[$ESC[${BRIGHT};${FG_VIOLET}m\]" BRIGHT_CYAN="\[$ESC[${BRIGHT};${FG_CYAN}m\]" BRIGHT_WHITE="\[$ESC[${BRIGHT};${BG_WHITE}m\]" REV_CYAN="\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]" REV_RED="\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]" PROMPT_COMMAND='export ERR=$?' </pre> If you happen to use Eterm or other advanced terminal its possible you need a ".bash_profile" here is one you can use if you don't have one, or just want some more in it. <pre> #.bash_profile source .bashrc if [ -f ~/.bashrc ]; then . ~/.bashrc fi #End Script </pre> Lets put it to work: I personally would comment out my currently working ##"PS1=" and put it below it in case you need to change it back for some reason. <pre> PS1="${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@yahoo.com${BRIGHT_YELLOW}]\n ${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} | ${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n ${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %> ${RESET}" </pre> Should look like this minus the colors: <pre> YOUR COMPANY NAME HERE[su_pyrow@yahoo.com] [13:57:23][590.478 MB|563.316 MiB][/media/cdrom] [503] %> </pre> Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past. Now... To get the sum of files in current working directory, I made two files which do the summing. "lsMB" and "lsMiB" which on my system are both located in ~/bin as executable. Here is lsMB: <pre> #!/bin/bash #lsMB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) suffix="kB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) suffix="MB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) suffix="GB" fi fi fi fi echo -n "$TotalSize $suffix" #End Script </pre> Finally, this is the lsMiB executable file located in "~/bin" This has the modification for the conversion to KiB, MiB & GiB one could further the code to handle TiB easily by doing some research on it... Try wiki! <pre> #!/bin/bash #lsMiB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix2="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1024*.976 \nquit" | bc) suffix2="KiB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1048576*.954 \nquit" | bc) suffix2="MiB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1073741824*.931 \nquit" | bc) suffix2="GiB" fi fi fi fi echo -n "$TotalSize2 $suffix2" #End Script </pre> One would be able to see the changes if 1) Restart the Terminal or 2) type:<pre>$ source ~/.bashrc</pre> and you will instantly see the changes. Try it out, and see if it grows on you! 092c7642162dff0d2261eb8a8cb8f91450be7d08 User talk:Balsa 3 236 510 468 2011-08-17T00:05:34Z Balsa 156 /* Editing Resource Limits page */ new section wikitext text/x-wiki Hi. [[User:Balsa|Balsa]] 03:28, 3 February 2011 (EST) == ALSA == /etc/asound.names<br/> Gives names and descriptions for ALSA hardware devices. Very useful when using arecord and its '-D, --device=NAME' command line options. /etc/asound.conf<br/> I do not know what this is currently. /etc/asound.state<br/> Ditto. strace - handy utility to see what programs are doing. strace -e file [some program and its args if relevant] - only shows file related stuff. arecord - ALSA utility to record sound. It's what I'm having trouble with, and is the subject of most of this page. sox - "Sound eXchange, the Swiss Army knife of audio manipulation" - (man sox; GNU General Public License) strace -e file arecord -v -d 5 -t au test4.au ----> <snip><br/> Recording Sparc Audio 'test4.au' : Unsigned 8 bit, Rate 8000 Hz, Mono <snip><br/> Very interesting, indeed. This gives us the default ALSA device used by arecord, in my case it was /dev/snd/pcmC0D0c. Cross referencing with /etc/asound.names doesn't get us far, because I still don't know the mappings between that file and the stuff in /dev/snd. Some speculation may be in order. grep -i capture -B 1 /etc/asound.names --> <br/> name 'hw:0,4'<br/> comment 'Physical Device - ALC268 Analog (Capture)'<br/> --<br/> name 'plughw:0,4'<br/> comment 'Physical Device With Conversions - ALC268 Analog (Capture)'<br/> Hmm. Lets try: strace -e file arecord -v -d 5 -t au -D hw:0,4 test5.au<br/> This opens /dev/snd/pcmC0D4c, and says "Recording Sparc Audio 'test5.au' : Unsigned 8 bit, Rate 8000 Hz, Mono" but exits with "arecord: set_params:954: Sample format non available". strace -e file arecord -v -d 5 -t au -D hw:0,0 test5.au<br/> Same deal, but opens /dev/snd/pcmC0D0c instead. Strange, since that is the same as the default. TODO: Look at source code. Edit: nevermind. Let's try one more thing - that /etc/asound.names gave me an idea...<br/> strace -e file arecord -v -d 5 -t au -D plughw:0,0 test5.au<br/> Hot dog it worked!<br/> open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4<br/> open("test5.au", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3<br/> sox test5.au -d --> Lots of clipping, noisy.<br/> sox au: header size 24 is too small Input File : 'test5.au'<br/> Channels : 1<br/> Sample Rate : 8000<br/> Precision : 8-bit<br/> Duration : 00:05.00 = 40000 samples ~ 375 CDDA sectors<br/> Sample Encoding: 8-bit Signed Integer PCM<br/> 100% 00:05.00 [00:00.00] of 00:05.00 Out:240k [!=====|=====!]Hd:0.0 Clip:182k<br/> sox effects: rate clipped 120593 samples; decrease volume?<br/> sox sox: alsa: output clipped 61507 samples; decrease volume?<br/> Done.<br/> Aha! The recording is unsigned 8bit, but the playback was signed 8bit. How does one change this? man sox sox -u test5.au -d<br/> sox formats_i: `test5.au': overriding encoding type<br/> Sample Encoding: 8-bit Unsigned Integer PCM<br/> OK, it plays as unsigned 8bit. Success.<br/> == JACK network audio over UDP == On the end with the physical sound hardware (master): jackd -r -T -d alsa -i1 -n 10 -o1 -p 4096 -r 8000 -S -i num input channels -n nperiods -o num output channels -p period, must be power of 2. -r sample rate -S prefer 16bit int over 32 bit. Do last (third): jack_netsource -h <hostname> jack_netsource -h <hostname> -m 1400 -P 1 -C 1 -o 0 -i 0 -l 10 -b 16 -m set maximum transmit unit (MTU) -P -C -o -i number of sound and midi in/out channels. -l buffer in number of periods. -b 16 bits per sample. FIXME - how to set sample rate? On the virtual end (remote): jackd -r -d net jackd -r -T -d net -i 1 -o 1 -I 0 -O 0 -r 8000 -p 4096 -n 10 -b 16 -r not realtime -c -a0 -T temporary, close when all clients gone. -d net use device net. -i -o -I -O num channels for sound/midi -r sample rate -p 4096 frames per period -n 10 buffer size in num periods -b 16 use 16 bits/sample -c use CELT compression -a 0 do not use autoconfig, just start --[[User:Balsa|Balsa]] 01:47, 20 March 2011 (EDT) == Simple tests from command line == netstat - man netstat look for services that you don't know, read their manual pages. See if the service would be better listening to fewer interfaces [like localhost]. Use the ps command to figure out what's running. Try the netstat flags "--inet -anp" and read what they mean in the netstat manual. look at /etc/fstab man fstab man mount Read a security article [fixme] about this file and the options. Skim the LVM and partitions pages here on slackwiki. Read about the noexec option (don't use this without understanding the consequences) Try "hostname --fqdn" and see what it does. Check the exim page or qmail page to see about local mail delivery. Some security tools (and other stuff too) will email you when important events occur. Read about the sudo and su commands. --[[User:Balsa|Balsa]] 16:15, 20 February 2011 (EST) == Exim - local mail only - setup and testing == Setup: not written yet. Testing / Debugging: The following are draft quality only. ps -efw | grep -i -e exim | grep -v grep #Lists running exim processes. netstat --inet -anp | grep -i -e exim -e 25 -e mail #See if anything is listening on port 25. ls -l /var/log look for mail or exim4 directory, and mail.??? and mail.???? files. ls -l /var/ look for mail, queue, or spool. Do a ls -l in any directories found above. Mail might be in ~/Mail Read the Mutt HOWTO on slackwiki.org. Read the qmail HOWTO as well. tail -f /var/log/exim4/mainlog (if it exists) The -f flag makes tail follow the file, so its best used on another virtual console or with screen. There are numerous guides for screen. My suggestion is to printout the most common commands on paper and keep it near your monitor. Try the mail command out. man mail echo "Testing local mail, sent on `date` to the local system" \ | mail -s "Test of Local Mail" username@localhost.localdomain Note that username@localhost.localdomain may not work. Try hostname --fqdn look in /etc/hosts Testing the MTA with telnet on a certain port: telnet localhost 25 HELO localhost MAIL FROM: username@localhost.localdomain RCPT TO: username@localhost.localdomain DATA SUBJECT: Testing mail via telnet This is the message body. Check if it worked with your favorite mail reader or by looking in the files listed above. End message body with a "." on a line by itself. . QUIT Once local mail delivery works, you can setup cron jobs (see cron page on slackwiki, and man cron) and the output (if any) will be mailed to you. == Octave: simple functions == Find the Octave tutorial by typing doc at the Octave command line.<br> Navigate to * Introduction:: A brief introduction to Octave.<br> Then go to * Simple Examples::<br> The tutorial is quite brief, and gives few examples of functions.<br> This page will demo how to make simple functions, and how to call one function from another.<br> octave:11> function fn = fn ( p )<br> > fn = p*20<br> > endfunction<br> octave:10> function sn = sn ( a )<br> > sn = a * (1/2)<br> > endfunction<br> octave:12> function tn = tn( p, a )<br> > tn = sn(a)+fn(p)<br> > endfunction<br> octave:17> function excess = excess( p, a, bs )<br> > excess = bs - tn(p,a)<br> > endfunction<br> octave:18> excess(p,a,bs)<br> sn = 517.50<br> fn = 2140<br> tn = 2657.5<br> excess = -1452.5<br> ans = -1452.5<br> octave:28> function trade = trade ( p, a, bs, lt )<br> > trade = excess(p,a,bs)/lt<br> > endfunction<br> octave:26> function newacres = newacres (p, a, bs, lt, na )<br> > newacres = a+trade(p,a,bs,lt)<br> > endfunction<br> octave:36> p=107; a=1013; bs=3017; lt=25;<br> octave:37> newacres(p,a,bs,lt,na)<br> sn = 506.50<br> fn = 2140<br> tn = 2646.5<br> excess = 370.50<br> trade = 14.820<br> newacres = 1027.8<br> ans = 1027.8<br> octave:38> p=114; a=1027; bs=3095; lt=23;<br> octave:39> newacres(p,a,bs,lt,na)<br> sn = 513.50<br> fn = 2280<br> tn = 2793.5<br> excess = 301.50<br> trade = 13.109<br> newacres = 1040.1<br> ans = 1040.1<br> --[[User:Balsa|Balsa]] 13:17, 21 February 2011 (EST) == Getmail == One of getmail's biggest features is writing directly to Maildir. This obviates the need for a Mail Transport Agent (MTA).<br> In a getmail configuration file: [destination]<br> type = Maildir<br> path = ~/Maildir/<br> This will write your email directly to the ~/Maildir/ directory in Maildir format.<br> --[[User:Balsa|Balsa]] 13:23, 21 February 2011 (EST) == Redirecting stderr and stdout to a file == /bin/true &> foo<br> This may be helpful in the "Piping" section here on slackwiki.<br> --[[User:Balsa|Balsa]] 13:34, 21 February 2011 (EST) == Sandbox and/or Editing Help pages on slackwiki? == If anyone knows if there exists a sandbox or an Help:Editing page here on slackwiki.org, please let me know. If not, I might try to create one. Advice welcome.<br> --[[User:Balsa|Balsa]] 13:38, 21 February 2011 (EST) A [[User:Balsa/Sandbox|sand-filled box]] labelled "Testing" --[[User:Balsa|Balsa]] 05:02, 8 April 2011 (EDT) == NTP log file configuration documentation == look for /usr/share/doc/ntp-doc/html/ntpd.html<br> It may be in a different place.<br> Use a http reader, like lynx to view it.<br> Go to "The Configuration File", then "Miscellaneous Options".<br> Scroll down to the "logconfig" and "logfile" headings.<br> There you will find a way to eliminate the "kernel time sync status change 6001" messages from syslog.<br> --[[User:Balsa|Balsa]] 02:26, 23 February 2011 (EST) == Editing Resource Limits page == Having recently run into some limits issues myself (and spending an hour or two learning about them), I am going to revise and extend the original [[Resource_Limits]] page. <br> Current goals: <ul> <li>Clarify where the ulimit documentation is. Slackware 12.2.0 (at least) has only a programmer's man page for ulimit. The shell builtin is documented in the shell's own man page.</li> <li>Steer users away from any programming manual pages. The above man page [ULIMIT(3)] says, "POSIX.1-2008 marks ulimit() as obsolete." This is potentially confusing; users may try to use non-existent getrlimit commands.</li> <li>ULIMIT(3) also says: "Warning: This routine is obsolete. Use getrlimit(2), setrlimit(2), and sysconf(3) instead. For the shell command ulimit(), see bash(1)." Same issue as above." </li> <li>Clarify whether or not ulimit is a shell builtin by letting the user test for it; if it is builtin, then matters become somewhat shell-specific.</li> <li>Expand the scope of the original article beyond increasing the limit for open files.</li> <li>Add a new section pointing to the README.limits file (as provided by the shadow package) as an alternate way of dealing with limits.</li> </ul> [[User:Balsa/Resource_Limits_Working_Draft|Resource Limits Working Draft]] --[[User:Balsa|Balsa]] 19:05, 16 August 2011 (CDT) 0484a411a8035af64333135e74f2b7ed05945e53 User:Balsa/Resource Limits Working Draft 2 245 511 2011-08-17T00:08:16Z Balsa 156 Resource Limits page working draft wikitext text/x-wiki = Purpose = This page does not attempt to explain the different types of system resource limits or when it is (or is not) appropriate to change them; see '''man ulimit''' and [[http://google.com Google]] for that discussion. However, some users run into problems with the linux kernel's default limit settings, so we'll attempt to explain how to modify them to suit their special needs.<br> Also covered: <ul> <li>How to display the system resource limits.</li> </ul> = Overview = The default settings provided by the kernel are sane values for most multi-user machines.<br> However, the defaults may be different depending on your FIXME[distribution/kernel?].<br> The examples that follow may have different limits than your system. The limits in the examples are not necessarily better. This page does not endorse or recommend any particular limits.<br> Depending on your shell, the examples may be different, and the commands may need to be modified.<br> Issuing the command '''ulimit -Ha''' should show all the ''Hard'' limits. Example: user@host:~$ ulimit -Ha core file size (blocks, -c) unlimited data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited pending signals (-i) 8118 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 stack size (kbytes, -s) unlimited cpu time (seconds, -t) unlimited max user processes (-u) 8118 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited and '''ulimit -Sa''' should show all the ''Soft'' limits: user@host:~$ ulimit -Sa core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited pending signals (-i) 8118 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 8118 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited The first command shows the hard limits set by the kernel, and the second command shows the soft limits set by the user(Verify?). An unprivileged user can increase the soft limit (up to the hard limit value), and he is also able to lower the hard limit (but then is unable to increase it, as an unprivileged user cannot raise the hard limit at all). There are some situations which might require a larger hard limit for users, and the obvious "solution" is to add a line in /etc/profile to increase it. However, this will not work, because normal users cannot increase their hard limits (as indicated above). = Solution #1: ''/sbin/initscript'' = To increase the hard limits for users, you will need to create '''/sbin/initscript''' and place appropriate commands inside it. The easiest way is to copy the file '''/sbin/initscript.sample''' to '''/sbin/initscript''' and edit the copy, but you are certainly free to "roll your own." If you decide to create your own, make sure it is executable or it will not work.<br> Note: If /sbin/initscript.sample does not exist, you may find reading the initscript manual page helpful.<br> Using the following '''/sbin/initscript''' file: PATH=/bin:/sbin:/usr/bin:/usr/sbin export PATH # Increase the hardlimit for open files ulimit -Hn 4096 # Execute the program. eval exec "$4" You should get the following after a reboot: user@host:~$ ulimit -Hn 4096 user@host:~$ ulimit -n 1024 Notice that the hardlimit is now 4096 (as specified in /sbin/initscript), but the softlimit is still 1024. In other words, you will still need to use /etc/profile (or some other shell init file - see below for recommendation) to raise the desired users' softlimits. With some creative scripting, you can be more selective about which users have what limits. Rather than editing the system /etc/profile, it's recommended to create a custom file in /etc/profile.d and make it executable. This way, you don't have to worry about trying to merge your changes to /etc/profile when doing Slackware upgrades to new versions. = Solution #2: README.limits and the ''shadow'' package = To increase the hard limits for users, you should read the README.limits file provided by the shadow package which is very likely already installed. See the "''Other Resources''" section to find its location. Here is an example /etc/limits file. # /etc/limits contains user resource limits. # See limits(5). # # Format: # <username> <limits-string> # # default entry is '*' for username # # Valid flags are: # A: max address space (KB) # C: max core file size (KB) # D: max data size (KB) # F: maximum filesize (KB) # M: max locked-in-memory address space (KB) [only for root on Linux 2.0.x] # N: max number of open files # R: max resident set size (KB) [no effect on Linux 2.0.x] # S: max stack size (KB) # T: max CPU time (MIN) # U: max number of processes # L: max number of logins for this user # I: max nice value (0..39 translates to 20..-19) # O: max real time priority (0..MAX_RT_PRIO) # # Examples: # the default entry #* L2 D6144 R2048 S2048 U32 N32 F16384 T5 C0 I20 O0 # another way of suspending a user login #guest L0 # this account has no limits #sysadm - Following the example in Solution #1 above, to increase the hardlimit for open files you would need to add the following line to /etc/limits: user N4096 You do ''not'' need to reboot. Simply log off [Fixme: all instances?] and then log back on again.<br> Apparently, [Verify?] this will set the hard and soft limits equal. Results: user@host:~$ ulimit -Hn 4096 user@host:~$ ulimit -Sn 4096 = Other Resources = Find out if ulimit is a '''''shell builtin''''' or not. If ''which'' finds an ulimit executable, then it is not a shell builtin. * '''which ulimit''' Example of a shell builtin (which returns no results): user@host: ~ $ which ulimit which: no ulimit in (/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.:/sbin:/sbin) The ulimit man page may not be useful if ulimit is a shell builtin. If it is a shell builtin, read your shell's man page and search for the string "ulimit". (without the quotes) * '''man bash''' * '''man ash''' * '''man dash''' * '''man sh''' * '''man ksh''' * '''man csh''' * '''man tcsh''' Otherwise, * '''man ulimit''' Read the other manual pages: * '''man initscript''' * '''man limits''' == Finding the README.limits file == Find the package that installed the limits (5) man page: (should be shadow) * '''grep -i "limits.5.gz" /var/log/packages/*''' Find the README.limits file, replacing x.y.z.-march-n with whatever version of shadow you found above: * '''grep -i "README.limits" /var/log/packages/shadow-x.y.z.-march-n''' Alternatively, if you have slocate installed: * '''slocate README.limits''' (or the really easy way): * '''less `slocate README.limits`'''<br> <br> Finally, read the README.limits file, replacing x.y.z with whatever version of shadow you have installed: * '''less /usr/doc/shadow-x.y.z/README.limits''' [[Category:Tutorials]] 0cbbeac0206dc8645dc52cc3a59961720c85c2a7 Broadcom Wireless 0 246 512 2011-09-09T11:14:47Z Klickback 198 A HowTo for installing and configuring Broadcom wireless cards on Slackware wikitext text/x-wiki [[Category:Tutorials]] = Introduction = This tutorial is written for setting up wireless on Slackware on laptops with Broadcom wireless cards. It deals with installing Boradcom's official proprietary '''wl''' driver for Linux that includes support for Broadcom's BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and BCM43228-based hardware. = Prerequisites = This tutorial assumes a full Slackware installation. There should also be a way to transfer files to the target laptop - it can either be a working internet connection using the laptop's ethernet card, '''or''' a different machine with internet access and a USB thumb drive to transfer the files. The regular user account on the laptop must also be a part of the ''netdev'' group. = Getting Started = The first thing is to check if the user is part of the ''netdev'' group : <pre>groups</pre> If the output does not contain <code>netdev</code>, then as <code>root</code>, enter the following command : <pre>usermod -a -G netdev username</pre> where <code>username</code> is the name of your user account. = Installing the driver = Navigate to the slackbuilds.org's [http://slackbuilds.org/result/?search=broadcom-sta&sv= broadcom-sta page] and build the package according to the [http://slackbuilds.org/howto/ instructions] given. Make sure to download the source code relevant to the architecture of your installation (32-bit or 64-bit). = Blacklisting the b43 and ssb modules = The Broadcom's <code>wl</code> driver conflicts with the kernel's <code>b43</code> driver, so open up the <code>/etc/modprobe.d/blacklist.conf</code> using the text editor of your choice as <code>root</code> and add the following lines to it : <pre> blacklist ssb blacklist b43 </pre> = Final steps = At this point, reboot your machine. The drivers should be installed and work now. To test this, enter the <code>iwconfig</code> command. you should see an output like this : <pre> $ iwconfig lo no wireless extensions. eth1 IEEE 802.11 Nickname:"lapto" Access Point: Not-Associated Link Quality:5 Signal level:217 Noise level:199 Rx invalid nwid:0 invalid crypt:31 invalid misc:0 eth0 no wireless extensions. </pre> This output suggests that the drivers installed right and your wireless card is recognized as <code>eth1</code> by the kernel. Hooray! You can now either use the <code>iwconfig</code> tool to configure your wireless networks, '''or''' if you prefer to use a GUI, follow the next section for installing Wicd. = Installing Wicd = To make management of wireless connections easier, we will install [http://wicd.sourceforge.net/ Wicd] network manager that provides a simple configuration GUI and system tray icon. === Using slackpkg === If you already have a working internet connection on the laptop (say a wired connection), simply use <code>slackpkg</code> to install wicd : <pre>slackpkg install wicd</pre> === Using package tarball === Download the <code>Wicd</code> package for your Slackware version from the ''extra/'' section of your preferred Slackware [http://slackware.osuosl.org/ mirror] and install using <code>installpkg</code>. For example, on a 32-bit system, as root : <pre> wget http://slackware.osuosl.org/slackware-13.37/extra/wicd/wicd-1.7.0-i486-2.txz installpkg ./wicd-1.7.0-i486-2.txz </pre> = Wicd usage = Start the Wicd daemon : <pre> /etc/rc.d/rc.wicd start </pre> Once its started, run <code>wicd-client</code> and configure the network to your liking. === Caveat === Wicd by default treats <code>wlan0</code> as the default wireless interface. Since the interface is <code>eth1</code> in our case, you might want to correct this in Wicd's Preferences. fcffcde727148ec782ec9ff76f2117da8d111993 514 512 2011-09-09T11:26:49Z Klickback 198 wikitext text/x-wiki [[Category:Tutorials]] = Introduction = This tutorial is written for setting up wireless on Slackware on laptops with Broadcom wireless cards. It deals with installing Boradcom's official proprietary '''wl''' driver for Linux that includes support for Broadcom's BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and BCM43228-based hardware. == Prerequisites == This tutorial assumes a full Slackware installation. There should also be a way to transfer files to the target laptop - it can either be a working internet connection using the laptop's ethernet card, '''or''' a different machine with internet access and a USB thumb drive to transfer the files. The regular user account on the laptop must also be a part of the ''netdev'' group. == Getting Started == The first thing is to check if the user is part of the ''netdev'' group : <pre>groups</pre> If the output does not contain <code>netdev</code>, then as <code>root</code>, enter the following command : <pre>usermod -a -G netdev username</pre> where <code>username</code> is the name of your user account. == Installing the driver == Navigate to the slackbuilds.org's [http://slackbuilds.org/result/?search=broadcom-sta&sv= broadcom-sta page] and build the package according to the [http://slackbuilds.org/howto/ instructions] given. Make sure to download the source code relevant to the architecture of your installation (32-bit or 64-bit). == Blacklisting the b43 and ssb modules == The Broadcom's <code>wl</code> driver conflicts with the kernel's <code>b43</code> driver, so open up the <code>/etc/modprobe.d/blacklist.conf</code> using the text editor of your choice as <code>root</code> and add the following lines to it : <pre> blacklist ssb blacklist b43 </pre> == Final steps == At this point, reboot your machine. The drivers should be installed and work now. To test this, enter the <code>iwconfig</code> command. you should see an output like this : <pre> $ iwconfig lo no wireless extensions. eth1 IEEE 802.11 Nickname:"lapto" Access Point: Not-Associated Link Quality:5 Signal level:217 Noise level:199 Rx invalid nwid:0 invalid crypt:31 invalid misc:0 eth0 no wireless extensions. </pre> This output suggests that the drivers installed right and your wireless card is recognized as <code>eth1</code> by the kernel. Hooray! You can now either use the <code>iwconfig</code> tool to configure your wireless networks, '''or''' if you prefer to use a GUI, follow the next section for installing Wicd. == Installing Wicd == To make management of wireless connections easier, we will install [http://wicd.sourceforge.net/ Wicd] network manager that provides a simple configuration GUI and system tray icon. === Using slackpkg === If you already have a working internet connection on the laptop (say a wired connection), simply use <code>slackpkg</code> to install wicd : <pre>slackpkg install wicd</pre> === Using package tarball === Download the <code>Wicd</code> package for your Slackware version from the ''extra/'' section of your preferred Slackware [http://slackware.osuosl.org/ mirror] and install using <code>installpkg</code>. For example, on a 32-bit system, as root : <pre> wget http://slackware.osuosl.org/slackware-13.37/extra/wicd/wicd-1.7.0-i486-2.txz installpkg ./wicd-1.7.0-i486-2.txz </pre> == Wicd usage == Start the Wicd daemon : <pre> /etc/rc.d/rc.wicd start </pre> Once its started, run <code>wicd-client</code> and configure the network to your liking. === Caveat === Wicd by default treats <code>wlan0</code> as the default wireless interface. Since the interface is <code>eth1</code> in our case, you might want to correct this in Wicd's Preferences. 404358f7f06d2819eb23439d89246126aa4f6c65 515 514 2011-09-09T11:27:27Z Klickback 198 Fixed formatting wikitext text/x-wiki [[Category:Tutorials]] == Introduction == This tutorial is written for setting up wireless on Slackware on laptops with Broadcom wireless cards. It deals with installing Boradcom's official proprietary '''wl''' driver for Linux that includes support for Broadcom's BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and BCM43228-based hardware. == Prerequisites == This tutorial assumes a full Slackware installation. There should also be a way to transfer files to the target laptop - it can either be a working internet connection using the laptop's ethernet card, '''or''' a different machine with internet access and a USB thumb drive to transfer the files. The regular user account on the laptop must also be a part of the ''netdev'' group. == Getting Started == The first thing is to check if the user is part of the ''netdev'' group : <pre>groups</pre> If the output does not contain <code>netdev</code>, then as <code>root</code>, enter the following command : <pre>usermod -a -G netdev username</pre> where <code>username</code> is the name of your user account. == Installing the driver == Navigate to the slackbuilds.org's [http://slackbuilds.org/result/?search=broadcom-sta&sv= broadcom-sta page] and build the package according to the [http://slackbuilds.org/howto/ instructions] given. Make sure to download the source code relevant to the architecture of your installation (32-bit or 64-bit). == Blacklisting the b43 and ssb modules == The Broadcom's <code>wl</code> driver conflicts with the kernel's <code>b43</code> driver, so open up the <code>/etc/modprobe.d/blacklist.conf</code> using the text editor of your choice as <code>root</code> and add the following lines to it : <pre> blacklist ssb blacklist b43 </pre> == Final steps == At this point, reboot your machine. The drivers should be installed and work now. To test this, enter the <code>iwconfig</code> command. you should see an output like this : <pre> $ iwconfig lo no wireless extensions. eth1 IEEE 802.11 Nickname:"lapto" Access Point: Not-Associated Link Quality:5 Signal level:217 Noise level:199 Rx invalid nwid:0 invalid crypt:31 invalid misc:0 eth0 no wireless extensions. </pre> This output suggests that the drivers installed right and your wireless card is recognized as <code>eth1</code> by the kernel. Hooray! You can now either use the <code>iwconfig</code> tool to configure your wireless networks, '''or''' if you prefer to use a GUI, follow the next section for installing Wicd. == Installing Wicd == To make management of wireless connections easier, we will install [http://wicd.sourceforge.net/ Wicd] network manager that provides a simple configuration GUI and system tray icon. === Using slackpkg === If you already have a working internet connection on the laptop (say a wired connection), simply use <code>slackpkg</code> to install wicd : <pre>slackpkg install wicd</pre> === Using package tarball === Download the <code>Wicd</code> package for your Slackware version from the ''extra/'' section of your preferred Slackware [http://slackware.osuosl.org/ mirror] and install using <code>installpkg</code>. For example, on a 32-bit system, as root : <pre> wget http://slackware.osuosl.org/slackware-13.37/extra/wicd/wicd-1.7.0-i486-2.txz installpkg ./wicd-1.7.0-i486-2.txz </pre> == Wicd usage == Start the Wicd daemon : <pre> /etc/rc.d/rc.wicd start </pre> Once its started, run <code>wicd-client</code> and configure the network to your liking. === Caveat === Wicd by default treats <code>wlan0</code> as the default wireless interface. Since the interface is <code>eth1</code> in our case, you might want to correct this in Wicd's Preferences. 39cfd24cc107ec02175d84ea1476bf9b80409718 518 515 2011-09-09T14:50:09Z Klickback 198 Added sbopkg instructions wikitext text/x-wiki [[Category:Tutorials]] == Introduction == This tutorial is written for setting up wireless on Slackware on laptops with Broadcom wireless cards. It deals with installing Boradcom's official proprietary '''wl''' driver for Linux that includes support for Broadcom's BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and BCM43228-based hardware. == Prerequisites == This tutorial assumes a full Slackware installation. There should also be a way to transfer files to the target laptop - it can either be a working internet connection using the laptop's ethernet card, '''or''' a different machine with internet access and a USB thumb drive to transfer the files. The regular user account on the laptop must also be a part of the ''netdev'' group. == Getting Started == The first thing is to check if the user is part of the ''netdev'' group : <pre>groups</pre> If the output does not contain <code>netdev</code>, then as <code>root</code>, enter the following command : <pre>usermod -a -G netdev username</pre> where <code>username</code> is the name of your user account. == Installing the driver == === Sbopkg method === If a working internet connection is available on the laptop (say a wired connection), use [http://sbopkg.org sbopkg] to install the drivers : <pre>sbopkg -i broadcom-sta</pre> === Manual method === Navigate to the slackbuilds.org's [http://slackbuilds.org/result/?search=broadcom-sta&sv= broadcom-sta page] and build the package according to the [http://slackbuilds.org/howto/ instructions] given. Make sure to download the source code relevant to the architecture of your installation (32-bit or 64-bit). == Blacklisting the b43 and ssb modules == The Broadcom's <code>wl</code> driver conflicts with the kernel's <code>b43</code> driver, so open up the <code>/etc/modprobe.d/blacklist.conf</code> using the text editor of your choice as <code>root</code> and add the following lines to it : <pre> blacklist ssb blacklist b43 </pre> == Final steps == At this point, reboot your machine. The drivers should be installed and work now. To test this, enter the <code>iwconfig</code> command. you should see an output like this : <pre> $ iwconfig lo no wireless extensions. eth1 IEEE 802.11 Nickname:"lapto" Access Point: Not-Associated Link Quality:5 Signal level:217 Noise level:199 Rx invalid nwid:0 invalid crypt:31 invalid misc:0 eth0 no wireless extensions. </pre> This output suggests that the drivers installed right and your wireless card is recognized as <code>eth1</code> by the kernel. Hooray! You can now either use the <code>iwconfig</code> tool to configure your wireless networks, '''or''' if you prefer to use a GUI, follow the next section for installing Wicd. == Installing Wicd == To make management of wireless connections easier, we will install [http://wicd.sourceforge.net/ Wicd] network manager that provides a simple configuration GUI and system tray icon. === Using slackpkg === If a working internet connection is available on the laptop (say a wired connection), simply use <code>slackpkg</code> to install wicd : <pre>slackpkg install wicd</pre> === Using package tarball === Download the <code>Wicd</code> package for your Slackware version from the ''extra/'' section of your preferred Slackware [http://slackware.osuosl.org/ mirror] and install using <code>installpkg</code>. For example, on a 32-bit system, as root : <pre> wget http://slackware.osuosl.org/slackware-13.37/extra/wicd/wicd-1.7.0-i486-2.txz installpkg ./wicd-1.7.0-i486-2.txz </pre> == Wicd usage == Start the Wicd daemon : <pre> /etc/rc.d/rc.wicd start </pre> Once its started, run <code>wicd-client</code> and configure the network to your liking. === Caveat === Wicd by default treats <code>wlan0</code> as the default wireless interface. Since the interface is <code>eth1</code> in our case, you might want to correct this in Wicd's Preferences. e296fee9d34e91ddf6d9824ad82dadddcc4581c2 User:Klickback 2 247 513 2011-09-09T11:17:24Z Klickback 198 User page wikitext text/x-wiki User klickback on ##slackware at freenode 6e169349e93bd8a974f23b38aefd349c9ec0de51 Chromium browser 0 249 520 2011-09-23T15:54:53Z Klickback 198 Created page with "== Introduction == Chromium is an open source web browser from Google. It is based on the WebKit rendering engine and is the upstream project for Google's popular Chrome Web Bro..." wikitext text/x-wiki == Introduction == Chromium is an open source web browser from Google. It is based on the WebKit rendering engine and is the upstream project for Google's popular Chrome Web Browser. This tutorial explains how to install the latest Chromium build on Slackware and automate the process of updating it regularly. A single user system is assumed, however, modifying it for a multi-user system should be simple enough. == Getting started == Chromium depends on <code>GConf</code> and <code>ORBit2</code>, and these should be installed first. Newer versions may also need the PAM library. === Slackware 13.37 === The above mentioned dependencies are included in the '''extra/''' tree of Slackware 13.37, so these can be simply installed by : <pre> # slackpkg install GConf ORBit2 google-chrome-pam-solibs </pre> === Slackware 13.1 === GConf and ORBit2 are availabe at the [http://slackbuilds.org slackbuilds.org] repository. These can be installed manually or using [http://sbopkg.org Sbopkg] : <pre> # sbopkg -i 'ORBit2 GConf' </pre> Get the <code>google-chrome-pam-solibs</code> package [http://slackware.osuosl.org/slackware-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-i486-1.txz 32-bi] [http://slackware.osuosl.org/slackware64-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-x86_64-1.txz 64-bit] and install it : <pre> # installpkg ./google-chrome-pam-solibs-1.1.3-x86_64-1.txz </pre> == Getting and installing the latest Chromium build == Google maintains a repository of daily chromium builds that you can get from [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux/ here] (32bit) or [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux_x64/ here] for 64 bit. Scroll down to the bottom and navigate to the latest build directory, and download the 'chrome-linux.zip' file there. Extract the zip file to a place of your liking (I like to keep mine in /home/username/soft), and run the 'chrome-wrapper' binary that will run Chromium and also generate a 'chromium-dev.desktop' file in /home/user/.local/share/applications/ and a Chromium entry will appear in your KDE or Xfce menu. Copy that file to your desktop if you prefer a desktop shortcut. To upgrade Chromium, just download the latest zip file and extract it where you previously did, overwriting the previous files. == Automating the Process == The following script helps to automate the process of installing and upgrading Chromium. Edit the <code>INSTALLDIR</code> variable to your liking - that is the place where chromium will be installed. Its recommended to keep it in a folder in your home directory to make it easy to manage. make sure the folder exists before running the script, or the script will fail. <pre> #!/bin/bash # Installation directory - change this to a directory of your choice # Please make sure the directory exists first, or the script won't work INSTALLDIR=$HOME/soft # Determine the architecture of the machine in use and set variables accordingly if [ -z "$ARCH" ]; then case "$( uname -m )" in i686) ARCH=i686 ;; *) ARCH=$( uname -m ) ;; esac fi if [ "$ARCH" = "i686" ];then DIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then DIRSUFFIX="_x64" else echo "The ARCH should be either i686 or x86_64. Exiting." exit fi # Determine the build number of the latest build LATESTBUILD=$(curl http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/LAST_CHANGE) # The URL to download from CHROMEURL="http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux"$DIRSUFFIX/$LATESTBUILD/"chrome-linux.zip" cd $INSTALLDIR if [ -e chrome-linux.zip ]; then # Check to see if `chrome-linux.zip` already exists mv chrome-linux.zip chrome-linux.zip.old # if it does, rename it to chrome-linux.zip.old as backup fi # in case the current build has problems wget $CHROMEURL unzip -u -o ./chrome-linux.zip </pre> To automate the process, first save the script as '''chromium-update.sh''' and add it to your users's cron jobs. Here is an example on how to set it up : <pre> $ cd $HOME $ mkdir .cron $ cp ./chromium-update.sh ./.cron/ $ chmod a+x ./.cron/chromium-update.sh $ crontab -e </pre> Add the following to your crontab : <pre> # Run daily cron job at 13:20 every day: 20 13 * * * ~/.cron/chromium-update.sh 1> /dev/null </pre> This will run the script at 13:20 every day. See <code>man crontab</code> for more on how to customize your cron jobs. == Resources == [http://www.chromium.org/Home Chromium home page] [http://en.wikipedia.org/wiki/Chromium_(web_browser)#Differences_from_Google_Chrome Differences from Google Chrome] [https://wiki.archlinux.org/index.php/Chromium#Configuration Tips on configuration and customization from Archwiki] b439593fbfe6aa6712a6b26fe3fd620f19c7945e 521 520 2011-09-23T16:07:02Z Klickback 198 wikitext text/x-wiki == Introduction == Chromium is an open source web browser from Google. It is based on the WebKit rendering engine and is the upstream project for Google's popular Chrome Web Browser. This tutorial explains how to install the latest Chromium build on Slackware and automate the process of updating it regularly. A single user system is assumed. However, adapting this tutorial for a multi-user system should be simple enough. Also keep in mind that Chromium is the '''testing''' branch of the Chrome web browser, and is not recommended for mission-critical systems. Consider using [http://www.google.com/chrome Google Chrome] or [http://www.mozilla.org/en-US/firefox/ Mozilla Firefox] for production systems. == Getting started == Chromium depends on <code>GConf</code> and <code>ORBit2</code>, and these should be installed first. Newer versions may also need the PAM library. === Slackware 13.37 === The above mentioned dependencies are included in the '''extra/''' tree of Slackware 13.37, so these can be simply installed by : <pre> # slackpkg install GConf ORBit2 google-chrome-pam-solibs </pre> === Slackware 13.1 === GConf and ORBit2 are availabe at the [http://slackbuilds.org slackbuilds.org] repository. These can be installed manually or using [http://sbopkg.org Sbopkg] : <pre> # sbopkg -i 'ORBit2 GConf' </pre> Get the <code>google-chrome-pam-solibs</code> package [http://slackware.osuosl.org/slackware-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-i486-1.txz 32-bit] [http://slackware.osuosl.org/slackware64-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-x86_64-1.txz 64-bit] and install it : <pre> # installpkg ./google-chrome-pam-solibs-1.1.3-x86_64-1.txz </pre> == Getting and installing the latest Chromium build == Google maintains a repository of daily chromium builds that you can get from [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux/ here] (32bit) or [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux_x64/ here] for 64 bit. Scroll down to the bottom and navigate to the latest build directory, and download the 'chrome-linux.zip' file there. Extract the zip file to a place of your liking (I like to keep mine in /home/username/soft), and run the 'chrome-wrapper' binary that will run Chromium and also generate a 'chromium-dev.desktop' file in /home/user/.local/share/applications/ and a Chromium entry will appear in your KDE or Xfce menu. Copy that file to your desktop if you prefer a desktop shortcut. To upgrade Chromium, just download the latest zip file and extract it where you previously did, overwriting the previous files. == Automating the Process == The following script helps to automate the process of installing and upgrading Chromium. Edit the <code>INSTALLDIR</code> variable to your liking - that is the place where chromium will be installed. Its recommended to keep it in a folder in your home directory to make it easy to manage. make sure the folder exists before running the script, or the script will fail. <pre> #!/bin/bash # Installation directory - change this to a directory of your choice # Please make sure the directory exists first, or the script won't work INSTALLDIR=$HOME/soft # Determine the architecture of the machine in use and set variables accordingly if [ -z "$ARCH" ]; then case "$( uname -m )" in i686) ARCH=i686 ;; *) ARCH=$( uname -m ) ;; esac fi if [ "$ARCH" = "i686" ];then DIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then DIRSUFFIX="_x64" else echo "The ARCH should be either i686 or x86_64. Exiting." exit fi # Determine the build number of the latest build LATESTBUILD=$(curl http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/LAST_CHANGE) # The URL to download from CHROMEURL="http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux"$DIRSUFFIX/$LATESTBUILD/"chrome-linux.zip" cd $INSTALLDIR if [ -e chrome-linux.zip ]; then # Check to see if `chrome-linux.zip` already exists mv chrome-linux.zip chrome-linux.zip.old # if it does, rename it to chrome-linux.zip.old as backup fi # in case the current build has problems wget $CHROMEURL unzip -u -o ./chrome-linux.zip </pre> To automate the process, first save the script as '''chromium-update.sh''' and add it to your users's cron jobs. Here is an example on how to set it up : <pre> $ cd $HOME $ mkdir .cron $ cp ./chromium-update.sh ./.cron/ $ chmod a+x ./.cron/chromium-update.sh $ crontab -e </pre> Add the following to your crontab : <pre> # Run daily cron job at 13:20 every day: 20 13 * * * ~/.cron/chromium-update.sh 1> /dev/null </pre> This will run the script at 13:20 every day. See <code>man crontab</code> for more on how to customize your cron jobs. == Resources == [http://www.chromium.org/Home Chromium home page] [http://en.wikipedia.org/wiki/Chromium_(web_browser)#Differences_from_Google_Chrome Differences from Google Chrome] [https://wiki.archlinux.org/index.php/Chromium#Configuration Tips on configuration and customization from Archwiki] d606bcc2e17420c24971d449f21676355205652a 522 521 2011-09-23T17:16:18Z Klickback 198 added use case wikitext text/x-wiki == Introduction == Chromium is an open source web browser from Google. It is based on the WebKit rendering engine and is the upstream project for Google's popular Chrome Web Browser. Keep in mind that Chromium is the '''testing''' branch of the Chrome web browser, and is not recommended for mission-critical systems. Consider using [http://www.google.com/chrome Google Chrome] or [http://www.mozilla.org/en-US/firefox/ Mozilla Firefox] for production systems. === Use Case === This tutorial explains how to install the latest Chromium build on Slackware and automate the process of updating it regularly. It is aimed at users on a personal desktop or laptop, especially on a single-user system. While the [http://slackbuilds.org slackbuilds.org] project provides excellent quality build scripts for Chromium, downloading a 140MB+ source code and doing compilations that often take more than a couple of hours to complete is generally not feasible for people with laptops or slower computers. Therefore, this guide aims on how to automate the process of installing and updating Chromium using daily binary builds that are much smaller in size and take up negligible resources for the install and update process; helping the user always run the latest and greatest builds without the hassle of downloading and compiling the source code. == Getting started == Chromium depends on <code>GConf</code> and <code>ORBit2</code>, and these should be installed first. Newer versions may also need the PAM library. === Slackware 13.37 === The above mentioned dependencies are included in the '''extra/''' tree of Slackware 13.37, so these can be simply installed by : <pre> # slackpkg install GConf ORBit2 google-chrome-pam-solibs </pre> === Slackware 13.1 === GConf and ORBit2 are availabe at the [http://slackbuilds.org slackbuilds.org] repository. These can be installed manually or using [http://sbopkg.org Sbopkg] : <pre> # sbopkg -i 'ORBit2 GConf' </pre> Get the <code>google-chrome-pam-solibs</code> package [http://slackware.osuosl.org/slackware-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-i486-1.txz 32-bit] [http://slackware.osuosl.org/slackware64-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-x86_64-1.txz 64-bit] and install it : <pre> # installpkg ./google-chrome-pam-solibs-1.1.3-x86_64-1.txz </pre> == Getting and installing the latest Chromium build == Google maintains a repository of daily chromium builds that you can get from [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux/ here] (32bit) or [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux_x64/ here] for 64 bit. Scroll down to the bottom and navigate to the latest build directory, and download the 'chrome-linux.zip' file there. Extract the zip file to a place of your liking (I like to keep mine in /home/username/soft), and run the 'chrome-wrapper' binary that will run Chromium and also generate a 'chromium-dev.desktop' file in /home/user/.local/share/applications/ and a Chromium entry will appear in your KDE or Xfce menu. Copy that file to your desktop if you prefer a desktop shortcut. To upgrade Chromium, just download the latest zip file and extract it where you previously did, overwriting the previous files. == Automating the Process == The following script helps to automate the process of installing and upgrading Chromium. Edit the <code>INSTALLDIR</code> variable to your liking - that is the place where chromium will be installed. Its recommended to keep it in a folder in your home directory to make it easy to manage. make sure the folder exists before running the script, or the script will fail. <pre> #!/bin/bash # Installation directory - change this to a directory of your choice # Please make sure the directory exists first, or the script won't work INSTALLDIR=$HOME/soft # Determine the architecture of the machine in use and set variables accordingly if [ -z "$ARCH" ]; then case "$( uname -m )" in i686) ARCH=i686 ;; *) ARCH=$( uname -m ) ;; esac fi if [ "$ARCH" = "i686" ];then DIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then DIRSUFFIX="_x64" else echo "The ARCH should be either i686 or x86_64. Exiting." exit fi # Determine the build number of the latest build LATESTBUILD=$(curl http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/LAST_CHANGE) # The URL to download from CHROMEURL="http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux"$DIRSUFFIX/$LATESTBUILD/"chrome-linux.zip" cd $INSTALLDIR if [ -e chrome-linux.zip ]; then # Check to see if `chrome-linux.zip` already exists mv chrome-linux.zip chrome-linux.zip.old # if it does, rename it to chrome-linux.zip.old as backup fi # in case the current build has problems wget $CHROMEURL unzip -u -o ./chrome-linux.zip </pre> To automate the process, first save the script as '''chromium-update.sh''' and add it to your users's cron jobs. Here is an example on how to set it up : <pre> $ cd $HOME $ mkdir .cron $ cp ./chromium-update.sh ./.cron/ $ chmod a+x ./.cron/chromium-update.sh $ crontab -e </pre> Add the following to your crontab : <pre> # Run daily cron job at 13:20 every day: 20 13 * * * ~/.cron/chromium-update.sh 1> /dev/null </pre> This will run the script at 13:20 every day. See <code>man crontab</code> for more on how to customize your cron jobs. == Resources == [http://www.chromium.org/Home Chromium home page] [http://en.wikipedia.org/wiki/Chromium_(web_browser)#Differences_from_Google_Chrome Differences from Google Chrome] [https://wiki.archlinux.org/index.php/Chromium#Configuration Tips on configuration and customization from Archwiki] e370c14e6b955a97c61adb1890dbf9f57dacf052 523 522 2011-09-23T17:18:33Z Klickback 198 /* Use Case */ wikitext text/x-wiki == Introduction == Chromium is an open source web browser from Google. It is based on the WebKit rendering engine and is the upstream project for Google's popular Chrome Web Browser. Keep in mind that Chromium is the '''testing''' branch of the Chrome web browser, and is not recommended for mission-critical systems. Consider using [http://www.google.com/chrome Google Chrome] or [http://www.mozilla.org/en-US/firefox/ Mozilla Firefox] for production systems. === Use Case === This tutorial explains how to install the latest Chromium build on Slackware and automate the process of updating it regularly. It is aimed at users on a personal desktop or laptop, especially on a single-user system. While the [http://slackbuilds.org slackbuilds.org] project provides excellent quality build scripts for Chromium, downloading 140MB+ source code and doing compilations that often take more than a couple of hours to complete is generally not feasible for people with laptops, slower computers or slow internet connections. Therefore, this guide aims on how to automate the process of installing and updating Chromium using daily binary builds that are much smaller in size and take up negligible resources for the install and update process, thus helping the user always run the latest and greatest builds without the hassle of downloading and compiling the source code. == Getting started == Chromium depends on <code>GConf</code> and <code>ORBit2</code>, and these should be installed first. Newer versions may also need the PAM library. === Slackware 13.37 === The above mentioned dependencies are included in the '''extra/''' tree of Slackware 13.37, so these can be simply installed by : <pre> # slackpkg install GConf ORBit2 google-chrome-pam-solibs </pre> === Slackware 13.1 === GConf and ORBit2 are availabe at the [http://slackbuilds.org slackbuilds.org] repository. These can be installed manually or using [http://sbopkg.org Sbopkg] : <pre> # sbopkg -i 'ORBit2 GConf' </pre> Get the <code>google-chrome-pam-solibs</code> package [http://slackware.osuosl.org/slackware-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-i486-1.txz 32-bit] [http://slackware.osuosl.org/slackware64-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-x86_64-1.txz 64-bit] and install it : <pre> # installpkg ./google-chrome-pam-solibs-1.1.3-x86_64-1.txz </pre> == Getting and installing the latest Chromium build == Google maintains a repository of daily chromium builds that you can get from [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux/ here] (32bit) or [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux_x64/ here] for 64 bit. Scroll down to the bottom and navigate to the latest build directory, and download the 'chrome-linux.zip' file there. Extract the zip file to a place of your liking (I like to keep mine in /home/username/soft), and run the 'chrome-wrapper' binary that will run Chromium and also generate a 'chromium-dev.desktop' file in /home/user/.local/share/applications/ and a Chromium entry will appear in your KDE or Xfce menu. Copy that file to your desktop if you prefer a desktop shortcut. To upgrade Chromium, just download the latest zip file and extract it where you previously did, overwriting the previous files. == Automating the Process == The following script helps to automate the process of installing and upgrading Chromium. Edit the <code>INSTALLDIR</code> variable to your liking - that is the place where chromium will be installed. Its recommended to keep it in a folder in your home directory to make it easy to manage. make sure the folder exists before running the script, or the script will fail. <pre> #!/bin/bash # Installation directory - change this to a directory of your choice # Please make sure the directory exists first, or the script won't work INSTALLDIR=$HOME/soft # Determine the architecture of the machine in use and set variables accordingly if [ -z "$ARCH" ]; then case "$( uname -m )" in i686) ARCH=i686 ;; *) ARCH=$( uname -m ) ;; esac fi if [ "$ARCH" = "i686" ];then DIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then DIRSUFFIX="_x64" else echo "The ARCH should be either i686 or x86_64. Exiting." exit fi # Determine the build number of the latest build LATESTBUILD=$(curl http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/LAST_CHANGE) # The URL to download from CHROMEURL="http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux"$DIRSUFFIX/$LATESTBUILD/"chrome-linux.zip" cd $INSTALLDIR if [ -e chrome-linux.zip ]; then # Check to see if `chrome-linux.zip` already exists mv chrome-linux.zip chrome-linux.zip.old # if it does, rename it to chrome-linux.zip.old as backup fi # in case the current build has problems wget $CHROMEURL unzip -u -o ./chrome-linux.zip </pre> To automate the process, first save the script as '''chromium-update.sh''' and add it to your users's cron jobs. Here is an example on how to set it up : <pre> $ cd $HOME $ mkdir .cron $ cp ./chromium-update.sh ./.cron/ $ chmod a+x ./.cron/chromium-update.sh $ crontab -e </pre> Add the following to your crontab : <pre> # Run daily cron job at 13:20 every day: 20 13 * * * ~/.cron/chromium-update.sh 1> /dev/null </pre> This will run the script at 13:20 every day. See <code>man crontab</code> for more on how to customize your cron jobs. == Resources == [http://www.chromium.org/Home Chromium home page] [http://en.wikipedia.org/wiki/Chromium_(web_browser)#Differences_from_Google_Chrome Differences from Google Chrome] [https://wiki.archlinux.org/index.php/Chromium#Configuration Tips on configuration and customization from Archwiki] 51ae02a055c4433ae701a024c808f7e7139b92f4 Acer Aspire 502x(WLMi) 0 37 524 58 2011-10-16T11:19:00Z Merge-delete 261 Remove out of date information and some of the references to pre-historic kernels wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an Acer Aspire 5020 series== This article is based on an Aspire 5021WLMi. The 5021WLMi is an an AMD Turion 64 based laptop - it mainly differs from other laptops of the 5020 series only in the specific processor model and some other models come with built in bluetooth - the 5021 has an ML-28 and no bluetooth, I believe the 5024 uses an ML-34 and does have built in bluetooth, so most of this should apply to the 502x series as well. (This is a work in progress, and therefore far from finished). I have installed my own bluetooth module into the 5021 - this is not very difficult to do (just rather fiddly), but the instructions for operating the bluetooth apply to any 5020 series laptop with bluetooth installed. ==Hardware== Output of lspci:<pre> 00:00.0 Host bridge: ATI Technologies Inc RS480 Host Bridge (rev 01) 00:02.0 PCI bridge: ATI Technologies Inc RS480 PCI-X Root Port 00:07.0 PCI bridge: ATI Technologies Inc RS480 PCI Bridge 00:13.0 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller 00:13.1 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller 00:13.2 USB Controller: ATI Technologies Inc IXP SB400 USB2 Host Controller 00:14.0 SMBus: ATI Technologies Inc IXP SB400 SMBus Controller (rev 11) 00:14.1 IDE interface: ATI Technologies Inc Standard Dual Channel PCI IDE Controller ATI 00:14.3 ISA bridge: ATI Technologies Inc IXP SB400 PCI-ISA Bridge 00:14.4 PCI bridge: ATI Technologies Inc IXP SB400 PCI-PCI Bridge 00:14.5 Multimedia audio controller: ATI Technologies Inc IXP SB400 AC'97 Audio Controller (rev 02) 00:14.6 Modem: ATI Technologies Inc ATI SB400 - AC'97 Modem Controller (rev 02) 00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration 00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map 00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller 00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control 01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility X700 (PCIE) 06:05.0 Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02) 06:06.0 CardBus bridge: Texas Instruments PCIxx21/x515 Cardbus Controller 06:06.2 FireWire (IEEE 1394): Texas Instruments OHCI Compliant IEEE 1394 Host Controller 06:06.3 Mass storage controller: Texas Instruments PCIxx21 Integrated FlashMedia Controller 06:06.4 Class 0805: Texas Instruments PCI6411/6421/6611/6621/7411/7421/7611/7621 Secure Digital Controller 06:07.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10) </pre> ===Overview=== * AMD Turion 64 ML-28 at 1.6 GHz with 128 KB L1 cache and 512 KB L2 cache * 512 MB of DDR333 memory * 15.4" Samsung LTN154X3-L01 WXGA LCD panel (1280 x 800) * ATi Mobility Radeon X700 (128MB dedicated memory) * 80GB (4200 RPM) (P)ATA Hard Drive ([http://www.seagate.com/cda/products/discsales/marketing/detail/0,1081,638,00.html Seagate Momentus 4200.2 - ST9808210A]) * Slot DVD Writer (DVD-R/RW, DVD+R/RW, DVD+R Dual Layer) * Texas Instruments (TI7421) 6-in-1 card reader * Gigabit Ethernet (Realtek RTL-8169 chipset?) * 802.11 b/g Wireless LAN (Broadcom AirForce One 54g (BCM4318)) * ATi SB400 AC'97 Soundcard + Modem * 1 x IR port * 1 x IEEE-1394 (Firewire) port * 4 x USB ports * 1 x S-Video port * 1 x VGA port * 1 x PCMCIA slot ===Working=== * Video Card: ATI Mobility X700 (1280x800 - fglrx and radeon & r300) * Broadcom Wireless LAN Card (acer_acpi + ndiswrapper with bcmwl564.sys driver, available as 80211g.zip from Acer driver download area. Slamd64 - need Windows XP 64 driver). * Soundcard (snd-atiixp as of alsa-driver-1.0.9b or kernel) * Function/Hot Keys (have not tried all though; extra configuration required for 'multimedia' keys) * Touchpad (Doesn't need a driver for basic functions) * USB * CD/RW, DVD+/-RW * Ethernet card (works with Realtek 8169 driver) * Battery Status * PCMCIA * 6-in-1 card reader (SD/ MMC & MemoryStick/ Pro only at the moment - [http://tifmxx.berlios.de/ driver in progress]) * Bluetooth ===Not Tested, but probably works=== * Firewire * Infra Red * VGA out ==Kernel Configuration== You will need to use a 2.6.19 or newer kernel to get this laptop to work properly in Linux without any extra kernel patching (see Troubleshooting for more information). I would *strongly* recommend you always use the latest stable 2.6.x kernel with this laptop, since there are a lot of fixes going in that relate to this laptop (ATI chipset, apic, yenta socket, wireless drivers (b43), etc). This should be very similar to any other AMD64 laptop with an ATi chipset (like the Acer Ferrari 4000 series- enable anything with 'ATI IXP', plus the relevant ACPI options. I'll put up more here about any necessary specific options later. However, I have *disabled* the framebuffer, as it doesn't play well with the X video drivers. When building a new kernel make sure that you use the following options, if you want to use the ATI/fglrx driver:<br> use '/dev/agpgart' as module<br> turn off, the 'Direct Render Manager'<br> (so you dont select 'radeon'..)<br> ==Hardware Package and Software Dependencies== ===Graphics=== Follow the instructions here [http://slackwiki.org/ATI_Graphics] to install and set up your video driver, using the radeon & r300 Mesa drivers. fglrx is no longer supported on this hardware. ===Mouse=== To get advanced features, you will need to install the [http://web.telia.com/~u89404340/touchpad/ Synaptics Mousepad driver for X] and change your mouse driver in xorg.conf to use 'synaptics'. (I use the Synaptics driver mostly to disable 'Tap-to-Click') To ensure the touchpad always has the same device name, create /etc/udev/rules.d/local.rules (if it doesn't exist) and add the following: BUS=="serio", SYSFS{description}=="i8042 Aux-3 Port", KERNEL=="mouse*", NAME="input/%k",SYMLINK+="input/touchpad" You can now point xorg.conf towards /dev/input/touchpad for the touchpad (/dev/input/touchpad will always be a symlink to whichever device the touchpad is - this can vary depending on whether you plug another mouse into the system before or after booting). ===Modem=== This is a Conexant HSF modem - it is incompatible with slmodemd (you therefore do _not_ need snd-atiixp-modem). The only drivers available for this modem are from [http://www.linuxant.com Linuxant] (the free-of-charge drivers are limited to 14.4K, you will need to pay if you want full 56.6K speeds and fax). ===Wireless=== To use the built in wireless, you need to firstly switch on the wireless, then load the b43 driver. You will also need to obtain the firmware for this card - see [http://linuxwireless.org/en/users/Drivers/b43#devicefirmware Linux Wireless] on where to get it from. 1. Enable Wireless '''2.6.24:''' * Download, build and install [http://code.google.com/p/aceracpi acer_acpi] * Load acer_acpi: modprobe acer_acpi wireless=1 '''2.6.25 or newer:''' * echo 1 > /sys/devices/platform/acer-wmi/wireless * Or create /etc/modprobe.d/acer-wmi and add "options acer-wmi wireless=1" to do this at boot time 2. Install b43 firmware * Download, build and install b43-fwcutter - use the [http://www.slackbuilds.org SlackBuilds.org] Slackbuild for thos * Follow the instructions on [http://linuxwireless.org/en/users/Drivers/b43#devicefirmware Linux Wireless] for your kernel version to extract the firmware and install it to /lib/firmware (The orange light for the wireless at the front should turn on now) 3. Configure the wireless in /etc/rc.d/rc.inet1.conf Note: I deleted rc.wireless.conf as it is unecessary and keeps trying to override rc.inet1.conf (besides, configuring wireless in rc.inet1.conf is the future). ===Bluetooth=== The bluetooth is an internal USB dongle. To turn it on: * echo 1 > /sys/devices/platform/acer-wmi/bluetooth * Or create /etc/modprobe.d/acer-wmi and add "options acer-wmi bluetooth=1" to do this at boot time The bluetooth device can now be seen with lsusb (it is not visible when bluetooth if you don't enable it through acer_acpi/ acer-wmi). ===Special Keys=== There is a keymap for the special keys available [http://www.fwconsult.com/acer-install/index.html here]. However, I have had problems with it on my UK layout keyboard so would not recommend using it at the moment. ===Special Keys with X=== ====HAL==== You will need, at a minimum, HAL 0.5.10 and hal-info 20070725. The Aspire 5020 has been submitted to HAL as part of their keyboard quirk project, so the extra keys which generated dmesg messages, will now generate proper keycodes. ====X==== There is now a generic acer_laptop keyboard layout in upstream xkeyboard-config (which works in tandem with HAL to map the extra keys). This will be in the next xkeyboard-config release after 1.0 (it is therefore unlikely to make the next X.Org release). You can also use the evdev layout instead. ===Hardware Monitoring=== Unfortunately, the extent of 'hardware monitoring' on this system comes through 3 thermal zones provided by ACPI. You can play around with using I2C to access the SMBus, but the hardware on the other end of it appears to be a National Semiconductors chip of sorts that is not supported under Linux (and based on comments on the lm_sensors mailing list, due to various problems, is not very likely to be either). ===Suspend=== Suspend does work on this laptop (assuming you don't have any funny PCMCIA, USB or Firewire devices attached that will break it). '''In a terminal''' You will need either vbetool or a 2.6.17-rc (or newer) kernel with s2ram (found in [http://suspend.sourceforge.net suspend]). Using s2ram: s2ram -f -p Using swusp (run this command after resuming): vbetool post '''In X''' Works with either radeon or fglrx (you don't need to run s2ram if you suspend from X). ===Card Reader=== This card reader is not fully supported in Linux yet. There is an in development driver, [http://tifmxx.berlios.de tifmxx], that currently supports MMC/ SD, and Memory Stick/ Pro. If you want to help out the project, hardware donations are welcome for unsupported hardware (be aware that the developer's card reader can not physically support SmartMedia cards). ==Troubleshooting== ===HPET=== Not available on this laptop - locks hard with hpet=force (I suspect HPET's are only available on the newer SB480 chipsets). ===DVDs will not play back=== You need to set the DVD region before you can play any DVDs. The 'regionset' tool for Linux will let you do this (otherwise you will have lots of strange error messages in dmesg). ===Suspend/ Resume does not work=== Please be aware that kernel updates can break this. If that's the case, I will try and update this page to reflect that. Otherwise, go back and make sure you have applied the necessary patch specified earlier in "Suspend" to your kernel. Also, try unplugging any devices attached to the laptop, rebooting (some drivers can be a bit funny otherwise) and then try suspend/ resume. If it now works, then one of your devices or a driver somewhere is breaking suspend - in which case, you should report the bug to the relevant person/ place. ==Contributors== *[http://slackwiki.org/User:Ccorbacho Carlos Corbacho (aka cathectic)] *[http://slackwiki.org/User:Funmain Funmain] ==External Links/ References== * [http://forums.slamd64.com/viewtopic.php?t=27 fglrx on Slamd64] * [http://www.fwconsult.com/acer-install/index.html Installing Gentoo (2005.0) on an Acer 5021NWLCi] * [http://gentoo-wiki.com/HARDWARE_Gentoo_Acer_Ferrari_4005WLMi_Manual Gentoo Acer Ferrari 4005WLMi Manual] * [http://website.lineone.net/~bryanrpoole/atiixp-modem.html ATI-IXP MC97 Modem Development / Configuration Information] * [http://bugzilla.kernel.org/show_bug.cgi?id=3927 Kernel Bugzilla entry for AMD64/ ATi timer running fast problem] * [http://doube.net/3023wlmi.html Linux and Windows on an Acer Aspire 3023WLMi] f20d44203161d01c62c4c939c9cb0385279bd334 Hibernate 0 223 525 471 2011-10-18T13:12:49Z Merge-delete 261 /* Generic kernel + initrd */ wikitext text/x-wiki In Slackware, hibernation works out-of-the-box and can be easily done from KDE's menu. Resuming from hibernation, however, is not set up, so when you turn on your computer again, it starts as normal. That is, if your hardware supports it and if you've set up a swap space larger than your RAM. == Huge kernel == To tell your kernel where to resume from, you need to write the info to ''lilo.conf'': append=" resume=/dev/sda6" Replace ''/dev/sda6'' with your actual swap space. Swap partitions are perfect, I think swap files should work too. If you don't know where your swap lies, look at ''/proc/swaps''. == Generic kernel + initrd == If you're using generic or your own kernel, you need to adjust initrd image as well. Append -h /dev/sdx to mkinitrd command so it may look like this: mkinitrd -c -k <kernel-version> -f <fs_type> -m <fs_type> -r /dev/sdx -h /dev/sdy Replace ''/dev/sdx'' with your actual root partition and ''/dev/sdy'' with your actual swap space. If you're using LVM, don't forget to append '''-L''' to mkinitrd command mkinitrd -c -k <kernel-version> -f <fs_type> -m <fs_type> -r /dev/sdx -h /dev/volumegroup/swap -L Afterwards, run lilo. == Further reading == * [http://www.linuxquestions.org/linux/answers/Hardware/Mini_HOW_TO_Hibernate_and_resume_0 Mini_HOW_TO_Hibernate_and_resume_0] * Hibernate to encrypted swap - [http://slackware.osuosl.org/slackware-13.1/README_CRYPT.TXT REAME_CRYPT.TXT] [[Category:Tutorials]] 36855b4c154cb2bb355481fa74d9c51f5e7c8c9f NoMachine NX Server Installation 0 250 526 2011-10-20T00:29:44Z Natex 157 Created page with "[[Category:Tutorials]] == Introduction == The purpose of this article is help the user quickly get an NX server up and running on a Slackware machine. The instructions only app..." wikitext text/x-wiki [[Category:Tutorials]] == Introduction == The purpose of this article is help the user quickly get an NX server up and running on a Slackware machine. The instructions only apply to NoMachine's NX server implementation and does not apply to Freenx server. Instructions for installing a Freenx server can be found here. == What is NX? == An introduction to NX can be found at http://www.nomachine.com/documents/getting-started.php NX Requirements Obtain Extract Installation Connect 4b813ebd315554aa190e889e3d284fed2961e8f6 527 526 2011-10-20T02:42:11Z Natex 157 wikitext text/x-wiki [[Category:Tutorials]] == Introduction == The purpose of this article is help the user quickly get NX Server installed on a Slackware machine. The installation will use the compressed tar packages (version 3.5.X.TAR.GZ) from http://www.nomachine.com. The tutorial only applies to NoMachine's NX server implementation (free edition) and does not apply to Freenx. Instructions for installing Freenx can be found here. == What is NX? == An introduction to NX can be found at http://www.nomachine.com/documents/getting-started.php == Slackware Requirements == According to NoMachine, there are three required packages for a working installation on Linux. * nxclient * nxnode * nxserver No other dependencies are required to install NX Server. However, sshd must already be running on the server and configured properly. ''The client machine must be able to connect to the server via ssh.'' == NX Installation == The following steps must be performed with root priviledges. # Obtain the nxserver, nxnode, and nxclient (compressed tar) packages from http://www.nomachine.com/select-package.php?os=linux&id=1. # Change to the /usr directory.<blockquote># cd /usr</blockquote> # Extract each of the three packages.<blockquote># tar zxvf nxclient-3.5.X.tar.gz</blockquote><blockquote># tar zxvf nxnode-3.5.X.tar.gz</blockquote><blockquote>#tar zxvf nxserver-3.5.X.tar.gz</blockquote> Installation Connect 9553e45a64251d6a5698a8fca53b2b1377519c04 528 527 2011-10-20T02:59:06Z Natex 157 wikitext text/x-wiki [[Category:Tutorials]] == Introduction == The purpose of this article is help the user quickly get NX Server installed on a Slackware machine. The installation will use the compressed tar packages (version 3.5.X.TAR.GZ) from http://www.nomachine.com. The tutorial only applies to NoMachine's NX server implementation (free edition) and does not apply to Freenx. Instructions for installing Freenx can be found here. == What is NX? == An introduction to NX can be found at http://www.nomachine.com/documents/getting-started.php == Slackware Requirements == According to NoMachine, there are three required packages for a working installation on Linux. * nxclient * nxnode * nxserver No other dependencies are required to install NX Server. However, to connect to NX Server, sshd must already be running on the server and configured properly. ''The client machine must be able to connect to the server via ssh.'' == NX Installation == The following steps must be performed with root priviledges. # Obtain the nxserver, nxnode, and nxclient (compressed tar) packages from http://www.nomachine.com/select-package.php?os=linux&id=1. # Change to the /usr directory.<blockquote># cd /usr</blockquote> # Extract each of the three packages.<blockquote># tar zxvf nxclient-3.5.X.tar.gz</blockquote><blockquote># tar zxvf nxnode-3.5.X.tar.gz</blockquote><blockquote># tar zxvf nxserver-3.5.X.tar.gz</blockquote> # Create some required directories in /etc/init.d/<blockquote># mkdir /etc/init.d/rc{0,2,3,5,6}.d</blockquote> # Run the installation scripts <blockquote># /usr/NX/scripts/setup/nxnode --install suse</blockquote><blockquote># /usr/NX/scripts/setup/nxserver --install suse</blockquote> Connect 8f024506e05a8ac5aaea73f4c9886ff0de3849ea 529 528 2011-10-20T04:34:28Z Natex 157 wikitext text/x-wiki [[Category:Tutorials]] == Introduction == The purpose of this article is help the user quickly get NX Server installed on a Slackware machine. The installation will use the compressed tar packages (version 3.5.X.TAR.GZ) from http://www.nomachine.com. The tutorial only applies to NoMachine's NX server implementation (free edition) and does not apply to Freenx. Instructions for installing Freenx can be found here. == What is NX? == An introduction to NX can be found at http://www.nomachine.com/documents/getting-started.php == Slackware Requirements == According to NoMachine, there are three required packages for a working installation on Linux. * nxclient * nxnode * nxserver A working sshd installation must already be running on the server and configured properly. ''The client machine must be able to connect to the server via ssh.'' == Changes to /etc/ssh/sshd_config === Comment out #AuthorizedKeysFile .ssh/authorized_keys so that the sshd daemon configuration is configured to look for an authorized key file named .ssh/authorized_keys and .ssh/authorized_keys2. == NX Installation == The following steps must be performed with root priviledges. # Obtain the nxserver, nxnode, and nxclient (compressed tar) packages from http://www.nomachine.com/select-package.php?os=linux&id=1. # Change to the /usr directory.<blockquote># cd /usr</blockquote> # Extract each of the three packages.<blockquote># tar zxvf nxclient-3.5.X.tar.gz</blockquote><blockquote># tar zxvf nxnode-3.5.X.tar.gz</blockquote><blockquote># tar zxvf nxserver-3.5.X.tar.gz</blockquote> # Create some required directories in /etc/init.d/<blockquote># mkdir /etc/init.d/rc{0,2,3,5,6}.d</blockquote> # Run the installation scripts <blockquote># /usr/NX/scripts/setup/nxnode --install suse</blockquote><blockquote># /usr/NX/scripts/setup/nxserver --install suse</blockquote> 62641159edc407eafd60900e6f79721c13e8e290 Dual Booting With FreeBSD 9 0 253 533 2011-10-25T09:57:59Z Dive 19 Created page with "=Introduction= FreeBSD 9+ differs from older releases by using GPT (GUID Partition Table). This means that lilo and grub version 1 will no longer work. Grub version 2 however do..." wikitext text/x-wiki =Introduction= FreeBSD 9+ differs from older releases by using GPT (GUID Partition Table). This means that lilo and grub version 1 will no longer work. Grub version 2 however does work. There are two way of doings this - either install grub2 in Slackware, or install it in FreeBSD. Grub2 in Slackware does not seem to be able to pick up the FreeBSD partition and Grub2 in FreeBSD doesn't seem to pick up the Linux partitions. You will need to manually add these to /usr/local/etc/grub.d/40_custom. To pick up all your Slackware kernels it's probably best to install grub2 in Slackware and add the FreeBSD partition manually. I've shown both methods here though, for completeness. For this howto we'll assume that Slackware / is on /dev/sda2 (with no separate /boot partition), and that FreeBSD is on /dev/sdb2 (/dev/ada1p2 in FreeBSD-speak). These correspond to (hd0,2) and (hd1,2) in Grub2. =To install Grub2 in Slackware= To install Grub2 in Slackware, you can use the slackbuild script here: http://slackbuilds.org/repository/13.37/system/grub2/ and its dependencies. Once installed, issue: # grub-install --modules=part_gpt /dev/sda Edit /etc/grub.d/40_custom to add your FreeBSD partition (see mine below for an example). Once done: # grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig will pickup all your Linux partitions and all kernels (hopefully). =To install in FreeBSD= To install Grub2 in FreeBSD, you need to use ports. I won't give an extended howto on using ports but these are the steps: Fire up your FreeBSD system and navigate your way to /usr/ports/sysutils/grub2 as root # make install && rm -rf work # grub-install --modules=part_gpt /dev/ad0 Edit /usr/local/etc/grub.d/40_custom to add your Slackware partition (see mine below for an example). Once done: # grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig will pick up FreeBSD automatically. /usr/local/etc/grub.d/40_custom will contain the extra OS's and FreeBSD boot loader if req'd. =Custom Rule= This is my 40_custom: #!/bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry 'Slackware' --class slackware --class gnu-linux --class os { insmod gzio insmod part_msdos insmod ext2 set root='(hd0,2)' linux /boot/vmlinuz root=/dev/sdb2 ro } menuentry "FreeBSD /boot/loader" --class freebsd --class bsd --class os { insmod ufs2 set root='(hd1,2)' kfreebsd /boot/loader } (You choose which section you want to add - FreeBSD or Slackware - depending on where you installed Grub2.) That's pretty much it. =Notes= My Slackware uses ext4 and a custom kernel with no initrd. For, say, xfs you should use 'insmod xfs'. Caveat: This was tested on FreeBSD 9.0Beta3. I can't see that it wouldn't work when release is out but you never know. [[User:Dive|Dive]] 0513ad76fb5cc03fd28577a6c856ee8878eaaae5 534 533 2011-10-25T09:59:02Z Dive 19 moved [[Dual Booting With FreeBSD 9+]] to [[Dual Booting With FreeBSD 9]]: + messes up the link wikitext text/x-wiki =Introduction= FreeBSD 9+ differs from older releases by using GPT (GUID Partition Table). This means that lilo and grub version 1 will no longer work. Grub version 2 however does work. There are two way of doings this - either install grub2 in Slackware, or install it in FreeBSD. Grub2 in Slackware does not seem to be able to pick up the FreeBSD partition and Grub2 in FreeBSD doesn't seem to pick up the Linux partitions. You will need to manually add these to /usr/local/etc/grub.d/40_custom. To pick up all your Slackware kernels it's probably best to install grub2 in Slackware and add the FreeBSD partition manually. I've shown both methods here though, for completeness. For this howto we'll assume that Slackware / is on /dev/sda2 (with no separate /boot partition), and that FreeBSD is on /dev/sdb2 (/dev/ada1p2 in FreeBSD-speak). These correspond to (hd0,2) and (hd1,2) in Grub2. =To install Grub2 in Slackware= To install Grub2 in Slackware, you can use the slackbuild script here: http://slackbuilds.org/repository/13.37/system/grub2/ and its dependencies. Once installed, issue: # grub-install --modules=part_gpt /dev/sda Edit /etc/grub.d/40_custom to add your FreeBSD partition (see mine below for an example). Once done: # grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig will pickup all your Linux partitions and all kernels (hopefully). =To install in FreeBSD= To install Grub2 in FreeBSD, you need to use ports. I won't give an extended howto on using ports but these are the steps: Fire up your FreeBSD system and navigate your way to /usr/ports/sysutils/grub2 as root # make install && rm -rf work # grub-install --modules=part_gpt /dev/ad0 Edit /usr/local/etc/grub.d/40_custom to add your Slackware partition (see mine below for an example). Once done: # grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig will pick up FreeBSD automatically. /usr/local/etc/grub.d/40_custom will contain the extra OS's and FreeBSD boot loader if req'd. =Custom Rule= This is my 40_custom: #!/bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry 'Slackware' --class slackware --class gnu-linux --class os { insmod gzio insmod part_msdos insmod ext2 set root='(hd0,2)' linux /boot/vmlinuz root=/dev/sdb2 ro } menuentry "FreeBSD /boot/loader" --class freebsd --class bsd --class os { insmod ufs2 set root='(hd1,2)' kfreebsd /boot/loader } (You choose which section you want to add - FreeBSD or Slackware - depending on where you installed Grub2.) That's pretty much it. =Notes= My Slackware uses ext4 and a custom kernel with no initrd. For, say, xfs you should use 'insmod xfs'. Caveat: This was tested on FreeBSD 9.0Beta3. I can't see that it wouldn't work when release is out but you never know. [[User:Dive|Dive]] 0513ad76fb5cc03fd28577a6c856ee8878eaaae5 536 534 2011-10-25T10:55:53Z Dive 19 wikitext text/x-wiki =Introduction= FreeBSD 9+ differs from older releases by using GPT (GUID Partition Table). This means that lilo and grub version 1 will no longer work. Grub version 2 however does work. There are two way of doings this - either install grub2 in Slackware, or install it in FreeBSD. Grub2 in Slackware does not seem to be able to pick up the FreeBSD partition and Grub2 in FreeBSD doesn't seem to pick up the Linux partitions. You will need to manually add these to /usr/local/etc/grub.d/40_custom. To pick up all your Slackware kernels it's probably best to install grub2 in Slackware and add the FreeBSD partition manually. I've shown both methods here though, for completeness. For this howto we'll assume that Slackware / is on /dev/sda2 (with no separate /boot partition), and that FreeBSD is on /dev/sdb2 (/dev/ada1p2 in FreeBSD-speak). These correspond to (hd0,2) and (hd1,2) in Grub2. =To install Grub2 in Slackware= To install Grub2 in Slackware, you can use the slackbuild script here: http://slackbuilds.org/repository/13.37/system/grub2/ and its dependencies. Once installed, issue: # grub-install --modules=part_gpt /dev/sda Edit /etc/grub.d/40_custom to add your FreeBSD partition (see mine below for an example). Once done: # grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig will pickup all your Linux partitions and all kernels (hopefully). =To install in FreeBSD= To install Grub2 in FreeBSD, you need to use ports. I won't give an extended howto on using ports but these are the steps: Fire up your FreeBSD system and navigate your way to /usr/ports/sysutils/grub2 as root # make install && rm -rf work # grub-install --modules=part_gpt /dev/ad0 Edit /usr/local/etc/grub.d/40_custom to add your Slackware partition (see mine below for an example). Once done: # grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig will pick up FreeBSD automatically. /usr/local/etc/grub.d/40_custom will contain the extra OS's and FreeBSD boot loader if req'd. =Custom Rule= This is my 40_custom: #!/bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry 'Slackware' --class slackware --class gnu-linux --class os { insmod gzio insmod part_msdos insmod ext2 set root='(hd0,2)' linux /boot/vmlinuz root=/dev/sdb2 ro } menuentry "FreeBSD /boot/loader" --class freebsd --class bsd --class os { insmod ufs2 set root='(hd1,2)' kfreebsd /boot/loader } (You choose which section you want to add - FreeBSD or Slackware - depending on where you installed Grub2.) That's pretty much it. =Notes= The Slackware partition uses ext4 and the huge kernel with no initrd. For, say, xfs you should use 'insmod xfs'. For an initrd you need to look up the appropriate docs. Caveat: This was tested on FreeBSD 9.0Beta3. I can't see that it wouldn't work when release is out but you never know. [[User:Dive|Dive]] 356a1e7bea3b087b1d2110805386cec5f5e8b213 Dual Booting With FreeBSD 9+ 0 254 535 2011-10-25T09:59:02Z Dive 19 moved [[Dual Booting With FreeBSD 9+]] to [[Dual Booting With FreeBSD 9]]: + messes up the link wikitext text/x-wiki #REDIRECT [[Dual Booting With FreeBSD 9]] d72b2b389374323983ab0bceb17fa099505b7f30 Dual Booting With FreeBSD 9 0 253 537 536 2011-10-25T11:07:51Z Dive 19 /* Custom Rule */ wikitext text/x-wiki =Introduction= FreeBSD 9+ differs from older releases by using GPT (GUID Partition Table). This means that lilo and grub version 1 will no longer work. Grub version 2 however does work. There are two way of doings this - either install grub2 in Slackware, or install it in FreeBSD. Grub2 in Slackware does not seem to be able to pick up the FreeBSD partition and Grub2 in FreeBSD doesn't seem to pick up the Linux partitions. You will need to manually add these to /usr/local/etc/grub.d/40_custom. To pick up all your Slackware kernels it's probably best to install grub2 in Slackware and add the FreeBSD partition manually. I've shown both methods here though, for completeness. For this howto we'll assume that Slackware / is on /dev/sda2 (with no separate /boot partition), and that FreeBSD is on /dev/sdb2 (/dev/ada1p2 in FreeBSD-speak). These correspond to (hd0,2) and (hd1,2) in Grub2. =To install Grub2 in Slackware= To install Grub2 in Slackware, you can use the slackbuild script here: http://slackbuilds.org/repository/13.37/system/grub2/ and its dependencies. Once installed, issue: # grub-install --modules=part_gpt /dev/sda Edit /etc/grub.d/40_custom to add your FreeBSD partition (see mine below for an example). Once done: # grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig will pickup all your Linux partitions and all kernels (hopefully). =To install in FreeBSD= To install Grub2 in FreeBSD, you need to use ports. I won't give an extended howto on using ports but these are the steps: Fire up your FreeBSD system and navigate your way to /usr/ports/sysutils/grub2 as root # make install && rm -rf work # grub-install --modules=part_gpt /dev/ad0 Edit /usr/local/etc/grub.d/40_custom to add your Slackware partition (see mine below for an example). Once done: # grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig will pick up FreeBSD automatically. /usr/local/etc/grub.d/40_custom will contain the extra OS's and FreeBSD boot loader if req'd. =Custom Rule= This is my 40_custom: #!/bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry 'Slackware' --class slackware --class gnu-linux --class os { insmod gzio insmod part_msdos insmod ext2 set root='(hd0,2)' linux /boot/vmlinuz root=/dev/sdb2 ro } menuentry "FreeBSD --class freebsd --class bsd --class os { insmod ufs2 set root='(hd1,2)' kfreebsd /boot/loader } (You choose which section you want to add - FreeBSD or Slackware - depending on where you installed Grub2.) That's pretty much it. =Notes= The Slackware partition uses ext4 and the huge kernel with no initrd. For, say, xfs you should use 'insmod xfs'. For an initrd you need to look up the appropriate docs. Caveat: This was tested on FreeBSD 9.0Beta3. I can't see that it wouldn't work when release is out but you never know. [[User:Dive|Dive]] 853c89f5362b0c9234dd7193f5d7eaf747acb9eb 538 537 2011-10-25T11:08:23Z Dive 19 /* Custom Rule */ wikitext text/x-wiki =Introduction= FreeBSD 9+ differs from older releases by using GPT (GUID Partition Table). This means that lilo and grub version 1 will no longer work. Grub version 2 however does work. There are two way of doings this - either install grub2 in Slackware, or install it in FreeBSD. Grub2 in Slackware does not seem to be able to pick up the FreeBSD partition and Grub2 in FreeBSD doesn't seem to pick up the Linux partitions. You will need to manually add these to /usr/local/etc/grub.d/40_custom. To pick up all your Slackware kernels it's probably best to install grub2 in Slackware and add the FreeBSD partition manually. I've shown both methods here though, for completeness. For this howto we'll assume that Slackware / is on /dev/sda2 (with no separate /boot partition), and that FreeBSD is on /dev/sdb2 (/dev/ada1p2 in FreeBSD-speak). These correspond to (hd0,2) and (hd1,2) in Grub2. =To install Grub2 in Slackware= To install Grub2 in Slackware, you can use the slackbuild script here: http://slackbuilds.org/repository/13.37/system/grub2/ and its dependencies. Once installed, issue: # grub-install --modules=part_gpt /dev/sda Edit /etc/grub.d/40_custom to add your FreeBSD partition (see mine below for an example). Once done: # grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig will pickup all your Linux partitions and all kernels (hopefully). =To install in FreeBSD= To install Grub2 in FreeBSD, you need to use ports. I won't give an extended howto on using ports but these are the steps: Fire up your FreeBSD system and navigate your way to /usr/ports/sysutils/grub2 as root # make install && rm -rf work # grub-install --modules=part_gpt /dev/ad0 Edit /usr/local/etc/grub.d/40_custom to add your Slackware partition (see mine below for an example). Once done: # grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig will pick up FreeBSD automatically. /usr/local/etc/grub.d/40_custom will contain the extra OS's and FreeBSD boot loader if req'd. =Custom Rule= This is my 40_custom: #!/bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry 'Slackware' --class slackware --class gnu-linux --class os { insmod gzio insmod part_msdos insmod ext2 set root='(hd0,2)' linux /boot/vmlinuz root=/dev/sdb2 ro } menuentry "FreeBSD" --class freebsd --class bsd --class os { insmod ufs2 set root='(hd1,2)' kfreebsd /boot/loader } (You choose which section you want to add - FreeBSD or Slackware - depending on where you installed Grub2.) That's pretty much it. =Notes= The Slackware partition uses ext4 and the huge kernel with no initrd. For, say, xfs you should use 'insmod xfs'. For an initrd you need to look up the appropriate docs. Caveat: This was tested on FreeBSD 9.0Beta3. I can't see that it wouldn't work when release is out but you never know. [[User:Dive|Dive]] 384ea90a80e56f24d0b45c74d645fae087eb79b0 User talk:Merge-delete 3 255 539 2011-11-27T13:14:08Z Merge-delete 261 Planning a trip to lonavala?Visit our site for more information on hotels in lonavala. wikitext text/x-wiki Boutique Hotels In India Indulge yourself in sheer luxury throughout your remain in boutique hotels in India.[http://hotelslonavala.net/ hotels in lonavala] These are the places where one can live like rajas and maharajas. They're simply unique within their architecture and hang up where one can get highly personalized services inside a distinctive manner. They are heritage hotels that supply you with a unique connection with living existence.[http://hotelslonavala.net/ hotels in lonavala] Just opposite to western style hotels, these places permit you to know and have the wealthy culture and history of India. On a trip from the beaten tracks in India, you might find several boutique hotels where one can unwind yourself and also have home-cooked food. With enchanting folk music, amazing architecture, peace and exceptional hospitality, these hotels can bring alive the times of rajas and maharajas of older occasions. Their architecture, gardens, food and luxuries echo from the glorious past of India. Although you will find several hotels in India but when youre searching for best hotels, then certainly Rajasthan may be the condition that you need to visit whenever you arrived at India. You will find several havelis-converted-hotels in Rajasthan where you can unwind yourself and dip your senses in luxury. Remaining during these hotels is definitely an entirely different experience. Youll feel like you aren't nowadays. For experience a completely different lifestyle, you have to visit these hotels and spend your trip. Trust, youll possess a lifetime experience. The deserted great thing about Rajasthan and wealthy tradition enables you to definitely go through the luxury in simplicity. You no more have to pretend as possible be genuine and do what youve always loved. The best hotels in Rajasthan are Rawla Narlai, Raas Hotel, The Serai, Udai Kothi, Bhainsrorgarh and Devigarh. From the sights of those hotels, regal inside and grass to authentic antiques, lodging and fooding may be worth admiring. You seem like wandering within the deserts, going through the wonder, studying wealthy tradition, listening folk music and gorging on local meals. Several companies offer vacation packages to Rajasthan. Whenever you arrived at India, you just cant manage to miss these places. They feature glorious past of India. 41ee596bca7edd95e7e87a4ae8e86d225025fc69 Different Approach To Buildscripts 0 22 540 30 2011-12-09T10:18:39Z Merge-delete 261 wikitext text/x-wiki [[Category:Tutorials]] Pretty much everyone can hanve their own way of writing Slackware buildscripts. I also have mine, which just makes it easier for me to package software. In here, I'm going to explain mine. To start, let's look at one I wrote this morning while drinking coffee cup #1: #!/bin/bash ############################################################################# ## Name: jpilot ## ## Version: 0.99.8 ## ## Packager: Martin Lefebvre (dadexter@gmail.com) ## ## Homepage: http://www.jpilot.org ## ############################################################################# PKGNAME=jpilot VERSION=0.99.8 LOC="http://jpilot.org/$PKGNAME-$VERSION.tar.gz" ARCH=`uname -m` START=`pwd` PKG=$START/pkg SRC=$START/work build() { mkdir -p $PKG $SRC cd $SRC wget $LOC tar -zxvf $PKGNAME-$VERSION.tar.gz cd $PKGNAME-$VERSION ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --enable-gtk2 --enable-prometheon patch -p0 < patch.0.99.8-memory patch -p0 < patch.jpilot-sync make make DESTDIR=$PKG install mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION cp -r ABOUT-NLS AUTHORS BUGS COPYING ChangeLog ChangeLog.cvs INSTALL \ NEWS README TODO UPGRADING docs $PKG/usr/doc/$PKGNAME-$VERSION cp KeyRing/README.txt $PKG/usr/doc/$PKGNAME-$VERSION/README.keyring cp dialer/README $PKG/usr/doc/$PKGNAME-$VERSION/README.dialer cp icons/README $PKG/usr/doc/$PKGNAME-$VERSION/README.icons } package() { cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : \ | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : \ | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "current ar archive" | cut -f 1 -d : | \ xargs strip --strip-debug 2> /dev/null chown -R root:root usr/bin gzip -p $PKG/usr/man/man*/* mkdir $PKG/install cp $START/slack-desc $PKG/install/slack-desc cd $PKG makepkg -l y -c n $START/$PKGNAME-$VERSION-$ARCH-1.tgz } build package The top section is just comments identifying the piece of software we're going to build, and the name of the script's author. Then we have the following lines: PKGNAME=jpilot VERSION=0.99.8 LOC="http://jpilot.org/$PKGNAME-$VERSION.tar.gz" ARCH=`uname -m` START=`pwd` PKG=$START/pkg SRC=$START/work They set the program's name, version, download URL, build and package directories. Since I usually don't specify anything related to the cpu or architecture, it auto detects the architecture. So, the $ARCH variable *should be* accurate. build() { mkdir -p $PKG $SRC cd $SRC wget $LOC tar -zxvf $PKGNAME-$VERSION.tar.gz cd $PKGNAME-$VERSION ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --enable-gtk2 --enable-prometheon patch -p0 < patch.0.99.8-memory patch -p0 < patch.jpilot-sync make make DESTDIR=$PKG install mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION cp -r ABOUT-NLS AUTHORS BUGS COPYING ChangeLog ChangeLog.cvs INSTALL \ NEWS README TODO UPGRADING docs $PKG/usr/doc/$PKGNAME-$VERSION cp KeyRing/README.txt $PKG/usr/doc/$PKGNAME-$VERSION/README.keyring cp dialer/README $PKG/usr/doc/$PKGNAME-$VERSION/README.dialer cp icons/README $PKG/usr/doc/$PKGNAME-$VERSION/README.icons } The is the main build function. This contains the code required to build the software. First, we create the build and package directories. The next 3 lines change to the building diirectory, uses wget to fetch the source file and extracts it. The lines after that are what you would normally type at your command line to build the software: * Change to the source directory. * Run ./configure with all the options you want. * Apply two patches required (in this case) to fix bugs with the software. * Run make * Install the software in the package directory defined by $PKG * Create the standard Slackware Software Documentation directory in the package * Copy the standard documentation. The next section is the packaging part: package() { cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : \ | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : \ | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "current ar archive" | cut -f 1 -d : | \ xargs strip --strip-debug 2> /dev/null chown -R root:root usr/bin gzip -p $PKG/usr/man/man*/* mkdir $PKG/install cp $START/slack-desc $PKG/install/slack-desc cd $PKG makepkg -l y -c n $START/$PKGNAME-$VERSION-$ARCH-1.tgz } * We change to the package directory * Strip executables and libraries in order to decrease size. * As a Slackware standard, we change the ownership of the executables to root:root (to be done for every bin/ and sbin/ directory) * We compress the manpages * Create install/ and copy the slack-desc file from the start directory * Finally, change back to the package folder and create the package tarball. In this example, the slack-desc and some patch files are distributed with the SlackBuild. This also makes it easier to ship the build script with patches that might be required for the software to work on Slackware (patch to remove PAM stuff). The slack-desc file format is described here: [http://www.linuxpackages.net/howto.php?page=slack-desc&title=Slackware+Desc+Files LinuxPackages.net] Additional files: Some people use slapt-get (like me). slapt-get supports additional features such as * Dependencies * Conflicts * Suggestions Not everyone wants those features, so building a package with those files will not interfere with the normal pkgtools process. For more info on these optional files, go here: [http://www.linuxpackages.net/howto.php?page=perfect-package&title=Perfect+Package#Optional LinuxPackages.net] If you decide to use those files, you will then have to repeat these lines: cp $START/slack-desc $PKG/install/slack-desc for slack-required, slack-conflicts, and slack-suggests. ---- See also [[SlackBuild_Scripts]] and [[Writing A SlackBuild Script]] ---- a2b8fad2796c3cf8c3f3871605463b424a4d4a9f 567 540 2011-12-09T14:11:17Z Rworkman 13 Reverted edits by [[Special:Contributions/Esmapebb|Esmapebb]] ([[User talk:Esmapebb|talk]]) to last revision by [[User:Dugan|Dugan]] wikitext text/x-wiki [[Category:Tutorials]] Pretty much everyone can have their own way of writing Slackware buildscripts. I also have mine, which just makes it easier for me to package software. In here, I'm going to explain mine. To start, let's look at one I wrote this morning while drinking coffee cup #1: #!/bin/bash ############################################################################# ## Name: jpilot ## ## Version: 0.99.8 ## ## Packager: Martin Lefebvre (dadexter@gmail.com) ## ## Homepage: http://www.jpilot.org ## ############################################################################# PKGNAME=jpilot VERSION=0.99.8 LOC="http://jpilot.org/$PKGNAME-$VERSION.tar.gz" ARCH=`uname -m` START=`pwd` PKG=$START/pkg SRC=$START/work build() { mkdir -p $PKG $SRC cd $SRC wget $LOC tar -zxvf $PKGNAME-$VERSION.tar.gz cd $PKGNAME-$VERSION ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --enable-gtk2 --enable-prometheon patch -p0 < patch.0.99.8-memory patch -p0 < patch.jpilot-sync make make DESTDIR=$PKG install mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION cp -r ABOUT-NLS AUTHORS BUGS COPYING ChangeLog ChangeLog.cvs INSTALL \ NEWS README TODO UPGRADING docs $PKG/usr/doc/$PKGNAME-$VERSION cp KeyRing/README.txt $PKG/usr/doc/$PKGNAME-$VERSION/README.keyring cp dialer/README $PKG/usr/doc/$PKGNAME-$VERSION/README.dialer cp icons/README $PKG/usr/doc/$PKGNAME-$VERSION/README.icons } package() { cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : \ | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : \ | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "current ar archive" | cut -f 1 -d : | \ xargs strip --strip-debug 2> /dev/null chown -R root:root usr/bin gzip -p $PKG/usr/man/man*/* mkdir $PKG/install cp $START/slack-desc $PKG/install/slack-desc cd $PKG makepkg -l y -c n $START/$PKGNAME-$VERSION-$ARCH-1.tgz } build package The top section is just comments identifying the piece of software we're going to build, and the name of the script's author. Then we have the following lines: PKGNAME=jpilot VERSION=0.99.8 LOC="http://jpilot.org/$PKGNAME-$VERSION.tar.gz" ARCH=`uname -m` START=`pwd` PKG=$START/pkg SRC=$START/work They set the program's name, version, download URL, build and package directories. Since I usually don't specify anything related to the cpu or architecture, it auto detects the architecture. So, the $ARCH variable *should be* accurate. build() { mkdir -p $PKG $SRC cd $SRC wget $LOC tar -zxvf $PKGNAME-$VERSION.tar.gz cd $PKGNAME-$VERSION ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --enable-gtk2 --enable-prometheon patch -p0 < patch.0.99.8-memory patch -p0 < patch.jpilot-sync make make DESTDIR=$PKG install mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION cp -r ABOUT-NLS AUTHORS BUGS COPYING ChangeLog ChangeLog.cvs INSTALL \ NEWS README TODO UPGRADING docs $PKG/usr/doc/$PKGNAME-$VERSION cp KeyRing/README.txt $PKG/usr/doc/$PKGNAME-$VERSION/README.keyring cp dialer/README $PKG/usr/doc/$PKGNAME-$VERSION/README.dialer cp icons/README $PKG/usr/doc/$PKGNAME-$VERSION/README.icons } The is the main build function. This contains the code required to build the software. First, we create the build and package directories. The next 3 lines change to the building diirectory, uses wget to fetch the source file and extracts it. The lines after that are what you would normally type at your command line to build the software: * Change to the source directory. * Run ./configure with all the options you want. * Apply two patches required (in this case) to fix bugs with the software. * Run make * Install the software in the package directory defined by $PKG * Create the standard Slackware Software Documentation directory in the package * Copy the standard documentation. The next section is the packaging part: package() { cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : \ | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : \ | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "current ar archive" | cut -f 1 -d : | \ xargs strip --strip-debug 2> /dev/null chown -R root:root usr/bin gzip -p $PKG/usr/man/man*/* mkdir $PKG/install cp $START/slack-desc $PKG/install/slack-desc cd $PKG makepkg -l y -c n $START/$PKGNAME-$VERSION-$ARCH-1.tgz } * We change to the package directory * Strip executables and libraries in order to decrease size. * As a Slackware standard, we change the ownership of the executables to root:root (to be done for every bin/ and sbin/ directory) * We compress the manpages * Create install/ and copy the slack-desc file from the start directory * Finally, change back to the package folder and create the package tarball. In this example, the slack-desc and some patch files are distributed with the SlackBuild. This also makes it easier to ship the build script with patches that might be required for the software to work on Slackware (patch to remove PAM stuff). The slack-desc file format is described here: [http://www.linuxpackages.net/howto.php?page=slack-desc&title=Slackware+Desc+Files LinuxPackages.net] Additional files: Some people use slapt-get (like me). slapt-get supports additional features such as * Dependencies * Conflicts * Suggestions Not everyone wants those features, so building a package with those files will not interfere with the normal pkgtools process. For more info on these optional files, go here: [http://www.linuxpackages.net/howto.php?page=perfect-package&title=Perfect+Package#Optional LinuxPackages.net] If you decide to use those files, you will then have to repeat these lines: cp $START/slack-desc $PKG/install/slack-desc for slack-required, slack-conflicts, and slack-suggests. ---- See also [[SlackBuild_Scripts]] and [[Writing A SlackBuild Script]] ---- 00c1d139fe473abbcd7fd5f55290127ea0189736 Permissions and Umasks 0 30 541 39 2011-12-09T10:19:48Z Merge-delete 261 wikitext text/x-wiki ==Normal Permissions== On *nix-like systems, traditionally eery file has an owner, an assigned group, and a list of permissions (although POSIX Access Control Lists are getting more popular). You can change the owner of a file with the "chown" command: : <code>fred@linux:~> chown someUser foo</code> You can change the group of a file with the "chgrp" command: : <code>fred@linux:~> chgrp someGroup foo</code> Alternatively, you can do both at once: : fred@linux:~> <code>chown someUser.someGroup foo</code> or: : fred@linux:~> <code>chown someUser:someGroup foo</code> For every file, you can set the following for the User, Group, and Others: r - can read w - can write x - can execute These are set with the "chmod" command: : fred@linux:~> <code>chmod u=rwx,g=rx,o=r foo</code> : fred@linux:~> <code>ls -l foo</code> : -rwxr-xr-- 1 fred users 0 2004-10-26 11:38 foo You don't need to set all the permissions - you can just modify them, for example, to make a file executable: : fred@linux:~> <code>chmod +x foo</code> You can also change the permissions just for either the User, Group, or Others: : fred@linux:~> <code>chmod o-x foo</code> ==Octal Permissions== You can also specify permissions with a number. To find out which numbers, add up the numbers from this table: r w x 4 2 1 For example, rwxr-xr-- would be: U G O 4 4 4 +2 +0 +0 +1 +1 +0 =7 =5 =4 So to give a file rwxr-xr-- permissions: : fred@linux:~> <code>chmod 754 foo</code> ==Umasks== umasks define which permissions can not be set (in octal). For example, the default umask on slackware is 0022: : fred@laptop:~$ <code>umask</code> : 0022 Ignoring the first digit, this means that the owner can do anything, but group and others are unable to write (2 == w). A more secure umask (possibly more suitable for your ~/) is 0077, meaning that group and others have no access to your files. ==More Umask== The following is based on [[User:Sandman1|Sandman1]]'s Umask tutorial. Well first this is a pretty boring topic to write about, So im going to get right to the point. When you set a umask you set what permission NOT to set. So when you create a file it uses the umask to set the file permissions. All of this might not make sense now but it will later. Now type: : <code>umask</code> Now on slackware you will get "0022", First ignore the first 0. Now we have 022. The first 0 makes sure the owner has ALL the permissions of a file. You can tell that becuase you have no permissions you want to turn off. Now the next two numbers you have a 2 for. The 2 indicates that you NEVER want to set write permissions. Now that method above of trying to find a umask is a bit confusing. All you do is set the number what you DON'T want the user to have. Now there is an easier way of finding out a umask. You can subtract the permission from 777. Example: 777 - 750 = 027 That is the umask of the 750 permission. Now you may be asking yourself what is this usefull for. Well you can set the umask by typing "umask 027" in bash and when you create a file/directory it goes by umask 027 instead of the 0022. Now another reason for setting a umask is becuase you want to access a filesystem such as NTFS,VFAT,Samba,etc as a regular user. You can set the umask and allow regular users to write to the filesytem. It is really easy, in the fstab all you add is "umask=027" and remount the filesystem. See [[Windows_Partitions]] for more information (and a potentially better option than setting umask options). [[Category:Tutorials]] ef0ef98cd3784fec7378d34ef36947f6034d57f9 568 541 2011-12-09T14:11:36Z Rworkman 13 Reverted edits by [[Special:Contributions/Esmapebb|Esmapebb]] ([[User talk:Esmapebb|talk]]) to last revision by [[User:Erik|Erik]] wikitext text/x-wiki ==Normal Permissions== On *nix-like systems, traditionally every file has an owner, an assigned group, and a list of permissions (although POSIX Access Control Lists are getting more popular). You can change the owner of a file with the "chown" command: : <code>fred@linux:~> chown someUser foo</code> You can change the group of a file with the "chgrp" command: : <code>fred@linux:~> chgrp someGroup foo</code> Alternatively, you can do both at once: : fred@linux:~> <code>chown someUser.someGroup foo</code> or: : fred@linux:~> <code>chown someUser:someGroup foo</code> For every file, you can set the following for the User, Group, and Others: r - can read w - can write x - can execute These are set with the "chmod" command: : fred@linux:~> <code>chmod u=rwx,g=rx,o=r foo</code> : fred@linux:~> <code>ls -l foo</code> : -rwxr-xr-- 1 fred users 0 2004-10-26 11:38 foo You don't need to set all the permissions - you can just modify them, for example, to make a file executable: : fred@linux:~> <code>chmod +x foo</code> You can also change the permissions just for either the User, Group, or Others: : fred@linux:~> <code>chmod o-x foo</code> ==Octal Permissions== You can also specify permissions with a number. To find out which numbers, add up the numbers from this table: r w x 4 2 1 For example, rwxr-xr-- would be: U G O 4 4 4 +2 +0 +0 +1 +1 +0 =7 =5 =4 So to give a file rwxr-xr-- permissions: : fred@linux:~> <code>chmod 754 foo</code> ==Umasks== umasks define which permissions can not be set (in octal). For example, the default umask on slackware is 0022: : fred@laptop:~$ <code>umask</code> : 0022 Ignoring the first digit, this means that the owner can do anything, but group and others are unable to write (2 == w). A more secure umask (possibly more suitable for your ~/) is 0077, meaning that group and others have no access to your files. ==More Umask== The following is based on [[User:Sandman1|Sandman1]]'s Umask tutorial. Well first this is a pretty boring topic to write about, So im going to get right to the point. When you set a umask you set what permission NOT to set. So when you create a file it uses the umask to set the file permissions. All of this might not make sense now but it will later. Now type: : <code>umask</code> Now on slackware you will get "0022", First ignore the first 0. Now we have 022. The first 0 makes sure the owner has ALL the permissions of a file. You can tell that becuase you have no permissions you want to turn off. Now the next two numbers you have a 2 for. The 2 indicates that you NEVER want to set write permissions. Now that method above of trying to find a umask is a bit confusing. All you do is set the number what you DON'T want the user to have. Now there is an easier way of finding out a umask. You can subtract the permission from 777. Example: 777 - 750 = 027 That is the umask of the 750 permission. Now you may be asking yourself what is this usefull for. Well you can set the umask by typing "umask 027" in bash and when you create a file/directory it goes by umask 027 instead of the 0022. Now another reason for setting a umask is becuase you want to access a filesystem such as NTFS,VFAT,Samba,etc as a regular user. You can set the umask and allow regular users to write to the filesytem. It is really easy, in the fstab all you add is "umask=027" and remount the filesystem. See [[Windows_Partitions]] for more information (and a potentially better option than setting umask options). [[Category:Tutorials]] a733e385a9bde5877ec30fda985673302ca6c137 Kernel26Compilation 0 100 542 122 2011-12-09T10:20:18Z Merge-delete 261 wikitext text/x-wiki How to build a 2.6.x Kernel on Slackware Note: Maybe this replaces the 2.6 part of the kernel compile tutorial already here. ==Warning!== If you work on your kernel and do something wrong you may destroy your system in a way you have to reinstall it. All actions on your own risk! Noone assures that all actions described here are 100% right and work in any case. We are not responsible for damages caused by following this tutorial! ==Prerequisites== * Get the kernel sources you want from ftp://ftp.de.kernel.org or from a mirror (http://www.kernel.org/mirrors/). * Make sure you are able toboot your Slackware original kernel after kernel update (You have to install 2.6.13 from "testing" to do this-slack12 uses 2.6.21.5 by default, no need to install it) image = /boot/vmlinuz-generic-2.6.13<br> root = /dev/ #Your root partition. Get this from another kernel entry or from original /etc/lilo.conf label = Backup read-only Now run "lilo" once as root * If you want to play safe you may now reboot and try if the kernel boots without errors. * Uncompress your kernel sources below /usr/src * The symlink /usr/src/linux has to point to the directory of the new kernel. For example: /usr/src/linux -> /usr/src/linux-2.6.14.4 ==Configure the kernel== * Change to the kernel directory. cd /usr/src/linux * Configure your kernel: ** From scratch, then you may choose from make config (You get prompted for all possible options) make menuconfig (You get a nice menu where you may navigate with cursor keys. Needs curses-5.x) make xconfig (You may configure in X, of course needs working X installation) make gconfig make qtconfig :* From old configuration: Copy the config file of the old kernel to ./.config. If you want to come from orignal Slackware kernel, then: cp /boot/config .config After that "make oldconfig" to configure new features (you may acceppt all questions with "Enter" to use the default values) and use "make menuconfig" (or any other of the above list) to change things if you like. Important! Be sure to compile the alsa modules (or you won't have sound). You have also to do this if you used "make oldconfig" (for example using "make menuconfig") as the original kernel is compiled without alsa. ==Compile and install kernel== * The real compiling can start: make (Now, depending on your computer, you may go drinking some coffee, watch a movie or go on your balcony to smoke one ;-) ) If this finished without errors (we assume this) then your kernel and your kernel modules should be compiled. * Remove symlinks. If you still run your original slackware kernel, then "vmlinuz" and "System.map" are Symlinks to the kernel files. To get sure that we don't override this files, we delete the symlinks rm /boot/vmlinuz /boot/System.map * Install the kernel Install the kernel modules with:<br> make modules_install and the kernel with:<br> make install * If all steps have been done successful you may now use your new (self-made) kernel. ==Troubleshooting== * Help, the kernel doesn't work! Choose your backup kernel on lilo, check your kernel configuration and recompile. * Choose your backup kernel sounds easy, but... Now you know why you should keep a running kernel before you install a new one. Either your system is as usable as you are able to check the kernel configuration or you may boot from your slackware setup CD, mount your root partition to /mnt, chroot /mnt and recompile your kernel from there or install slackware packages of a running kernel. [http://www.slackforum.de/wiki/Kernel26Kompilieren german version] [[Category:Tutorials]] 4201446b0d6e1c13738ea756b7691eeb593ad30a 552 542 2011-12-09T10:29:51Z Merge-delete 261 wikitext text/x-wiki How to build a 2.6.x Kernel on Slackware == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> Note: Maybe this replaces the 2.6 part of the kernel compile tutorial already here. ==Warning!== If you work on your kernel and do something wrong you may destroy your system in a way you have to reinstall it. All actions on your own risk! Noone assures that all actions described here are 100% right and work in any case. We are not responsible for damages caused by following this tutorial! ==Prerequisites== * Get the kernel sources you want from ftp://ftp.de.kernel.org or from a mirror (http://www.kernel.org/mirrors/). * Make sure you are able toboot your Slackware original kernel after kernel update (You have to install 2.6.13 from "testing" to do this-slack12 uses 2.6.21.5 by default, no need to install it) image = /boot/vmlinuz-generic-2.6.13<br> root = /dev/ #Your root partition. Get this from another kernel entry or from original /etc/lilo.conf label = Backup read-only Now run "lilo" once as root * If you want to play safe you may now reboot and try if the kernel boots without errors. * Uncompress your kernel sources below /usr/src * The symlink /usr/src/linux has to point to the directory of the new kernel. For example: /usr/src/linux -> /usr/src/linux-2.6.14.4 ==Configure the kernel== * Change to the kernel directory. cd /usr/src/linux * Configure your kernel: ** From scratch, then you may choose from make config (You get prompted for all possible options) make menuconfig (You get a nice menu where you may navigate with cursor keys. Needs curses-5.x) make xconfig (You may configure in X, of course needs working X installation) make gconfig make qtconfig :* From old configuration: Copy the config file of the old kernel to ./.config. If you want to come from orignal Slackware kernel, then: cp /boot/config .config After that "make oldconfig" to configure new features (you may acceppt all questions with "Enter" to use the default values) and use "make menuconfig" (or any other of the above list) to change things if you like. Important! Be sure to compile the alsa modules (or you won't have sound). You have also to do this if you used "make oldconfig" (for example using "make menuconfig") as the original kernel is compiled without alsa. ==Compile and install kernel== * The real compiling can start: make (Now, depending on your computer, you may go drinking some coffee, watch a movie or go on your balcony to smoke one ;-) ) If this finished without errors (we assume this) then your kernel and your kernel modules should be compiled. * Remove symlinks. If you still run your original slackware kernel, then "vmlinuz" and "System.map" are Symlinks to the kernel files. To get sure that we don't override this files, we delete the symlinks rm /boot/vmlinuz /boot/System.map * Install the kernel Install the kernel modules with:<br> make modules_install and the kernel with:<br> make install * If all steps have been done successful you may now use your new (self-made) kernel. ==Troubleshooting== * Help, the kernel doesn't work! Choose your backup kernel on lilo, check your kernel configuration and recompile. * Choose your backup kernel sounds easy, but... Now you know why you should keep a running kernel before you install a new one. Either your system is as usable as you are able to check the kernel configuration or you may boot from your slackware setup CD, mount your root partition to /mnt, chroot /mnt and recompile your kernel from there or install slackware packages of a running kernel. [http://www.slackforum.de/wiki/Kernel26Kompilieren german version] [[Category:Tutorials]] bdaec4956d9d6134d9f24b26749c32f60c0e7aa0 569 552 2011-12-09T14:12:07Z Rworkman 13 Reverted edits by [[Special:Contributions/Esmapebb|Esmapebb]] ([[User talk:Esmapebb|talk]]) to last revision by [[User:Erik|Erik]] wikitext text/x-wiki How to build a 2.6.x Kernel on Slackware Note: Maybe this replaces the 2.6 part of the kernel compile tutorial already here. ==Warning!== If you work on your kernel and do something wrong you may destroy your system in a way you have to reinstall it. All actions on your own risk! Noone assures that all actions described here are 100% right and work in any case. We are not responsible for damages caused by following this tutorial! ==Prerequisites== * Get the kernel sources you want from ftp://ftp.de.kernel.org or from a mirror (http://www.kernel.org/mirrors/). * Make sure you are able to boot your Slackware original kernel after kernel update (You have to install 2.6.13 from "testing" to do this-slack12 uses 2.6.21.5 by default, no need to install it) image = /boot/vmlinuz-generic-2.6.13<br> root = /dev/ #Your root partition. Get this from another kernel entry or from original /etc/lilo.conf label = Backup read-only Now run "lilo" once as root * If you want to play safe you may now reboot and try if the kernel boots without errors. * Uncompress your kernel sources below /usr/src * The symlink /usr/src/linux has to point to the directory of the new kernel. For example: /usr/src/linux -> /usr/src/linux-2.6.14.4 ==Configure the kernel== * Change to the kernel directory. cd /usr/src/linux * Configure your kernel: ** From scratch, then you may choose from make config (You get prompted for all possible options) make menuconfig (You get a nice menu where you may navigate with cursor keys. Needs curses-5.x) make xconfig (You may configure in X, of course needs working X installation) make gconfig make qtconfig :* From old configuration: Copy the config file of the old kernel to ./.config. If you want to come from orignal Slackware kernel, then: cp /boot/config .config After that "make oldconfig" to configure new features (you may acceppt all questions with "Enter" to use the default values) and use "make menuconfig" (or any other of the above list) to change things if you like. Important! Be sure to compile the alsa modules (or you won't have sound). You have also to do this if you used "make oldconfig" (for example using "make menuconfig") as the original kernel is compiled without alsa. ==Compile and install kernel== * The real compiling can start: make (Now, depending on your computer, you may go drinking some coffee, watch a movie or go on your balcony to smoke one ;-) ) If this finished without errors (we assume this) then your kernel and your kernel modules should be compiled. * Remove symlinks. If you still run your original slackware kernel, then "vmlinuz" and "System.map" are Symlinks to the kernel files. To get sure that we don't override this files, we delete the symlinks rm /boot/vmlinuz /boot/System.map * Install the kernel Install the kernel modules with:<br> make modules_install and the kernel with:<br> make install * If all steps have been done successful you may now use your new (self-made) kernel. ==Troubleshooting== * Help, the kernel doesn't work! Choose your backup kernel on lilo, check your kernel configuration and recompile. * Choose your backup kernel sounds easy, but... Now you know why you should keep a running kernel before you install a new one. Either your system is as usable as you are able to check the kernel configuration or you may boot from your slackware setup CD, mount your root partition to /mnt, chroot /mnt and recompile your kernel from there or install slackware packages of a running kernel. [http://www.slackforum.de/wiki/Kernel26Kompilieren german version] [[Category:Tutorials]] fc9ff4331ec429c4ad75c9cd1fb6a859a3a7abb6 Writing A SlackBuild Script 0 16 543 273 2011-12-09T10:24:32Z Merge-delete 261 wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like linuxpackages.net, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/latex2html-2002-2-1.tar.gz # 05.02.2005 Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar -xzf latex2html-2002-2-1.tar.gz || exit 1 = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt <span class="plainlinks">[http://buyphentermine.herbalweightlossaid.com/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">Phen375</span>] applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the <span class="plainlinks">[http://www.performer5pills.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">performer 5</span>] developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move <span class="plainlinks">[http://weightlossproductreviews.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">slimming reviews</span>] them to their correct location within the package directory <span class="plainlinks">[http://www.hghadvancedreview.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">HGH Advanced</span>] tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include <span class="plainlinks">[http://www.clearskinmaxreview.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">clear skin max</span>] instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit <span class="plainlinks">[http://www.hoodiapill.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">unique hoodia</span>] easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the <span class="plainlinks">[http://weightlossproductreviews.info/?page_id=268 <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">slim weight patch</span>] command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one <span class="plainlinks">[http://www.teethwhitenerguide.com/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">teeth whitener reviews</span>] being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the <span class="plainlinks">[http://www.phen375reviewed.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">phen375 fat burner</span>] package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because <span class="plainlinks">[http://www.herbalweightlossaid.com/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">slimming pills</span>] developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure <span class="plainlinks">[http://www.capsiplexreview.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">capsiplex</span>] script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the <span class="plainlinks">[http://proactolpluspills.com/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">proactol plus</span>] scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ ;* http://www.slackbuilds.net/slackbuilds/ ;* http://slackbuild.strangeworlds.co.uk/ ;* http://www2.linuxpackages.net/packages/SlackBuilds/ ;* http://www.selkfoster.com.ar/downloads/slackbuilds/ ;* http://slack.sarava.org/slackbuilds/ 0d6ebc1f06a3b35aa77cf613b0fb096651ff3e07 553 543 2011-12-09T10:31:03Z Merge-delete 261 wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like linuxpackages.net, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to instll the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/latex2html-2002-2-1.tar.gz # 05.02.2005 Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar -xzf latex2html-2002-2-1.tar.gz || exit 1 = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt <span class="plainlinks">[http://buyphentermine.herbalweightlossaid.com/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">Phen375</span>] applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the <span class="plainlinks">[http://www.performer5pills.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">performer 5</span>] developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move <span class="plainlinks">[http://weightlossproductreviews.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">slimming reviews</span>] them to their correct location within the package directory <span class="plainlinks">[http://www.hghadvancedreview.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">HGH Advanced</span>] tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include <span class="plainlinks">[http://www.clearskinmaxreview.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">clear skin max</span>] instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit <span class="plainlinks">[http://www.hoodiapill.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">unique hoodia</span>] easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the <span class="plainlinks">[http://weightlossproductreviews.info/?page_id=268 <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">slim weight patch</span>] command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one <span class="plainlinks">[http://www.teethwhitenerguide.com/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">teeth whitener reviews</span>] being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the <span class="plainlinks">[http://www.phen375reviewed.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">phen375 fat burner</span>] package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because <span class="plainlinks">[http://www.herbalweightlossaid.com/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">slimming pills</span>] developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure <span class="plainlinks">[http://www.capsiplexreview.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">capsiplex</span>] script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the <span class="plainlinks">[http://proactolpluspills.com/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">proactol plus</span>] scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ ;* http://www.slackbuilds.net/slackbuilds/ ;* http://slackbuild.strangeworlds.co.uk/ ;* http://www2.linuxpackages.net/packages/SlackBuilds/ ;* http://www.selkfoster.com.ar/downloads/slackbuilds/ ;* http://slack.sarava.org/slackbuilds/ 12c4fa324bfba7c9d5982a42183053ab55d44edc 556 553 2011-12-09T10:32:00Z Merge-delete 261 wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like linuxpackages.net, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to instll the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/latex2html-2002-2-1.tar.gz # 05.02.2005 Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar -xzf latex2html-2002-2-1.tar.gz || exit 1 = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt <span class="plainlinks">[http://buyphentermine.herbalweightlossaid.com/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">Phen375</span>] applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the <span class="plainlinks">[http://www.performer5pills.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">performer 5</span>] developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move <span class="plainlinks">[http://weightlossproductreviews.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">slimming reviews</span>] them to their correct location within the package directory <span class="plainlinks">[http://www.hghadvancedreview.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">HGH Advanced</span>] tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include <span class="plainlinks">[http://www.clearskinmaxreview.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">clear skin max</span>] instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit <span class="plainlinks">[http://www.hoodiapill.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">unique hoodia</span>] easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the <span class="plainlinks">[http://weightlossproductreviews.info/?page_id=268 <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">slim weight patch</span>] command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one <span class="plainlinks">[http://www.teethwhitenerguide.com/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">teeth whitener reviews</span>] being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the <span class="plainlinks">[http://www.phen375reviewed.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">phen375 fat burner</span>] package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because <span class="plainlinks">[http://www.herbalweightlossaid.com/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">slimming pills</span>] developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure <span class="plainlinks">[http://www.capsiplexreview.info/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">capsiplex</span>] script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the <span class="plainlinks">[http://proactolpluspills.com/ <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">proactol plus</span>] scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ ;* http://www.slackbuilds.net/slackbuilds/ ;* http://slackbuild.strangeworlds.co.uk/ ;* http://www2.linuxpackages.net/packages/SlackBuilds/ ;* http://www.selkfoster.com.ar/downloads/slackbuilds/ ;* http://slack.sarava.org/slackbuilds/ fab0378eea24dc2ea55402294ce0d56e441b1fa3 573 556 2011-12-09T14:13:27Z Rworkman 13 Reverted edits by [[Special:Contributions/Esmapebb|Esmapebb]] ([[User talk:Esmapebb|talk]]) to last revision by [[User:SiegeX|SiegeX]] wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like linuxpackages.net, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/latex2html-2002-2-1.tar.gz # 05.02.2005 Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar -xzf latex2html-2002-2-1.tar.gz || exit 1 = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ ;* http://www.slackbuilds.net/slackbuilds/ ;* http://slackbuild.strangeworlds.co.uk/ ;* http://www2.linuxpackages.net/packages/SlackBuilds/ ;* http://www.selkfoster.com.ar/downloads/slackbuilds/ ;* http://slack.sarava.org/slackbuilds/ 292b77163684b3b1836f33a1053ee77516b47303 Windows Partitions 0 32 544 49 2011-12-09T10:25:36Z Merge-delete 261 wikitext text/x-wiki One of the frequent questions on ##slackware is something along the lines of "How can I allow normal users to access my Windows partition?" There are *at least* two different ways of doing this. For a FAT partition, you *could* add umask=0000 to /etc/fstab's options, but I personally don't recommend doing that. It's *your* computer, so you make the call, but I would do something along these lines: 1. If you want *every* user to be able to read and write to the partition, then you can add dmask=0000 and fmask=0111 to /etc/fstab's options and be done with it - problem solved. /dev/hda1 /mnt/win98 vfat rw,dmask=0000,fmask=0111 0 0 The reason for dmask/fmask as opposed to umask is quite obvious (though I hadn't thought about it until elohim on ##slackware pointed it out): The FAT and NTFS file systems don't "understand" the executable (-x) bit, so it's automatically present on every file in such a filesystem. There's no need for normal files to be executable (and it can indeed be a security risk), so we use fmask to turn off those permissions. 2. If you only want some users to be able to read and write to the partition, but you want *every* user to have read access, then you'll want something along these lines. First, create a special group called "windows" (change the name if you wish) by adding it to /etc/group using your favorite editor and add to this group the users you want to have write access. nogroup:x:99: users:x:100: console:x:101: windows:x:102:user1,user2,user3 Next, edit your /etc/fstab line for that partition and specify that it be mounted with group ownership of the "windows" group, and that write access be removed from others. /dev/hda1 /mnt/win98 vfat rw,gid=102,dmask=0002,fmask=0113 0 0 An NTFS partition will be mounted read-only, so you won't have write access for anyone, but the central idea is the same. If you don't want everyone else to even have read access to the partition, you can easily do that with the above fstab line modified a bit: /dev/hda1 /mnt/winXP ntfs ro,gid=102,dmask=0227,fmask=0337 0 0 If you prefer write access to the partition, then you can use ntfs-3g instead and something like this: All users can read the partition; only members of gid 102 can write: /dev/hda1 /mnt/win98 ntfs-3g rw,gid=102,dmask=0002,fmask=0113 0 0 Users of gid can read and write; nobody else can do anything: /dev/hda1 /mnt/winXP ntfs-3g rw,gid=102,dmask=0007,fmask=0117 0 0 For more information, see the [[Permissions and Umasks]] and [[Fstab]] pages. --rworkman (thanks to Erik for the pointers about dmask and fmask) [[Category:Tutorials]] 58ec1677032f776070c038326b982fbb4f268dcd 551 544 2011-12-09T10:29:35Z Merge-delete 261 wikitext text/x-wiki One of the frequent questions on ##slackware is something along the lines of "How can I allow normal users to access my Windows partition?" There are *at least* two different ways of doing this. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> For a FAT partition, you *could* add umask=0000 to /etc/fstab's options, but I personally don't recommend doing that. It's *your* computer, so you make the call, but I would do something along these lines: 1. If you want *every* user to be able to read and write to the partition, then you can add dmask=0000 and fmask=0111 to /etc/fstab's options and be done with it - problem solved. /dev/hda1 /mnt/win98 vfat rw,dmask=0000,fmask=0111 0 0 The reason for dmask/fmask as opposed to umask is quite obvious (though I hadn't thought about it until elohim on ##slackware pointed it out): The FAT and NTFS file systems don't "understand" the executable (-x) bit, so it's automatically present on every file in such a filesystem. There's no need for normal files to be executable (and it can indeed be a security risk), so we use fmask to turn off those permissions. 2. If you only want some users to be able to read and write to the partition, but you want *every* user to have read access, then you'll want something along these lines. First, create a special group called "windows" (change the name if you wish) by adding it to /etc/group using your favorite editor and add to this group the users you want to have write access. nogroup:x:99: users:x:100: console:x:101: windows:x:102:user1,user2,user3 Next, edit your /etc/fstab line for that partition and specify that it be mounted with group ownership of the "windows" group, and that write access be removed from others. /dev/hda1 /mnt/win98 vfat rw,gid=102,dmask=0002,fmask=0113 0 0 An NTFS partition will be mounted read-only, so you won't have write access for anyone, but the central idea is the same. If you don't want everyone else to even have read access to the partition, you can easily do that with the above fstab line modified a bit: /dev/hda1 /mnt/winXP ntfs ro,gid=102,dmask=0227,fmask=0337 0 0 If you prefer write access to the partition, then you can use ntfs-3g instead and something like this: All users can read the partition; only members of gid 102 can write: /dev/hda1 /mnt/win98 ntfs-3g rw,gid=102,dmask=0002,fmask=0113 0 0 Users of gid can read and write; nobody else can do anything: /dev/hda1 /mnt/winXP ntfs-3g rw,gid=102,dmask=0007,fmask=0117 0 0 For more information, see the [[Permissions and Umasks]] and [[Fstab]] pages. --rworkman (thanks to Erik for the pointers about dmask and fmask) [[Category:Tutorials]] d396b693150c808b09a4c8aa13bf654bdc3987a4 565 551 2011-12-09T14:06:35Z Rworkman 13 Reverted edits by [[Special:Contributions/Esmapebb|Esmapebb]] ([[User talk:Esmapebb|talk]]) to last revision by [[User:Rworkman|Rworkman]] wikitext text/x-wiki One of the frequent questions on ##slackware is something along the lines of "How can I allow normal users to access my Windows partition?" There are *at least* two different ways of doing this. For a FAT partition, you *could* add umask=0000 to /etc/fstab's options, but I personally don't recommend doing that. It's *your* computer, so you make the call, but I would do something along these lines: 1. If you want *every* user to be able to read and write to the partition, then you can add dmask=0000 and fmask=0111 to /etc/fstab's options and be done with it - problem solved. /dev/hda1 /mnt/win98 vfat rw,dmask=0000,fmask=0111 0 0 The reason for dmask/fmask as opposed to umask is quite obvious (though I hadn't thought about it until elohim on ##slackware pointed it out): The FAT and NTFS file systems don't "understand" the executable (-x) bit, so it's automatically present on every file in such a filesystem. There's no need for normal files to be executable (and it can indeed be a security risk), so we use fmask to turn off those permissions. 2. If you only want some users to be able to read and write to the partition, but you want *every* user to have read access, then you'll want something along these lines. First, create a special group called "windows" (change the name if you wish) by adding it to /etc/group using your favorite editor and add to this group the users you want to have write access. nogroup:x:99: users:x:100: console:x:101: windows:x:102:user1,user2,user3 Next, edit your /etc/fstab line for that partition and specify that it be mounted with group ownership of the "windows" group, and that write access be removed from others. /dev/hda1 /mnt/win98 vfat rw,gid=102,dmask=0002,fmask=0113 0 0 An NTFS partition will be mounted read-only, so you won't have write access for anyone, but the central idea is the same. If you don't want everyone else to even have read access to the partition, you can easily do that with the above fstab line modified a bit: /dev/hda1 /mnt/winXP ntfs ro,gid=102,dmask=0227,fmask=0337 0 0 If you prefer write access to the partition, then you can use ntfs-3g instead and something like this: All users can read the partition; only members of gid 102 can write: /dev/hda1 /mnt/win98 ntfs-3g rw,gid=102,dmask=0002,fmask=0113 0 0 Users of gid can read and write; nobody else can do anything: /dev/hda1 /mnt/winXP ntfs-3g rw,gid=102,dmask=0007,fmask=0117 0 0 For more information, see the [[Permissions and Umasks]] and [[Fstab]] pages. --rworkman (thanks to Erik for the pointers about dmask and fmask) [[Category:Tutorials]] 6e47018ae54c8b5bd08edc300568e012b97465bc SlackBuild Scripts 0 15 545 21 2011-12-09T10:26:18Z Merge-delete 261 wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://www.slackbuilds.net/slackbuilds/ ;* http://slackbuild.strangeworlds.co.uk/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] 649f5b756f2e317ac7d3fae80af90798f469263d 550 545 2011-12-09T10:29:16Z Merge-delete 261 wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://www.slackbuilds.net/slackbuilds/ ;* http://slackbuild.strangeworlds.co.uk/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] afbf10b93e33455d1f1aca5403f5aef68a81422a 572 550 2011-12-09T14:12:51Z Rworkman 13 Reverted edits by [[Special:Contributions/Esmapebb|Esmapebb]] ([[User talk:Esmapebb|talk]]) to last revision by [[User:Dugan|Dugan]] wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://www.slackbuilds.net/slackbuilds/ ;* http://slackbuild.strangeworlds.co.uk/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] 5790ce4393af0df4fbef5d93d3a01eb0177d0d87 Building A Package 0 23 546 484 2011-12-09T10:26:22Z Merge-delete 261 wikitext text/x-wiki [[Category:Tutorials]] = Intro = This is a rough outline for building Slackware packages. Some steps may not be neccessary, some steps might be missing. Use the discussion page for side-notes such as using slacktrack (when DESTDIR fails) and other utilities like checkinstall. == The good and decent way == Configure and compile the source as you usually do: ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc make Make a temporary destination directory available: mkdir /tmp/build Install into the temporary directory: make install DESTDIR=/tmp/build Now strip libs/bins within the temporary directory: strip -s /tmp/build/usr/lib/* /tmp/build/usr/bin/* You also want to make sure that anything in <tt>/usr/man</tt> is gzipped before you make the package: gzip -9 /tmp/build/usr/man/man?/*.? Create the <tt>install</tt> directory, this is where the description and install script will be stored: cd /tmp/build mkdir install cd install Using a text editor (or a [http://slack-desc.sourceforge.net/ tool]]), create a file called [[slack-desc]] and fill it with the following contents: |-----handy-ruler------------------------------------------------------| app: Application Name (Short/Brief description) app: app: Enter a description of the package you are building. app: All 11 "app:" lines must be present app: "app" needs to be your application name. app: The handy-ruler is there to help you, these lines should not exceed app: 79 characters. app: app: app: app: Create the actual package: cd /tmp/build makepkg ../app-version-arch-tag.tgz ''(The dashes should appear as above, so if the version has a subversion like say "1.0 RC2" make sure you use 1.0_RC2 not 1.0-RC2. The arch should be something like "i486" for example. The tag should consist of the build number and your initals, e.g. 1zb for Zaphod Beeblebrox's first build, 2zb for his second build, etc. Official slackware packages have only numbers as tags.)'' When prompted to recreate symbolic links, say <tt>yes</tt><br> When prompted to reset permissions, say <tt>no</tt> ''Note: Using '''makepkg -l y -c n''' will give you the same behaviour as answering yes to the symlinks question, and no to the permissions question.'' If all went well, you can now install the package. cd .. installpkg app-version-arch-tag.tgz == The "i don't have time" way == Fortunately, Slackware are pretty flexible too. If you don't mind much about what is the source (beware!) that you're compiling you can burn some stages and do something like this: ./configure --prefix=/usr make install DESTDIR=$(pwd)/PACKAGE cd $(pwd)/PACKAGE makepkg -l y -c n ../app-version-arch-tag.tgz installpkg ../app-version-arch-tag.tgz Of course, you will have a package without description, (probably) uncompressed man pages and unstripped binaries. ---- For more information, also see the pages on [[SlackBuild_Scripts]] and [[Different_Approach_To_Buildscripts]]. ---- 39903d84b86cbd2e2bbc01386ae95dfc262007bf 549 546 2011-12-09T10:29:03Z Merge-delete 261 wikitext text/x-wiki [[Category:Tutorials]] = Intro = This is a rough outline for building Slackware packages. Some steps may not be neccessary, some steps might be missing. Use the discussion page for side-notes such as using slacktrack (when DESTDIR fails) and other utilities like checkinstall. == The good and decent way == Configure and compile the source as you usually do: ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc make Make a temporary destination directory available: mkdir /tmp/build Install into the temporary directory: make install DESTDIR=/tmp/build Now strip libs/bins within the temporary directory: strip -s /tmp/build/usr/lib/* /tmp/build/usr/bin/* You also want to make sure that anything in <tt>/usr/man</tt> is gzipped before you make the package: gzip -9 /tmp/build/usr/man/man?/*.? Create the <tt>install</tt> directory, this is where the description and install script will be stored: cd /tmp/build mkdir install cd install Using a text editor (or a [http://slack-desc.sourceforge.net/ tool]]), create a file called [[slack-desc]] and fill it with the following contents: |-----handy-ruler------------------------------------------------------| app: Application Name (Short/Brief description) app: app: Enter a description of the package you are building. app: All 11 "app:" lines must be present app: "app" needs to be your application name. app: The handy-ruler is there to help you, these lines should not exceed app: 79 characters. app: app: app: app: Create the actual package: cd /tmp/build makepkg ../app-version-arch-tag.tgz ''(The dashes should appear as above, so if the version has a subversion like say "1.0 RC2" make sure you use 1.0_RC2 not 1.0-RC2. The arch should be something like "i486" for example. The tag should consist of the build number and your initals, e.g. 1zb for Zaphod Beeblebrox's first build, 2zb for his second build, etc. Official slackware packages have only numbers as tags.)'' When prompted to recreate symbolic links, say <tt>yes</tt><br> When prompted to reset permissions, say <tt>no</tt> ''Note: Using '''makepkg -l y -c n''' will give you the same behaviour as answering yes to the symlinks question, and no to the permissions question.'' If all went well, you can now install the package. cd .. installpkg app-version-arch-tag.tgz # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. == The "i don't have time" way == Fortunately, Slackware are pretty flexible too. If you don't mind much about what is the source (beware!) that you're compiling you can burn some stages and do something like this: ./configure --prefix=/usr make install DESTDIR=$(pwd)/PACKAGE cd $(pwd)/PACKAGE makepkg -l y -c n ../app-version-arch-tag.tgz installpkg ../app-version-arch-tag.tgz Of course, you will have a package without description, (probably) uncompressed man pages and unstripped binaries. ---- For more information, also see the pages on [[SlackBuild_Scripts]] and [[Different_Approach_To_Buildscripts]]. ---- cbe9192118233c27ab7ed67a4b168f68f2afc068 571 549 2011-12-09T14:12:49Z Rworkman 13 Reverted edits by [[Special:Contributions/Esmapebb|Esmapebb]] ([[User talk:Esmapebb|talk]]) to last revision by [[User:Vporpo|Vporpo]] wikitext text/x-wiki [[Category:Tutorials]] = Intro = This is a rough outline for building Slackware packages. Some steps may not be neccessary, some steps might be missing. Use the discussion page for side-notes such as using slacktrack (when DESTDIR fails) and other utilities like checkinstall. == The good and decent way == Configure and compile the source as you usually do: ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc make Make a temporary destination directory available: mkdir /tmp/build Install into the temporary directory: make install DESTDIR=/tmp/build Now strip libs/bins within the temporary directory: strip -s /tmp/build/usr/lib/* /tmp/build/usr/bin/* You also want to make sure that anything in <tt>/usr/man</tt> is gzipped before you make the package: gzip -9 /tmp/build/usr/man/man?/*.? Create the <tt>install</tt> directory, this is where the description and install script will be stored: cd /tmp/build mkdir install cd install Using a text editor (or a [http://slack-desc.sourceforge.net/ tool]]), create a file called [[slack-desc]] and fill it with the following contents: |-----handy-ruler------------------------------------------------------| app: Application Name (Short/Brief description) app: app: Enter a description of the package you are building. app: All 11 "app:" lines must be present app: "app" needs to be your application name. app: The handy-ruler is there to help you, these lines should not exceed app: 79 characters. app: app: app: app: Create the actual package: cd /tmp/build makepkg ../app-version-arch-tag.tgz ''(The dashes should appear as above, so if the version has a subversion like say "1.0 RC2" make sure you use 1.0_RC2 not 1.0-RC2. The arch should be something like "i486" for example. The tag should consist of the build number and your initals, e.g. 1zb for Zaphod Beeblebrox's first build, 2zb for his second build, etc. Official slackware packages have only numbers as tags.)'' When prompted to recreate symbolic links, say <tt>yes</tt><br> When prompted to reset permissions, say <tt>no</tt> ''Note: Using '''makepkg -l y -c n''' will give you the same behaviour as answering yes to the symlinks question, and no to the permissions question.'' If all went well, you can now install the package. cd .. installpkg app-version-arch-tag.tgz == The "i don't have time" way == Fortunately, Slackware are pretty flexible too. If you don't mind much about what is the source (beware!) that you're compiling you can burn some stages and do something like this: ./configure --prefix=/usr make install DESTDIR=$(pwd)/PACKAGE cd $(pwd)/PACKAGE makepkg -l y -c n ../app-version-arch-tag.tgz installpkg ../app-version-arch-tag.tgz Of course, you will have a package without description, (probably) uncompressed man pages and unstripped binaries. ---- For more information, also see the pages on [[SlackBuild_Scripts]] and [[Different_Approach_To_Buildscripts]]. ---- e243a2544503cedcd63bcf8a9d895edfb2280bb1 Slack-desc 0 17 547 483 2011-12-09T10:26:34Z Merge-delete 261 wikitext text/x-wiki =Overview= A proper slack-desc file should be written as follows: # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| appname: appname (Short description of the application) appname: <this line is generally left blank> appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname: The "appname" string must *exactly* match the application name portion of the Slackware package (for example, a package titled "gaim-1.5-i486-1.tgz" must have a slack-desc file with the <appname> string of "gaim: " rather than "Gaim: " or "GAIM: " or something else. The first line ''must'' show the application name followed by a short description (enclosed in parentheses). The "handy ruler" is meant to stop you at 79 characters, because the standard console is 80x25 and if you go beyond this the words will wrap. The space after the : is needed only when there is text after the : In the above example lines 9 & 11 should not have a space after the : =Tools= 1. There is a command-line tool that automates the creation of slack-desc files and helps you generate legal slack-desc files with minimal effort: http://slack-desc.sourceforge.net/ 2. A web-based tool is also available at: http://www.linuxpackages.net/slackcreator.php =See Also= man makepkg man pkgtool [[Category:Tutorials]] bb7ba0ff367e2392a8f47f503815f92f504ccee9 548 547 2011-12-09T10:28:05Z Merge-delete 261 wikitext text/x-wiki =Overview= A proper slack-desc file should be written as follows: # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| appname: appname (Short description of the application) appname: <this line is generally left blank> appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname: The "appname" string must *exactly* match the application name portion of the Slackware package (for example, a package titled "gaim-1.5-i486-1.tgz" must have a slack-desc file with the <appname> string of "gaim: " rather than "Gaim: " or "GAIM: " or something else. The first line ''must'' show the application name followed by a short description (enclosed in parentheses). The "handy ruler" is meant to stop you at 79 characters, because the standard console is 80x25 and if you go beyond this the words will wrap. The space after the : is needed only when there is text after the : In the above example lines 9 & 11 should not have a space after the : =Tools= 1. There is a command-line tool that automates the creation of slack-desc files and helps you generate legal slack-desc files with minimal effort: http://slack-desc.sourceforge.net/ 2. A web-based tool is also available at: http://www.linuxpackages.net/slackcreator.php =See Also= man makepkg man pkgtool [[Category:Tutorials]] 3a997d65392725949e816851bbdc78469fa7819c 570 548 2011-12-09T14:12:47Z Rworkman 13 Reverted edits by [[Special:Contributions/Esmapebb|Esmapebb]] ([[User talk:Esmapebb|talk]]) to last revision by [[User:Vporpo|Vporpo]] wikitext text/x-wiki =Overview= A proper slack-desc file should be written as follows: # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| appname: appname (Short description of the application) appname: <this line is generally left blank> appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname: The "appname" string must *exactly* match the application name portion of the Slackware package (for example, a package titled "gaim-1.5-i486-1.tgz" must have a slack-desc file with the <appname> string of "gaim: " rather than "Gaim: " or "GAIM: " or something else. The first line ''must'' show the application name followed by a short description (enclosed in parentheses). The "handy ruler" is meant to stop you at 79 characters, because the standard console is 80x25 and if you go beyond this the words will wrap. The space after the : is needed only when there is text after the : In the above example lines 9 & 11 should not have a space after the : =Tools= 1. There is a command-line tool that automates the creation of slack-desc files and helps you generate legal slack-desc files with minimal effort: http://slack-desc.sourceforge.net/ 2. A web-based tool is also available at: http://www.linuxpackages.net/slackcreator.php =See Also= man makepkg man pkgtool [[Category:Tutorials]] 242781af77d76a443f16591f75a566dad0467aa2 Packages 0 18 557 333 2011-12-09T10:33:23Z Merge-delete 261 wikitext text/x-wiki Slackware's package management system utilizes .tgz/.txz tarballs as its standard package format. These tarballs are tar.gz/tar.xz archives which contain Slackware built binaries, support files, a description file and installation script. Although they can be unzipped and untarred like a normal archive, they are (usually) binary-only packages intended to be installed through Slackware's provided package management tools. Information about a package is stored in two ways, in the filename of the package and a description file inside that package. ==Package Tools== See the respective manual pages for more information on each of the following commands. <code>pkgtool</code> <code>installpkg</code> <code>removepkg</code> <code>explodepkg</code> <code>makepkg</code> <code>upgradepkg</code> ==Slackware Package Layout== A typical Slackware package is laid out as such: ./ ./install/doinst.sh ./install/slack-desc [./usr/bin] [./usr/lib] [...] The install directory as well as the files within it will be deleted after the installation of the package to the root install directory (usually '/'). The install directory is not necessarily required for the most basic packages but allows additional functionality: [[slack-desc]] contains the package description, and [[doinst.sh]] contains post-installation instructions such as creating symbolic links. Every other file within the package is simply untarred (extracted) to the root directory. Most of these files are in standard locations. There are other special files within packages: '''usr/doc/<appname><version>''' All documentation included with the package (such as README, INSTALL, ChangeLog, docs/, etcetera) should be placed in this directory. Some of the files in this directory should be manually copied from the source archive, since Makefiles usually don't copy these documentation files to the package build tree. ==Making Slackware Packages== See [[Building A Package]] [[Category: Information]] c81c6372de1c2ed4fb1f5fc1bdaa0e62a8c07eae 577 557 2011-12-09T14:13:34Z Rworkman 13 Reverted edits by [[Special:Contributions/Esmapebb|Esmapebb]] ([[User talk:Esmapebb|talk]]) to last revision by [[User:Grissiom|Grissiom]] wikitext text/x-wiki Slackware's package management system utilizes .tgz/.txz tarballs as its standard package format. These tarballs are tar.gz/tar.xz archives which contain Slackware built binaries, support files, a description file and installation script. Although they can be unzipped and untarred like a normal archive, they are (usually) binary-only packages intended to be installed through Slackware's provided package management tools. Information about a package is stored in two ways, in the filename of the package and a description file inside that package. ==Package Tools== See the respective manual pages for more information on each of the following commands. <code>pkgtool</code> <code>installpkg</code> <code>removepkg</code> <code>explodepkg</code> <code>makepkg</code> <code>upgradepkg</code> ==Slackware Package Layout== A typical Slackware package is laid out as such: ./ ./install/doinst.sh ./install/slack-desc [./usr/bin] [./usr/lib] [...] The install directory as well as the files within it will be deleted after the installation of the package to the root install directory (usually '/'). The install directory is not necessarily required for the most basic packages but allows additional functionality: [[slack-desc]] contains the package description, and [[doinst.sh]] contains post-installation instructions such as creating symbolic links. Every other file within the package is simply untarred (extracted) to the root directory. Most of these files are in standard locations. There are other special files within packages: '''usr/doc/<appname><version>''' All documentation included with the package (such as README, INSTALL, ChangeLog, docs/, etcetera) should be placed in this directory. Some of the files in this directory should be manually copied from the source archive, since Makefiles usually don't copy these documentation files to the package build tree. ==Making Slackware Packages== See [[Building A Package]] [[Category: Information]] 29ecbc47c3624fd37e27efb0674fab3ddecae81e Mount Count 0 115 558 138 2011-12-09T10:33:27Z Merge-delete 261 wikitext text/x-wiki [[Category:Information]] A count of how many times a filesystem has been mounted. Used to determine whether a [[Forced Fuck]] should be executed. After a successful fsck (filesystem check), the mount count is reset to zero. When the mount count reaches (or exceeds) the [[Maximum Mount Count]], a Forced Fsck is executed during boot. 712badad7fc3e4ac6765d2f611ec6324fd366803 574 558 2011-12-09T14:13:29Z Rworkman 13 Reverted edits by [[Special:Contributions/Esmapebb|Esmapebb]] ([[User talk:Esmapebb|talk]]) to last revision by [[User:Erik|Erik]] wikitext text/x-wiki [[Category:Information]] A count of how many times a filesystem has been mounted. Used to determine whether a [[Forced Fsck]] should be executed. After a successful fsck (filesystem check), the mount count is reset to zero. When the mount count reaches (or exceeds) the [[Maximum Mount Count]], a Forced Fsck is executed during boot. c1016fca1d75994c5e6b497417bdb52c0f774c4a Log Correlation 0 106 559 129 2011-12-09T10:34:43Z Merge-delete 261 wikitext text/x-wiki [[Category:Tutorials]] '''Log Correlation''' I thought I'd talk about the importance of log correlation. For instance, you've found that someone is continually pinging your server. You want to see if your box is responding to the pings. Usually, you'll know right off, since most people know if their firewall was configured to block pings...I'm just using pings as a quick example, though. Log correlation usually consists of checking, for instance, web server logs against firewall logs, or Snort logs against firewall and web server logs. This helps you understand what suspicious activity is actually doing and if your server/workstation responded (and how it responded, if it did). I run Snort on a server, along with a web server, which is firewalled with IPTables. I have Snort report what it sees to a MySQL database, although it does record captures to a PCAP file locally. I also run Modsecurity, an application firewall that is designed to sniff and possibly block traffic going to/from web servers, mainly Apache. So, I've a ton of logs that I can correlate: Snort, Apache, IPTables, and Modsecurity logs. We'll pick something easy. In fact, I'll fabricate some logs by generating some false alerts. I'll use 'wget', to visit my website. Keep in mind that what you see below gives you the advantage...you know what you're doing and looking for when we soon check the logs. This won't be the case when some stranger or worm hits your firewall or web server (or any other application server). -bash-2.05b$ wget wigglit.ath.cx/root.exe --23:24:05-- http://wigglit.ath.cx/root.exe => `root.exe' Resolving wigglit.ath.cx... 66.160.141.30 Connecting to wigglit.ath.cx|66.160.141.30|:80... connected. HTTP request sent, awaiting response... 404 Not Found 23:24:06 ERROR 404: Not Found. -bash-2.05b$ I used root.exe because there is an old vulnerability was was used to exploit flaws in IIS...the CodeRed worm of old. Now, let's check the web server's logs. I've tail'd my logs: root@starchild:/var/log/apache# tail -f -n 100 access_log 12.123.12.123 - - [15/Sep/2007:23:34:35 -0400] "GET /root.exe HTTP/1.0" 404 202 12.123.12.123 - - [15/Sep/2007:23:34:35 -0400] "GET /root.exe HTTP/1.0" 404 202 "-" "Wget/1.10.2" You see that the communcation was accepted. A 404 code, which means 'page not found', was generated. This is usually a good indication, as the server didn't respond favorably to the attack. Now, let us check the firewall logs. We already know that the firewall allowed the traffic, since the web server responded with a 404...if the traffic was being blocked, there would be no record of the attack in the logs, because the firewall would have intercepted the traffic before it reached the web server. We're checking the firewall logs just to be sure this guy hasn't done anything else that the web server didn't see: Sep 12 17:28:34 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=34557 DF PROTO=TCP SPT=46656 DPT=10083 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:28:44 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=18168 DF PROTO=TCP SPT=40091 DPT=449 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:28:44 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=27053 DF PROTO=TCP SPT=36295 DPT=5060 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:28:54 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=29291 DF PROTO=TCP SPT=47590 DPT=342 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:28:54 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=11788 DF PROTO=TCP SPT=43604 DPT=1519 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:04 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=17600 DF PROTO=TCP SPT=32783 DPT=577 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:04 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=51338 DF PROTO=TCP SPT=47879 DPT=18187 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:14 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=58520 DF PROTO=TCP SPT=41983 DPT=517 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:14 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=20255 DF PROTO=TCP SPT=53355 DPT=1986 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:24 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=28213 DF PROTO=TCP SPT=38543 DPT=978 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:24 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=10244 DF PROTO=TCP SPT=45624 DPT=11371 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:37 starchild kernel: ICMP-request: IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=28 TOS=0x00 PREC=0x00 TTL=42 ID=53002 PROTO=ICMP TYPE=8 CODE=0 ID=10683 SEQ=16615 Sep 15 23:21:08 starchild kernel: ICMP-request: IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=84 TOS=0x00 PREC=0x00 TTL=55 ID=40988 PROTO=ICMP TYPE=8 CODE=0 ID=614 SEQ=0 Quite a bit of stuff, huh? This looks to be a port scan! This is something that we didn't see in the Apache logs! Good thing we checked! Looks like this IP needs to be blocked with IPTables (which we won't do in this exercise). Sadly, nothing shows in the Modsecurity logs, but we've enough information already. What about Snort? Because I've PCAP files, the search becomes a bit more involved. I'll spare the intimate details, but this is what we see: [**] [1:1256:9] WEB-IIS CodeRed v2 root.exe access [**] [Classification: Web Application Attack] [Priority: 1] 09/15-23:34:35.708546 0:C:DB:F5:90:0 -> FE:FD:40:3E:E7:DC type:0x800 len:0xB0 12.123.12.123:52753 -> 66.160.141.30:80 TCP TTL:56 TOS:0x0 ID:51589 IpLen:20 DgmLen:162 DF ***AP*** Seq: 0xAF32BB68 Ack: 0x3F319F7A Win: 0xFFFF TcpLen: 32 TCP Options (3) => NOP NOP TS: 288652007 1521931210 [Xref => http://www.cert.org/advisories/CA-2001-19.html] 23:34:35.708546 00:0c:db:f5:90:00 > fe:fd:40:3e:e7:dc, ethertype IPv4 (0x0800), length 176: IP (tos 0x0, ttl 56, id 51589, offset 0, flags [DF], length: 162) 12.123.12.123.52753 > 66.160.141.30.80: P [tcp sum ok] 2939337576:2939337686(110) ack 1060216698 win 65535 0x0000: fefd 403e e7dc 000c dbf5 9000 0800 4500 ..@>..........E. 0x0010: 00a2 c985 4000 3806 56c0 47b2 0aa0 42a0 ....@.8.V.G...B. 0x0020: 8d1e ce11 0050 af32 bb68 3f31 9f7a 8018 .....P.2.h?1.z.. 0x0030: ffff e9c5 0000 0101 080a 1134 7ae7 5ab6 ...........4z.Z. 0x0040: d3ca 4745 5420 2f72 6f6f 742e 6578 6520 ..GET./root.exe. 0x0050: 4854 5450 2f31 2e30 0d0a 5573 6572 2d41 HTTP/1.0..User-A 0x0060: 6765 6e74 3a20 5767 6574 2f31 2e31 302e gent:.Wget/1.10. 0x0070: 320d 0a41 6363 6570 743a 202a 2f2a 0d0a 2..Accept:.*/*.. 0x0080: 486f 7374 3a20 7769 6767 6c69 742e 6174 Host:.wigglit.at 0x0090: 682e 6378 0d0a 436f 6e6e 6563 7469 6f6e h.cx..Connection 0x00a0: 3a20 4b65 6570 2d41 6c69 7665 0d0a 0d0a :.Keep-Alive.... The first is the Snort alert file...this is a fast alert, with minimal detail (no packet capture). The second section is the full alert, including packet capture. It is also garbled (due to the hex code and the fact that this blog has issues with formatting) Note that my logs show no response. Apparently, my Snort install doesn't have a 404 signature. Again, the fact that we can correlate helps me when my Snort install lacks the data that I may have needed. I was able to look at the Apache logs to see the 404 when my Snort logs didn't show the return traffic. Well, this concludes our chat about correlating existing logs. Note that any log files can be correlated. Correlation can also assist in tracking down network issues or issues with, for instance, a faulty Snort install (ahem). Although this discussion focused more on security, hopefully this helps someone understand their network or software architecture also. This page is also linked at [http://slackfiles.blogspot.com/2007/09/log-correlation.html my blog] --[[User:Unixfool|Ron]] 00:35, 16 September 2007 (EDT) 572db83e541280ceecf072b7e376f82d0cca81ac 576 559 2011-12-09T14:13:32Z Rworkman 13 Reverted edits by [[Special:Contributions/Esmapebb|Esmapebb]] ([[User talk:Esmapebb|talk]]) to last revision by [[User:Erik|Erik]] wikitext text/x-wiki [[Category:Tutorials]] '''Log Correlation''' I thought I'd talk about the importance of log correlation. For instance, you've found that someone is continually pinging your server. You want to see if your box is responding to the pings. Usually, you'll know right off, since most people know if their firewall was configured to block pings...I'm just using pings as a quick example, though. Log correlation usually consists of checking, for instance, web server logs against firewall logs, or Snort logs against firewall and web server logs. This helps you understand what suspicious activity is actually doing and if your server/workstation responded (and how it responded, if it did). I run Snort on a server, along with a web server, which is firewalled with IPTables. I have Snort report what it sees to a MySQL database, although it does record captures to a PCAP file locally. I also run Modsecurity, an application firewall that is designed to sniff and possibly block traffic going to/from web servers, mainly Apache. So, I've a ton of logs that I can correlate: Snort, Apache, IPTables, and Modsecurity logs. We'll pick something easy. In fact, I'll fabricate some logs by generating some false alerts. I'll use 'wget', to visit my website. Keep in mind that what you see below gives you the advantage...you know what you're doing and looking for when we soon check the logs. This won't be the case when some stranger or worm hits your firewall or web server (or any other application server). -bash-2.05b$ wget wigglit.ath.cx/root.exe --23:24:05-- http://wigglit.ath.cx/root.exe => `root.exe' Resolving wigglit.ath.cx... 66.160.141.30 Connecting to wigglit.ath.cx|66.160.141.30|:80... connected. HTTP request sent, awaiting response... 404 Not Found 23:24:06 ERROR 404: Not Found. -bash-2.05b$ I used root.exe because there is an old vulnerability was was used to exploit flaws in IIS...the CodeRed worm of old. Now, let's check the web server's logs. I've tail'd my logs: root@starchild:/var/log/apache# tail -f -n 100 access_log 12.123.12.123 - - [15/Sep/2007:23:34:35 -0400] "GET /root.exe HTTP/1.0" 404 202 12.123.12.123 - - [15/Sep/2007:23:34:35 -0400] "GET /root.exe HTTP/1.0" 404 202 "-" "Wget/1.10.2" You see that the communcation was accepted. A 404 code, which means 'page not found', was generated. This is usually a good indication, as the server didn't respond favorably to the attack. Now, let us check the firewall logs. We already know that the firewall allowed the traffic, since the web server responded with a 404...if the traffic was being blocked, there would be no record of the attack in the logs, because the firewall would have intercepted the traffic before it reached the web server. We're checking the firewall logs just to be sure this guy hasn't done anything else that the web server didn't see: Sep 12 17:28:34 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=34557 DF PROTO=TCP SPT=46656 DPT=10083 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:28:44 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=18168 DF PROTO=TCP SPT=40091 DPT=449 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:28:44 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=27053 DF PROTO=TCP SPT=36295 DPT=5060 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:28:54 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=29291 DF PROTO=TCP SPT=47590 DPT=342 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:28:54 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=11788 DF PROTO=TCP SPT=43604 DPT=1519 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:04 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=17600 DF PROTO=TCP SPT=32783 DPT=577 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:04 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=51338 DF PROTO=TCP SPT=47879 DPT=18187 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:14 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=58520 DF PROTO=TCP SPT=41983 DPT=517 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:14 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=20255 DF PROTO=TCP SPT=53355 DPT=1986 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:24 starchild kernel: Connection attempt (PRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=28213 DF PROTO=TCP SPT=38543 DPT=978 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:24 starchild kernel: Connection attempt (UNPRIV): IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=10244 DF PROTO=TCP SPT=45624 DPT=11371 WINDOW=5840 RES=0x00 SYN URGP=0 Sep 12 17:29:37 starchild kernel: ICMP-request: IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=28 TOS=0x00 PREC=0x00 TTL=42 ID=53002 PROTO=ICMP TYPE=8 CODE=0 ID=10683 SEQ=16615 Sep 15 23:21:08 starchild kernel: ICMP-request: IN=eth0 OUT= MAC=fe:fd:40:3e:e7:dc:00:0c:db:f5:90:00:08:00 SRC=12.123.12.123 DST=66.160.141.30 LEN=84 TOS=0x00 PREC=0x00 TTL=55 ID=40988 PROTO=ICMP TYPE=8 CODE=0 ID=614 SEQ=0 Quite a bit of stuff, huh? This looks to be a port scan! This is something that we didn't see in the Apache logs! Good thing we checked! Looks like this IP needs to be blocked with IPTables (which we won't do in this exercise). Sadly, nothing shows in the Modsecurity logs, but we've enough information already. What about Snort? Because I've PCAP files, the search becomes a bit more involved. I'll spare the intimate details, but this is what we see: [**] [1:1256:9] WEB-IIS CodeRed v2 root.exe access [**] [Classification: Web Application Attack] [Priority: 1] 09/15-23:34:35.708546 0:C:DB:F5:90:0 -> FE:FD:40:3E:E7:DC type:0x800 len:0xB0 12.123.12.123:52753 -> 66.160.141.30:80 TCP TTL:56 TOS:0x0 ID:51589 IpLen:20 DgmLen:162 DF ***AP*** Seq: 0xAF32BB68 Ack: 0x3F319F7A Win: 0xFFFF TcpLen: 32 TCP Options (3) => NOP NOP TS: 288652007 1521931210 [Xref => http://www.cert.org/advisories/CA-2001-19.html] 23:34:35.708546 00:0c:db:f5:90:00 > fe:fd:40:3e:e7:dc, ethertype IPv4 (0x0800), length 176: IP (tos 0x0, ttl 56, id 51589, offset 0, flags [DF], length: 162) 12.123.12.123.52753 > 66.160.141.30.80: P [tcp sum ok] 2939337576:2939337686(110) ack 1060216698 win 65535 0x0000: fefd 403e e7dc 000c dbf5 9000 0800 4500 ..@>..........E. 0x0010: 00a2 c985 4000 3806 56c0 47b2 0aa0 42a0 ....@.8.V.G...B. 0x0020: 8d1e ce11 0050 af32 bb68 3f31 9f7a 8018 .....P.2.h?1.z.. 0x0030: ffff e9c5 0000 0101 080a 1134 7ae7 5ab6 ...........4z.Z. 0x0040: d3ca 4745 5420 2f72 6f6f 742e 6578 6520 ..GET./root.exe. 0x0050: 4854 5450 2f31 2e30 0d0a 5573 6572 2d41 HTTP/1.0..User-A 0x0060: 6765 6e74 3a20 5767 6574 2f31 2e31 302e gent:.Wget/1.10. 0x0070: 320d 0a41 6363 6570 743a 202a 2f2a 0d0a 2..Accept:.*/*.. 0x0080: 486f 7374 3a20 7769 6767 6c69 742e 6174 Host:.wigglit.at 0x0090: 682e 6378 0d0a 436f 6e6e 6563 7469 6f6e h.cx..Connection 0x00a0: 3a20 4b65 6570 2d41 6c69 7665 0d0a 0d0a :.Keep-Alive.... The first is the Snort alert file...this is a fast alert, with minimal detail (no packet capture). The second section is the full alert, including packet capture. It is also garbled (due to the hex code and the fact that this blog has issues with formatting) Note that my logs show no response. Apparently, my Snort install doesn't have a 404 signature. Again, the fact that we can correlate helps me when my Snort install lacks the data that I may have needed. I was able to look at the Apache logs to see the 404 when my Snort logs didn't show the return traffic. Well, this concludes our chat about correlating existing logs. Note that any log files can be correlated. Correlation can also assist in tracking down network issues or issues with, for instance, a faulty Snort install (ahem). Although this discussion focused more on security, hopefully this helps someone understand their network or software architecture also. This page is also linked at [http://slackfiles.blogspot.com/2007/09/log-correlation.html my blog] --[[User:Unixfool|Ron]] 00:35, 16 September 2007 (EDT) 375bd6c95bb9e07c9a07b79854abb8e7ca10554d Apache-cgi 0 40 560 61 2011-12-09T10:34:48Z Merge-delete 261 wikitext text/x-wiki [[Category:Tips]] ==To enable a cgi directory for each user== In order to give each user their own cgi-bin directory, edit the: :Apache1 (Slackware pre-12.0): <code>/etc/httpd/httpd.conf</code> file<br> :Apache2 (Slackware 12.0+): <code>/etc/httpd/extra/httpd-users.conf</code> file<br> ::...and add: :<code><Directory /home/*/public_html/cgi-bin/></code> :<code>Options ExecCGI</code> :<code>SetHandler cgi-script</code> :<code></Directory></code> Then, presuming that UserDir is set to public_html, a cgi program example.cgi could be loaded from that directory as: ::<code>http&#58;//example.com/~rbowen/cgi-bin/example.cgi</code> ==To enable a cgi directory for each virtual host== In the Virtual Host section of your apache config file (<code>/etc/apache/httpd.conf</code>) add the <code>ScriptAlias</code> line below. :<code><VirtualHost *:80></code> :::<code>ServerName www.''MyDomain''.org</code> :::<code>DocumentRoot /home/''MyDomain''/public_html</code> :::<code>ErrorLog /var/log/''MyDomain''/error.log</code> :::<code><b>ScriptAlias /cgi-bin/ "/home/''MyDomain''/public_html/cgi-bin/"</b></code> :<code></VirtualHost></code> 03ff2d7ae405eea687cf7c094ecabb6abca989ed 575 560 2011-12-09T14:13:30Z Rworkman 13 Reverted edits by [[Special:Contributions/Esmapebb|Esmapebb]] ([[User talk:Esmapebb|talk]]) to last revision by [[User:Erik|Erik]] wikitext text/x-wiki [[Category:Tips]] ==To enable a cgi directory for each user== In order to give each user their own cgi-bin directory, edit the: :Apache1 (Slackware pre-12.0): <code>/etc/httpd/httpd.conf</code> file<br> :Apache2 (Slackware 12.0+): <code>/etc/httpd/extra/httpd-users.conf</code> file<br> ::...and add: :<code><Directory /home/*/public_html/cgi-bin/></code> :<code>Options ExecCGI</code> :<code>SetHandler cgi-script</code> :<code></Directory></code> Then, presuming that UserDir is set to public_html, a cgi program example.cgi could be loaded from that directory as: ::<code>http&#58;//example.com/~rbowen/cgi-bin/example.cgi</code> ==To enable a cgi directory for each virtual host== In the Virtual Host section of your apache config file (<code>/etc/apache/httpd.conf</code>) add the <code>ScriptAlias</code> line below. :<code><VirtualHost *:80></code> :::<code>ServerName www.''MyDomain''.org</code> :::<code>DocumentRoot /home/''MyDomain''/public_html</code> :::<code>ErrorLog /var/log/''MyDomain''/error.log</code> :::<code><b>ScriptAlias /cgi-bin/ "/home/''MyDomain''/public_html/cgi-bin/"</b></code> :<code></VirtualHost></code> f9fd21516915f636a94ec865ddb7fdfd624926f5 Kernel-packaging 0 213 561 400 2011-12-09T10:34:52Z Merge-delete 261 wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling pleae look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(sed "s#^kernel/##" modules.order) do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6-i686-1_tag.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009-2010 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source ./.config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi KARCH=$ARCH ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(sed "s#^kernel/##" $MODULELIST) do mkdir -p $MODDIR/$(dirname $i) install -m 644 -v $i $MODDIR/$(dirname $i) let nummods=$nummods+1 done mkdir -p $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) EOF cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules for $LOCALNAME-$VERSION $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME ksize=$(ls -l arch/x86/boot/bzImage | awk '{print $5}') cd $PKG PACKAGE=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION-$KARCH-$BUILD-$TAG.${PKGTYPE:-tgz} /sbin/makepkg -l y -c n $PACKAGE echo -ne '\e[01;34m' printf "$nummods Modules Built\n" printf "Kernel Size: $ksize\n" printf "Package Size: $(ls -l $PACKAGE | awk '{print $5}')\n\n" echo -ne '\e[m\017' Downloadable version: http://www.dawoodfall.net/slackbuilds/noversion/kernel/ = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) 7a1c99fcfc4091646e1db3fc62f4b274e00da198 563 561 2011-12-09T12:14:38Z Dive 19 /* Creating a Custom Package of Kernel and Modules */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.org/Kernel_Compilation Kernel_Compilation] [http://slackwiki.org/Kernel26Compilation Kernel26Compilation] [http://slackwiki.org/Kernel_Checklist Kernel_Checklist] == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(sed "s#^kernel/##" modules.order) do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6-i686-1_tag.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009-2010 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source ./.config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi KARCH=$ARCH ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(sed "s#^kernel/##" $MODULELIST) do mkdir -p $MODDIR/$(dirname $i) install -m 644 -v $i $MODDIR/$(dirname $i) let nummods=$nummods+1 done mkdir -p $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) EOF cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules for $LOCALNAME-$VERSION $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME ksize=$(ls -l arch/x86/boot/bzImage | awk '{print $5}') cd $PKG PACKAGE=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION-$KARCH-$BUILD-$TAG.${PKGTYPE:-tgz} /sbin/makepkg -l y -c n $PACKAGE echo -ne '\e[01;34m' printf "$nummods Modules Built\n" printf "Kernel Size: $ksize\n" printf "Package Size: $(ls -l $PACKAGE | awk '{print $5}')\n\n" echo -ne '\e[m\017' Downloadable version: http://www.dawoodfall.net/slackbuilds/noversion/kernel/ = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) b0ea2d79b51652fa2b81632457e25973fa068c69 564 563 2011-12-09T12:15:20Z Dive 19 /* Creating a Custom Package of Kernel and Modules */ wikitext text/x-wiki = Creating a Custom Package of Kernel and Modules = *Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options. For info on compiling please look at these pages: [http://slackwiki.com/Kernel_Compilation Kernel_Compilation] [http://slackwiki.com/Kernel26Compilation Kernel26Compilation] [http://slackwiki.com/Kernel_Checklist Kernel_Checklist] == Kernel Output Target Option == The usual way to make any sort of package is via the '''$DESTDIR''' variable. The kernel doesn't use this however, but it does have an '''O''' switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here, but see the discussion page about that. == Building == Copy your .config into the source directory and do make menuconfig (or whichever method you prefer.) You '''may''' need to do 'make mrproper' first, and perhaps 'make oldconfig'. make *Note: Do not use 'make install' or 'make modules_install', even with '''O''' switch, as this *will* install to /boot and /lib/modules. At this point everything we need is in the source directory. The file '''modules.order''' lists the modules to be installed and that we can use to help us make a package. == Installing Modules and Kernel to our Package Directory == Ok let's use '''/tmp/kernel-package''' for our package directory. Also let's assume a '''2.6.29.6''' kernel with '''jabberwok''' as local name. A little bash will copy our modules to it: for i in $(sed "s#^kernel/##" modules.order) do mkdir -p /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) install -m 644 -v $i /tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/$(dirname $i) done Now we need the kernel and associated files. mkdir /tmp/kernel-package/boot cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok And then the doinst.sh and slack-desc. mkdir /tmp/kernel-package/install doinst.sh: ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null fi ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf build ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build ) ( cd lib/modules/2.6.29.6-jabberwok ; rm -rf source ) ( cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source ) I'll leave you to figure out the slack-desc. It should be copied into the install/ directory and appname ought to be (going by this example) '''kernel-jabberwok'''. == Making the Package == cd /tmp/kernel-package /sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6-i686-1_tag.txz Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, '''explodepkg''' it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it. As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo. == A Little Automation == Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first): #!/bin/sh # Slackware build script for kernel and modules # # Copyright 2009-2010 David Woodfall <dave@dawoodfall.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Notes: # You should have a /usr/src/linux-$VERSION-$LOCALNAME of source or you will # have problems. # Do not omit setting localname in .config. source ./.config LOCALNAME=${LOCALNAME:-${CONFIG_LOCALVERSION/-/}} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi KARCH=$ARCH ARCH=x86 MODULELIST=modules.order PRGNAM=kernel VERSION=${VERSION:-2.6.29.6} BUILD=${BUILD:-1} TAG=${TAG:-_daw} OUTPUT=${TMP:-/tmp} PKG=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION MODDIR=$PKG/lib/modules/$VERSION-$LOCALNAME set -e rm -rf $PKG make for i in $(sed "s#^kernel/##" $MODULELIST) do mkdir -p $MODDIR/$(dirname $i) install -m 644 -v $i $MODDIR/$(dirname $i) let nummods=$nummods+1 done mkdir -p $PKG/install cat << EOF > $PKG/install/doinst.sh ## Taken from stock modules package if [ -x sbin/depmod ]; then chroot . /sbin/depmod -a $VERSION-$LOCALNAME > /dev/null 2> /dev/null fi ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf build ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME build ) ( cd lib/modules/$VERSION-$LOCALNAME ; rm -rf source ) ( cd lib/modules/$VERSION-$LOCALNAME ; ln -sf /usr/src/linux-$VERSION-$LOCALNAME source ) EOF cat << EOF > $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $PRGNAM-$LOCALNAME|-----handy-ruler------------------------------------------------------| $PRGNAM-$LOCALNAME: kernel and modules for $LOCALNAME-$VERSION $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: Jabberwokky type kernel! $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: $PRGNAM-$LOCALNAME: EOF mkdir -p $PKG/boot cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-$VERSION-$LOCALNAME cp System.map $PKG/boot/System.map-$VERSION-$LOCALNAME cp .config $PKG/boot/config-$VERSION-$LOCALNAME ksize=$(ls -l arch/x86/boot/bzImage | awk '{print $5}') cd $PKG PACKAGE=$OUTPUT/$PRGNAM-$LOCALNAME-$VERSION-$KARCH-$BUILD-$TAG.${PKGTYPE:-tgz} /sbin/makepkg -l y -c n $PACKAGE echo -ne '\e[01;34m' printf "$nummods Modules Built\n" printf "Kernel Size: $ksize\n" printf "Package Size: $(ls -l $PACKAGE | awk '{print $5}')\n\n" echo -ne '\e[m\017' Downloadable version: http://www.dawoodfall.net/slackbuilds/noversion/kernel/ = Conclusion = The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages but I'll let you figure out the details. At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project. --[[User:Dive|Dive]] 04:31, 11 March 2010 (UTC) f6663e1cd35e6dfaa2287d09ac93ee16fe5f434a NVIDIA-Prompted-Kernel-Compile 0 124 562 147 2011-12-09T10:35:06Z Merge-delete 261 wikitext text/x-wiki [[Category:Tutorials]] === nVidia Graphics Driver Installation & Kernel Recompile in Slackware 12.0 === ====Warning!==== ---- :Please do all this at your own risk. If you change your kernel and c ause any damage to your system, you and only you are responsible for it. By providing this tutorial I do not take any responsibility for any damages or losses to your system. This is a disclaimer! ==== Background Info & Rationale for Kernel Recompile ==== ---- :I recently bought a used ''Geforce N6200'' video card (nvidia chipset) to replace the ''ATI Radeon 9200SE'' that suddenly died on me. I ran Xorg configuration utility ''xorgconfig'' to set the new card up. Slackware 12.0 ships with a generic ''nv'' driver for nvidia cards, but it does not support graphics acceleration and/or direct rendering. That means no games and no graphic heavy websites. Fortunately, nvidia provides a Linux binary driver for your video card that will do direct rendering and 3D acceleration just fine, although the driver is closed-source. But hey, at least it works. :Assuming that you're running Slackware 12.0 and using huge generic kernel 2.6.21.5 or newer or the smp version of it, you are going to face some problems compiling the nvidia driver against that kernel. The nvidia installer utility compiles the binary driver to suit your kernel. In Slackware 12.0 the support for Riva framebuffer is enabled by default in the huge-2.6.21.5 and huge-2.6.21.5-smp kernels and it is a problem for the nvidia installer utility. As soon as it notes the riva support enabled in the kernel header files, it quits and the driver module compilation fails. Most people will experience this problem in Slackware 12.0. The solution is to disable riva framebuffer support from the kernel and recompile it. :At the end of this tutorial you will have a fresh kernel compiled for your system, the nvidia driver compiled against this kernel and installed as kernel module and 3D graphics acceleration as well as direct rendering enabled. So let's begin taking one thing at a time. ==== Back Up Current Kernel & Kernel Modules ==== ---- :It is important that you have a backup of your currently working kernel modules so if the new kernel fails, you would still be able to use the old kernel to boot the system. Let's play safe. Important: All steps in this tutorials are done as superuser. cd /lib/modules ls 2.6.21.5 2.6.21.5-smp :Above currently installed kernels on your system are listed. Rename the kernel you're using to something like ''kernel-name''.backup. If you do not know which kernel you're using, do the following. The output of it should list the kernel you're using. Once you find it out, rename it as follows. uname -a Linux 2.6.21.5 #1 Sun Mar 16 14:46:57 CDT 2008 i686 AMD Athlon(tm) AuthenticAMD GNU/Linux mv 2.6.21.5 2.6.21.5-backup ls 2.6.21.5-smp 2.6.21.5-backup ==== Kernel Configuration and Recompile ==== ---- :Now that we have a backup of our current kernel and its modules, its time to proceed with configuration and recompiling the kernel. Change to the kernel source directory and copy the current kernel config file to the kernel source directory cd /usr/src/linux cp /boot/config .config #Note that config in /boot has no dot before it, but when we copy it, we include a dot prefix. This step will copy your current configuration so we can use it as a reference for further steps. Now let's begin kernel configuration make menuconfig This should give you a nice ''ncurses'' style detailed graphical menu of kernel configuration. Select Device Drivers > Graphics Support > :Scroll down to ''Riva Framebuffer Support'' (not ''nvidia Riva Support'') and press space bar twice. First space bar press will change the <M> to <*> and second will change <*> to < > (blank). Now press ''exit'' three times. The menuconfig will ask you if you want to save the changes. Select ''Yes'' and quit. We have now removed Riva Framebuffer Support from kernel configuration, the culprit for failing nvidia driver module compilation. :It's time to compile the kernel. Do the following: make bzImage :This is a good time to take a break for any of these: Coffee / Tea / Cigarette / Quick run to the grocery store. In short, depending upon how fast your procesor is, this step will take anywhere between 15 minutes to an hour. If everything goes fine, it will compile a new kernel and install newly compiled modules in /lib/modules/. If you get errors, something went wrong and you'll need to get some help from kernel documentation or ask in ##slackware on IRC host ''freenode.net'' :Now that we have a kernel compiled, its time to compile and install kernel modules make modules && make modules_install :Again, this step will take some time. But it will be worth the wait. In the basic kernel, there is close to 1000 modules that need to be compiled. Once this step is finished and you did not get any errors, its time to make sure the kernel bzImage was created and the modules were installed to the appropriate location. pwd /usr/src/linux cd arch/i386/boot pwd /usr/src/linux/arch/i386/boot ls Makefile bootsect.S '''bzImage''' edd.S mtools.conf.in setup.S tools vmlinux.bin bootsect bootsect.o compressed install.sh setup setup.o video.S :bzImage is your newly compiled kernel without Riva framebuffer support. cd /lib/modules ls 2.6.21.5 2.6.21.5-smp 2.6.21.5-backup The first entry above is the location of your newly installed kernel modules. ==== Install New Kernel And Update lilo.conf ==== ---- :Time to install the new kernel and notify your boot loader of its existence. cd /usr/src/linux/arch/i386/boot cp bzImage /boot :Open your favorite text editor and add following lines to your boot loader (typically /etc/lilo.conf) cd /etc emacs -nw lilo.conf #Linux bootable partition config begins image = /boot/bzImage root = /dev/hda2 #or whatever partition your / is located on label = New-Kernel #You can name it whatever you want. Just don't name it the same as the old kernel #Linux bootable partition config ends :Save file, close it and run lilo so the new changes take effect. lilo Added *Linux Added *New-Kernel :Excellent! It's time to test the new kernel. When you reboot, lilo will now present you with two choices for kernel, use the New-Kernel and boot. If somehow it fails, you can always go back to the old kernel. Just rename the /lib/modules/2.6.21.5-backup as 2.6.21.5 and rename the new kernel modules as something else. You see how important it was for us to backup the kernel as well as kernel modules in the beginning? :Assuming that your new kernel booted just fine and you had a fully functional system back up, its time to get the nVidia graphics driver from nvidia.com and install it. The current incarnation of nVidia driver is version # 169.12. Either use your favorite browser to download the driver from http://www.nvidia.com/Download/index.aspx?lang=en-us or do the following: cd /tmp wget http://us.download.nvidia.com/XFree86/Linux-x86/169.12/NVIDIA-Linux-x86-169.12-pkg1.run Make the installer utility executable and execute it chmod 755 NVIDIA-Linux-x86-169.12-pkg1.run ls -la -rwxr-xr-x 1 user groupname 17636559 2008-03-17 13:06 NVIDIA-Linux-x86-169.12-pkg1.run Before we execute it, we need to exit the X server. telinit 3 #This changes runlevel to 3, shuts down the X server and drops you off at the terminal sh ./NVIDIA-Linux-x86-169.12-pkg1.run :This installer utility first tries to find a pre-compiled driver for your kernel which it would not find, then it tries to download it via ftp from nvidia servers which fails too, and finally it proceeds to compile the driver kernel module against your newly installed bzImage kernel. This time, there is no riva framebuffer in the kernel header files and so this step should not fail. Should it fail, ask for help in your local LUG or the highly knowledgeable folks at ##slackware in irc channel freenode.net ==== Updating X.Org Configuration File ==== ---- :After the installer utility finishes compiling and installing kernel module for the nvidia driver, it will ask you if you want it to make appropriate changes to your /etc/X11/xorg.conf. I personally chose not to, because I did not want my already customized xorg.conf to be messed with by a third party software. I simply changed the driver name from '''nv''' to '''nvidia''' in the <device> section of /etc/X11/xorg.conf :That's it folks. You now have a new kernel, new kernel modules and nvidia driver with 3D acceleration and direct rendering. Check direct rendering as follows: glxinfo | grep dri :Third line of the output should tell you that Direct Rendering has been enabled. Now its time to fire up X server and check your new driver. telinit 4 :This should launch X server, you should be seeing a flash of nvidia screen and then back to your favorite window manager. If everything went fine, you should go ahead and check video performance with some game, or a graphics intensive website or such. ==== Acknowledgements ==== ---- :This article benefited substantially by input from ##slackware (irc.freenode.net) user '''InspectorCluseau''' :If you have any questions or if you find a mistake in this tutorial, please contact me at [mailto:crypticlineage@gmail.com] 64d44fdbd2b258d714178b5c11839b27185fcda1 566 562 2011-12-09T14:07:35Z Rworkman 13 Reverted edits by [[Special:Contributions/Esmapebb|Esmapebb]] ([[User talk:Esmapebb|talk]]) to last revision by [[User:Erik|Erik]] wikitext text/x-wiki [[Category:Tutorials]] === nVidia Graphics Driver Installation & Kernel Recompile in Slackware 12.0 === ====Warning!==== ---- :Please do all this at your own risk. If you change your kernel and cause any damage to your system, you and only you are responsible for it. By providing this tutorial I do not take any responsibility for any damages or losses to your system. This is a disclaimer! ==== Background Info & Rationale for Kernel Recompile ==== ---- :I recently bought a used ''Geforce N6200'' video card (nvidia chipset) to replace the ''ATI Radeon 9200SE'' that suddenly died on me. I ran Xorg configuration utility ''xorgconfig'' to set the new card up. Slackware 12.0 ships with a generic ''nv'' driver for nvidia cards, but it does not support graphics acceleration and/or direct rendering. That means no games and no graphic heavy websites. Fortunately, nvidia provides a Linux binary driver for your video card that will do direct rendering and 3D acceleration just fine, although the driver is closed-source. But hey, at least it works. :Assuming that you're running Slackware 12.0 and using huge generic kernel 2.6.21.5 or newer or the smp version of it, you are going to face some problems compiling the nvidia driver against that kernel. The nvidia installer utility compiles the binary driver to suit your kernel. In Slackware 12.0 the support for Riva framebuffer is enabled by default in the huge-2.6.21.5 and huge-2.6.21.5-smp kernels and it is a problem for the nvidia installer utility. As soon as it notes the riva support enabled in the kernel header files, it quits and the driver module compilation fails. Most people will experience this problem in Slackware 12.0. The solution is to disable riva framebuffer support from the kernel and recompile it. :At the end of this tutorial you will have a fresh kernel compiled for your system, the nvidia driver compiled against this kernel and installed as kernel module and 3D graphics acceleration as well as direct rendering enabled. So let's begin taking one thing at a time. ==== Back Up Current Kernel & Kernel Modules ==== ---- :It is important that you have a backup of your currently working kernel modules so if the new kernel fails, you would still be able to use the old kernel to boot the system. Let's play safe. Important: All steps in this tutorials are done as superuser. cd /lib/modules ls 2.6.21.5 2.6.21.5-smp :Above currently installed kernels on your system are listed. Rename the kernel you're using to something like ''kernel-name''.backup. If you do not know which kernel you're using, do the following. The output of it should list the kernel you're using. Once you find it out, rename it as follows. uname -a Linux 2.6.21.5 #1 Sun Mar 16 14:46:57 CDT 2008 i686 AMD Athlon(tm) AuthenticAMD GNU/Linux mv 2.6.21.5 2.6.21.5-backup ls 2.6.21.5-smp 2.6.21.5-backup ==== Kernel Configuration and Recompile ==== ---- :Now that we have a backup of our current kernel and its modules, its time to proceed with configuration and recompiling the kernel. Change to the kernel source directory and copy the current kernel config file to the kernel source directory cd /usr/src/linux cp /boot/config .config #Note that config in /boot has no dot before it, but when we copy it, we include a dot prefix. This step will copy your current configuration so we can use it as a reference for further steps. Now let's begin kernel configuration make menuconfig This should give you a nice ''ncurses'' style detailed graphical menu of kernel configuration. Select Device Drivers > Graphics Support > :Scroll down to ''Riva Framebuffer Support'' (not ''nvidia Riva Support'') and press space bar twice. First space bar press will change the <M> to <*> and second will change <*> to < > (blank). Now press ''exit'' three times. The menuconfig will ask you if you want to save the changes. Select ''Yes'' and quit. We have now removed Riva Framebuffer Support from kernel configuration, the culprit for failing nvidia driver module compilation. :It's time to compile the kernel. Do the following: make bzImage :This is a good time to take a break for any of these: Coffee / Tea / Cigarette / Quick run to the grocery store. In short, depending upon how fast your procesor is, this step will take anywhere between 15 minutes to an hour. If everything goes fine, it will compile a new kernel and install newly compiled modules in /lib/modules/. If you get errors, something went wrong and you'll need to get some help from kernel documentation or ask in ##slackware on IRC host ''freenode.net'' :Now that we have a kernel compiled, its time to compile and install kernel modules make modules && make modules_install :Again, this step will take some time. But it will be worth the wait. In the basic kernel, there is close to 1000 modules that need to be compiled. Once this step is finished and you did not get any errors, its time to make sure the kernel bzImage was created and the modules were installed to the appropriate location. pwd /usr/src/linux cd arch/i386/boot pwd /usr/src/linux/arch/i386/boot ls Makefile bootsect.S '''bzImage''' edd.S mtools.conf.in setup.S tools vmlinux.bin bootsect bootsect.o compressed install.sh setup setup.o video.S :bzImage is your newly compiled kernel without Riva framebuffer support. cd /lib/modules ls 2.6.21.5 2.6.21.5-smp 2.6.21.5-backup The first entry above is the location of your newly installed kernel modules. ==== Install New Kernel And Update lilo.conf ==== ---- :Time to install the new kernel and notify your boot loader of its existence. cd /usr/src/linux/arch/i386/boot cp bzImage /boot :Open your favorite text editor and add following lines to your boot loader (typically /etc/lilo.conf) cd /etc emacs -nw lilo.conf #Linux bootable partition config begins image = /boot/bzImage root = /dev/hda2 #or whatever partition your / is located on label = New-Kernel #You can name it whatever you want. Just don't name it the same as the old kernel #Linux bootable partition config ends :Save file, close it and run lilo so the new changes take effect. lilo Added *Linux Added *New-Kernel :Excellent! It's time to test the new kernel. When you reboot, lilo will now present you with two choices for kernel, use the New-Kernel and boot. If somehow it fails, you can always go back to the old kernel. Just rename the /lib/modules/2.6.21.5-backup as 2.6.21.5 and rename the new kernel modules as something else. You see how important it was for us to backup the kernel as well as kernel modules in the beginning? :Assuming that your new kernel booted just fine and you had a fully functional system back up, its time to get the nVidia graphics driver from nvidia.com and install it. The current incarnation of nVidia driver is version # 169.12. Either use your favorite browser to download the driver from http://www.nvidia.com/Download/index.aspx?lang=en-us or do the following: cd /tmp wget http://us.download.nvidia.com/XFree86/Linux-x86/169.12/NVIDIA-Linux-x86-169.12-pkg1.run Make the installer utility executable and execute it chmod 755 NVIDIA-Linux-x86-169.12-pkg1.run ls -la -rwxr-xr-x 1 user groupname 17636559 2008-03-17 13:06 NVIDIA-Linux-x86-169.12-pkg1.run Before we execute it, we need to exit the X server. telinit 3 #This changes runlevel to 3, shuts down the X server and drops you off at the terminal sh ./NVIDIA-Linux-x86-169.12-pkg1.run :This installer utility first tries to find a pre-compiled driver for your kernel which it would not find, then it tries to download it via ftp from nvidia servers which fails too, and finally it proceeds to compile the driver kernel module against your newly installed bzImage kernel. This time, there is no riva framebuffer in the kernel header files and so this step should not fail. Should it fail, ask for help in your local LUG or the highly knowledgeable folks at ##slackware in irc channel freenode.net ==== Updating X.Org Configuration File ==== ---- :After the installer utility finishes compiling and installing kernel module for the nvidia driver, it will ask you if you want it to make appropriate changes to your /etc/X11/xorg.conf. I personally chose not to, because I did not want my already customized xorg.conf to be messed with by a third party software. I simply changed the driver name from '''nv''' to '''nvidia''' in the <device> section of /etc/X11/xorg.conf :That's it folks. You now have a new kernel, new kernel modules and nvidia driver with 3D acceleration and direct rendering. Check direct rendering as follows: glxinfo | grep dri :Third line of the output should tell you that Direct Rendering has been enabled. Now its time to fire up X server and check your new driver. telinit 4 :This should launch X server, you should be seeing a flash of nvidia screen and then back to your favorite window manager. If everything went fine, you should go ahead and check video performance with some game, or a graphics intensive website or such. ==== Acknowledgements ==== ---- :This article benefited substantially by input from ##slackware (irc.freenode.net) user '''InspectorCluseau''' :If you have any questions or if you find a mistake in this tutorial, please contact me at [mailto:crypticlineage@gmail.com] b215dfaa343899f8728191f252eb1737761e044b Main Page 0 1 578 492 2011-12-17T09:44:33Z Erik 1 Upgraded wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.80.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) f13aa3eb7a1a628b32610e28d969f3575fae6424 580 578 2011-12-17T11:56:37Z Erik 1 fix version wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) b9cf98e826023e70cf46d97386b1b0924a20cc89 User:Erik 2 2 579 488 2011-12-17T10:03:06Z Erik 1 enjoy an Integral Equation wikitext text/x-wiki Name: [mailto:erik@sl1200.org Erik Hanson]<br> Web: [http://sl1200.org/~erik/ http://sl1200s.org/~erik/]<br> IRC: [irc://frop.taphouse.org/ Taphouse Cabal] [irc://irc.efnet.org/ EFnet] [irc://chat.freenode.net/ The Freenode Network]<br> <math>\phi_n(\kappa) = \frac{1}{4\pi^2\kappa^2} \int_0^\infty \frac{\sin(\kappa R)}{\kappa R} \frac{\partial}{\partial R}\left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR</math> c80a53fc7ec07896cdaa3de98460dd130befa477 User talk:Danny 3 258 582 2012-01-02T11:59:56Z Danny 220 Created page with " [http://www.google.com/ google]" wikitext text/x-wiki [http://www.google.com/ google] 7826760270c8ae4e7dc9f0f08e0d1705a9ea8cec The Regulars 0 4 583 517 2012-01-07T15:02:07Z Erik 1 Just adding myself wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Adioe3|adioe3]] * [[User:Alisonken1|Alisonken1]] * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:cpunches|cpunches]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|dchmelik]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:Erik|erik]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jcm |jcm]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:robert-brown|robert-brown]] * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] * [[User:natex|natex]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. fc138ab248976c0efa99c214e8ac5109b6deec00 Chromium browser 0 249 584 523 2012-01-16T11:05:58Z Klickback 198 Added the article 'category'; Added the 'bugs' section wikitext text/x-wiki [[Category:Tutorials]] == Introduction == Chromium is an open source web browser from Google. It is based on the WebKit rendering engine and is the upstream project for Google's popular Chrome Web Browser. Keep in mind that Chromium is the '''testing''' branch of the Chrome web browser, and is not recommended for mission-critical systems. Consider using [http://www.google.com/chrome Google Chrome] or [http://www.mozilla.org/en-US/firefox/ Mozilla Firefox] for production systems. === Use Case === This tutorial explains how to install the latest Chromium build on Slackware and automate the process of updating it regularly. It is aimed at users on a personal desktop or laptop, especially on a single-user system. While the [http://slackbuilds.org slackbuilds.org] project provides excellent quality build scripts for Chromium, downloading 140MB+ source code and doing compilations that often take more than a couple of hours to complete is generally not feasible for people with laptops, slower computers or slow internet connections. Therefore, this guide aims on how to automate the process of installing and updating Chromium using daily binary builds that are much smaller in size and take up negligible resources for the install and update process, thus helping the user always run the latest and greatest builds without the hassle of downloading and compiling the source code. == Getting started == Chromium depends on <code>GConf</code> and <code>ORBit2</code>, and these should be installed first. Newer versions may also need the PAM library. === Slackware 13.37 === The above mentioned dependencies are included in the '''extra/''' tree of Slackware 13.37, so these can be simply installed by : <pre> # slackpkg install GConf ORBit2 google-chrome-pam-solibs </pre> === Slackware 13.1 === GConf and ORBit2 are availabe at the [http://slackbuilds.org slackbuilds.org] repository. These can be installed manually or using [http://sbopkg.org Sbopkg] : <pre> # sbopkg -i 'ORBit2 GConf' </pre> Get the <code>google-chrome-pam-solibs</code> package [http://slackware.osuosl.org/slackware-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-i486-1.txz 32-bit] [http://slackware.osuosl.org/slackware64-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-x86_64-1.txz 64-bit] and install it : <pre> # installpkg ./google-chrome-pam-solibs-1.1.3-x86_64-1.txz </pre> == Getting and installing the latest Chromium build == Google maintains a repository of daily chromium builds that you can get from [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux/ here] (32bit) or [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux_x64/ here] for 64 bit. Scroll down to the bottom and navigate to the latest build directory, and download the 'chrome-linux.zip' file there. Extract the zip file to a place of your liking (I like to keep mine in /home/username/soft), and run the 'chrome-wrapper' binary that will run Chromium and also generate a 'chromium-dev.desktop' file in /home/user/.local/share/applications/ and a Chromium entry will appear in your KDE or Xfce menu. Copy that file to your desktop if you prefer a desktop shortcut. To upgrade Chromium, just download the latest zip file and extract it where you previously did, overwriting the previous files. == Automating the Process == The following script helps to automate the process of installing and upgrading Chromium. Edit the <code>INSTALLDIR</code> variable to your liking - that is the place where chromium will be installed. Its recommended to keep it in a folder in your home directory to make it easy to manage. make sure the folder exists before running the script, or the script will fail. <pre> #!/bin/bash # Installation directory - change this to a directory of your choice # Please make sure the directory exists first, or the script won't work INSTALLDIR=$HOME/soft # Determine the architecture of the machine in use and set variables accordingly if [ -z "$ARCH" ]; then case "$( uname -m )" in i686) ARCH=i686 ;; *) ARCH=$( uname -m ) ;; esac fi if [ "$ARCH" = "i686" ];then DIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then DIRSUFFIX="_x64" else echo "The ARCH should be either i686 or x86_64. Exiting." exit fi # Determine the build number of the latest build LATESTBUILD=$(curl http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/LAST_CHANGE) # The URL to download from CHROMEURL="http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux"$DIRSUFFIX/$LATESTBUILD/"chrome-linux.zip" cd $INSTALLDIR if [ -e chrome-linux.zip ]; then # Check to see if `chrome-linux.zip` already exists mv chrome-linux.zip chrome-linux.zip.old # if it does, rename it to chrome-linux.zip.old as backup fi # in case the current build has problems wget $CHROMEURL unzip -u -o ./chrome-linux.zip </pre> To automate the process, first save the script as '''chromium-update.sh''' and add it to your users's cron jobs. Here is an example on how to set it up : <pre> $ cd $HOME $ mkdir .cron $ cp ./chromium-update.sh ./.cron/ $ chmod a+x ./.cron/chromium-update.sh $ crontab -e </pre> Add the following to your crontab : <pre> # Run daily cron job at 13:20 every day: 20 13 * * * ~/.cron/chromium-update.sh 1> /dev/null </pre> This will run the script at 13:20 every day. See <code>man crontab</code> for more on how to customize your cron jobs. ==== Bugs / Call for help ==== The script has a bug. Sometimes when running the script, the downloaded file is named something like <code>chrome-linux.zip?ir=1&redirect_counter=</code> instead of <code>chrome-linux.zip</code>. This is noticeable in the download process itself. To fix, press <code>Ctrl + c</code> (to cancel the download) and then rerun the script. Any inputs for fixing this bug are appreciated. == Resources == [http://www.chromium.org/Home Chromium home page] [http://en.wikipedia.org/wiki/Chromium_(web_browser)#Differences_from_Google_Chrome Differences from Google Chrome] [https://wiki.archlinux.org/index.php/Chromium#Configuration Tips on configuration and customization from Archwiki] c5a5c1493e536810c5c77b16c2b8348278af97e2 590 584 2012-01-24T07:08:45Z Klickback 198 /* Automating the Process */ - added -O option to wget; removed the 'Bugs' section wikitext text/x-wiki [[Category:Tutorials]] == Introduction == Chromium is an open source web browser from Google. It is based on the WebKit rendering engine and is the upstream project for Google's popular Chrome Web Browser. Keep in mind that Chromium is the '''testing''' branch of the Chrome web browser, and is not recommended for mission-critical systems. Consider using [http://www.google.com/chrome Google Chrome] or [http://www.mozilla.org/en-US/firefox/ Mozilla Firefox] for production systems. === Use Case === This tutorial explains how to install the latest Chromium build on Slackware and automate the process of updating it regularly. It is aimed at users on a personal desktop or laptop, especially on a single-user system. While the [http://slackbuilds.org slackbuilds.org] project provides excellent quality build scripts for Chromium, downloading 140MB+ source code and doing compilations that often take more than a couple of hours to complete is generally not feasible for people with laptops, slower computers or slow internet connections. Therefore, this guide aims on how to automate the process of installing and updating Chromium using daily binary builds that are much smaller in size and take up negligible resources for the install and update process, thus helping the user always run the latest and greatest builds without the hassle of downloading and compiling the source code. == Getting started == Chromium depends on <code>GConf</code> and <code>ORBit2</code>, and these should be installed first. Newer versions may also need the PAM library. === Slackware 13.37 === The above mentioned dependencies are included in the '''extra/''' tree of Slackware 13.37, so these can be simply installed by : <pre> # slackpkg install GConf ORBit2 google-chrome-pam-solibs </pre> === Slackware 13.1 === GConf and ORBit2 are availabe at the [http://slackbuilds.org slackbuilds.org] repository. These can be installed manually or using [http://sbopkg.org Sbopkg] : <pre> # sbopkg -i 'ORBit2 GConf' </pre> Get the <code>google-chrome-pam-solibs</code> package [http://slackware.osuosl.org/slackware-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-i486-1.txz 32-bit] [http://slackware.osuosl.org/slackware64-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-x86_64-1.txz 64-bit] and install it : <pre> # installpkg ./google-chrome-pam-solibs-1.1.3-x86_64-1.txz </pre> == Getting and installing the latest Chromium build == Google maintains a repository of daily chromium builds that you can get from [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux/ here] (32bit) or [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux_x64/ here] for 64 bit. Scroll down to the bottom and navigate to the latest build directory, and download the 'chrome-linux.zip' file there. Extract the zip file to a place of your liking (I like to keep mine in /home/username/soft), and run the 'chrome-wrapper' binary that will run Chromium and also generate a 'chromium-dev.desktop' file in /home/user/.local/share/applications/ and a Chromium entry will appear in your KDE or Xfce menu. Copy that file to your desktop if you prefer a desktop shortcut. To upgrade Chromium, just download the latest zip file and extract it where you previously did, overwriting the previous files. == Automating the Process == The following script helps to automate the process of installing and upgrading Chromium. Edit the <code>INSTALLDIR</code> variable to your liking - that is the place where chromium will be installed. Its recommended to keep it in a folder in your home directory to make it easy to manage. make sure the folder exists before running the script, or the script will fail. <pre> #!/bin/bash # Installation directory - change this to a directory of your choice # Please make sure the directory exists first, or the script won't work INSTALLDIR=$HOME/soft # Determine the architecture of the machine in use and set variables accordingly if [ -z "$ARCH" ]; then case "$( uname -m )" in i686) ARCH=i686 ;; *) ARCH=$( uname -m ) ;; esac fi if [ "$ARCH" = "i686" ];then DIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then DIRSUFFIX="_x64" else echo "The ARCH should be either i686 or x86_64. Exiting." exit fi # Determine the build number of the latest build LATESTBUILD=$(curl http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/LAST_CHANGE) # The URL to download from CHROMEURL="http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux"$DIRSUFFIX/$LATESTBUILD/"chrome-linux.zip" cd $INSTALLDIR if [ -e chrome-linux.zip ]; then # Check to see if `chrome-linux.zip` already exists mv chrome-linux.zip chrome-linux.zip.old # if it does, rename it to chrome-linux.zip.old as backup fi # in case the current build has problems wget -O chrome-linux.zip $CHROMEURL unzip -u -o ./chrome-linux.zip </pre> To automate the process, first save the script as '''chromium-update.sh''' and add it to your users's cron jobs. Here is an example on how to set it up : <pre> $ cd $HOME $ mkdir .cron $ cp ./chromium-update.sh ./.cron/ $ chmod a+x ./.cron/chromium-update.sh $ crontab -e </pre> Add the following to your crontab : <pre> # Run daily cron job at 13:20 every day: 20 13 * * * ~/.cron/chromium-update.sh 1> /dev/null </pre> This will run the script at 13:20 every day. See <code>man crontab</code> for more on how to customize your cron jobs. == Resources == [http://www.chromium.org/Home Chromium home page] [http://en.wikipedia.org/wiki/Chromium_(web_browser)#Differences_from_Google_Chrome Differences from Google Chrome] [https://wiki.archlinux.org/index.php/Chromium#Configuration Tips on configuration and customization from Archwiki] ca0a7556a92fadafc237a400f8e29766f85967e2 User:Lionel 2 260 586 2012-01-20T05:34:50Z Lionel 130 Created page with "Slackware rocks" wikitext text/x-wiki Slackware rocks 0c6a1b81a5ca87b730c22ee61d0267a39f026a77 Broadcom Wireless 0 246 587 518 2012-01-20T06:06:24Z Alisonken1 38 /* Using package tarball */ wikitext text/x-wiki [[Category:Tutorials]] == Introduction == This tutorial is written for setting up wireless on Slackware on laptops with Broadcom wireless cards. It deals with installing Boradcom's official proprietary '''wl''' driver for Linux that includes support for Broadcom's BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and BCM43228-based hardware. == Prerequisites == This tutorial assumes a full Slackware installation. There should also be a way to transfer files to the target laptop - it can either be a working internet connection using the laptop's ethernet card, '''or''' a different machine with internet access and a USB thumb drive to transfer the files. The regular user account on the laptop must also be a part of the ''netdev'' group. == Getting Started == The first thing is to check if the user is part of the ''netdev'' group : <pre>groups</pre> If the output does not contain <code>netdev</code>, then as <code>root</code>, enter the following command : <pre>usermod -a -G netdev username</pre> where <code>username</code> is the name of your user account. == Installing the driver == === Sbopkg method === If a working internet connection is available on the laptop (say a wired connection), use [http://sbopkg.org sbopkg] to install the drivers : <pre>sbopkg -i broadcom-sta</pre> === Manual method === Navigate to the slackbuilds.org's [http://slackbuilds.org/result/?search=broadcom-sta&sv= broadcom-sta page] and build the package according to the [http://slackbuilds.org/howto/ instructions] given. Make sure to download the source code relevant to the architecture of your installation (32-bit or 64-bit). == Blacklisting the b43 and ssb modules == The Broadcom's <code>wl</code> driver conflicts with the kernel's <code>b43</code> driver, so open up the <code>/etc/modprobe.d/blacklist.conf</code> using the text editor of your choice as <code>root</code> and add the following lines to it : <pre> blacklist ssb blacklist b43 </pre> == Final steps == At this point, reboot your machine. The drivers should be installed and work now. To test this, enter the <code>iwconfig</code> command. you should see an output like this : <pre> $ iwconfig lo no wireless extensions. eth1 IEEE 802.11 Nickname:"lapto" Access Point: Not-Associated Link Quality:5 Signal level:217 Noise level:199 Rx invalid nwid:0 invalid crypt:31 invalid misc:0 eth0 no wireless extensions. </pre> This output suggests that the drivers installed right and your wireless card is recognized as <code>eth1</code> by the kernel. Hooray! You can now either use the <code>iwconfig</code> tool to configure your wireless networks, '''or''' if you prefer to use a GUI, follow the next section for installing Wicd. == Installing Wicd == To make management of wireless connections easier, we will install [http://wicd.sourceforge.net/ Wicd] network manager that provides a simple configuration GUI and system tray icon. === Using slackpkg === If a working internet connection is available on the laptop (say a wired connection), simply use <code>slackpkg</code> to install wicd : <pre>slackpkg install wicd</pre> === Using package tarball === Download the <code>Wicd</code> package for your Slackware version from the ''extra/'' section of your preferred Slackware [http://slackware.osuosl.org/ mirror] and install using <code>installpkg</code>. For example, on a 32-bit system, as root : <pre> wget http://slackware.dreamhost.com/slackware/slackware-13.37/extra/wicd/wicd-1.7.0-i486-2.txz installpkg ./wicd-1.7.0-i486-2.txz </pre> == Wicd usage == Start the Wicd daemon : <pre> /etc/rc.d/rc.wicd start </pre> Once its started, run <code>wicd-client</code> and configure the network to your liking. === Caveat === Wicd by default treats <code>wlan0</code> as the default wireless interface. Since the interface is <code>eth1</code> in our case, you might want to correct this in Wicd's Preferences. 97eb900c9a766fa7c7f7a0cbd3a7325d6dbf2226 588 587 2012-01-20T06:07:47Z Alisonken1 38 /* Using package tarball */ wikitext text/x-wiki [[Category:Tutorials]] == Introduction == This tutorial is written for setting up wireless on Slackware on laptops with Broadcom wireless cards. It deals with installing Boradcom's official proprietary '''wl''' driver for Linux that includes support for Broadcom's BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and BCM43228-based hardware. == Prerequisites == This tutorial assumes a full Slackware installation. There should also be a way to transfer files to the target laptop - it can either be a working internet connection using the laptop's ethernet card, '''or''' a different machine with internet access and a USB thumb drive to transfer the files. The regular user account on the laptop must also be a part of the ''netdev'' group. == Getting Started == The first thing is to check if the user is part of the ''netdev'' group : <pre>groups</pre> If the output does not contain <code>netdev</code>, then as <code>root</code>, enter the following command : <pre>usermod -a -G netdev username</pre> where <code>username</code> is the name of your user account. == Installing the driver == === Sbopkg method === If a working internet connection is available on the laptop (say a wired connection), use [http://sbopkg.org sbopkg] to install the drivers : <pre>sbopkg -i broadcom-sta</pre> === Manual method === Navigate to the slackbuilds.org's [http://slackbuilds.org/result/?search=broadcom-sta&sv= broadcom-sta page] and build the package according to the [http://slackbuilds.org/howto/ instructions] given. Make sure to download the source code relevant to the architecture of your installation (32-bit or 64-bit). == Blacklisting the b43 and ssb modules == The Broadcom's <code>wl</code> driver conflicts with the kernel's <code>b43</code> driver, so open up the <code>/etc/modprobe.d/blacklist.conf</code> using the text editor of your choice as <code>root</code> and add the following lines to it : <pre> blacklist ssb blacklist b43 </pre> == Final steps == At this point, reboot your machine. The drivers should be installed and work now. To test this, enter the <code>iwconfig</code> command. you should see an output like this : <pre> $ iwconfig lo no wireless extensions. eth1 IEEE 802.11 Nickname:"lapto" Access Point: Not-Associated Link Quality:5 Signal level:217 Noise level:199 Rx invalid nwid:0 invalid crypt:31 invalid misc:0 eth0 no wireless extensions. </pre> This output suggests that the drivers installed right and your wireless card is recognized as <code>eth1</code> by the kernel. Hooray! You can now either use the <code>iwconfig</code> tool to configure your wireless networks, '''or''' if you prefer to use a GUI, follow the next section for installing Wicd. == Installing Wicd == To make management of wireless connections easier, we will install [http://wicd.sourceforge.net/ Wicd] network manager that provides a simple configuration GUI and system tray icon. === Using slackpkg === If a working internet connection is available on the laptop (say a wired connection), simply use <code>slackpkg</code> to install wicd : <pre>slackpkg install wicd</pre> === Using package tarball === Download the <code>Wicd</code> package for your Slackware version from the ''extra/'' section of your preferred Slackware [http://slackware.osuosl.org/ mirror] and install using <code>installpkg</code>. For example, on a 32-bit system running Slackware 13.37, as root: <pre> wget http://slackware.dreamhost.com/slackware/slackware-13.37/extra/wicd/wicd-1.7.0-i486-2.txz installpkg ./wicd-1.7.0-i486-2.txz </pre> == Wicd usage == Start the Wicd daemon : <pre> /etc/rc.d/rc.wicd start </pre> Once its started, run <code>wicd-client</code> and configure the network to your liking. === Caveat === Wicd by default treats <code>wlan0</code> as the default wireless interface. Since the interface is <code>eth1</code> in our case, you might want to correct this in Wicd's Preferences. 4039d9fdd6475b044ebfaba1670e6213d0270d06 589 588 2012-01-20T06:10:24Z Alisonken1 38 /* Wicd usage */ wikitext text/x-wiki [[Category:Tutorials]] == Introduction == This tutorial is written for setting up wireless on Slackware on laptops with Broadcom wireless cards. It deals with installing Boradcom's official proprietary '''wl''' driver for Linux that includes support for Broadcom's BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and BCM43228-based hardware. == Prerequisites == This tutorial assumes a full Slackware installation. There should also be a way to transfer files to the target laptop - it can either be a working internet connection using the laptop's ethernet card, '''or''' a different machine with internet access and a USB thumb drive to transfer the files. The regular user account on the laptop must also be a part of the ''netdev'' group. == Getting Started == The first thing is to check if the user is part of the ''netdev'' group : <pre>groups</pre> If the output does not contain <code>netdev</code>, then as <code>root</code>, enter the following command : <pre>usermod -a -G netdev username</pre> where <code>username</code> is the name of your user account. == Installing the driver == === Sbopkg method === If a working internet connection is available on the laptop (say a wired connection), use [http://sbopkg.org sbopkg] to install the drivers : <pre>sbopkg -i broadcom-sta</pre> === Manual method === Navigate to the slackbuilds.org's [http://slackbuilds.org/result/?search=broadcom-sta&sv= broadcom-sta page] and build the package according to the [http://slackbuilds.org/howto/ instructions] given. Make sure to download the source code relevant to the architecture of your installation (32-bit or 64-bit). == Blacklisting the b43 and ssb modules == The Broadcom's <code>wl</code> driver conflicts with the kernel's <code>b43</code> driver, so open up the <code>/etc/modprobe.d/blacklist.conf</code> using the text editor of your choice as <code>root</code> and add the following lines to it : <pre> blacklist ssb blacklist b43 </pre> == Final steps == At this point, reboot your machine. The drivers should be installed and work now. To test this, enter the <code>iwconfig</code> command. you should see an output like this : <pre> $ iwconfig lo no wireless extensions. eth1 IEEE 802.11 Nickname:"lapto" Access Point: Not-Associated Link Quality:5 Signal level:217 Noise level:199 Rx invalid nwid:0 invalid crypt:31 invalid misc:0 eth0 no wireless extensions. </pre> This output suggests that the drivers installed right and your wireless card is recognized as <code>eth1</code> by the kernel. Hooray! You can now either use the <code>iwconfig</code> tool to configure your wireless networks, '''or''' if you prefer to use a GUI, follow the next section for installing Wicd. == Installing Wicd == To make management of wireless connections easier, we will install [http://wicd.sourceforge.net/ Wicd] network manager that provides a simple configuration GUI and system tray icon. === Using slackpkg === If a working internet connection is available on the laptop (say a wired connection), simply use <code>slackpkg</code> to install wicd : <pre>slackpkg install wicd</pre> === Using package tarball === Download the <code>Wicd</code> package for your Slackware version from the ''extra/'' section of your preferred Slackware [http://slackware.osuosl.org/ mirror] and install using <code>installpkg</code>. For example, on a 32-bit system running Slackware 13.37, as root: <pre> wget http://slackware.dreamhost.com/slackware/slackware-13.37/extra/wicd/wicd-1.7.0-i486-2.txz installpkg ./wicd-1.7.0-i486-2.txz </pre> == Wicd usage == Start the Wicd daemon : <pre> /etc/rc.d/rc.wicd start </pre> Once its started, run <code>wicd-client</code> and configure the network to your liking. === Caveat === Wicd by default treats <code>wlan0</code> as the default wireless interface. Since the interface is <code>eth1</code> in our case, you might want to correct this in Wicd's Preferences. === User note === In order to access the wicd client utilities, your user must also be in the netdev group. Add your user to the netdev group, logout and login to make it effective, then you can run the wicd client utilities as your user. For the CLI based tool, there is wicd-cli and wicd-curses. For the GUI client, ther is wicd-client and wicd-gtk. aa412537994b896b6a41245818de2323d5e935d4 Writing A SlackBuild Script 0 16 591 573 2012-01-24T19:47:42Z Erik 1 Removed offline/404 sites wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like linuxpackages.net, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/latex2html-2002-2-1.tar.gz # 05.02.2005 Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar -xzf latex2html-2002-2-1.tar.gz || exit 1 = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ 4aa3f2ed955a59f7588ddb6a01f631dc21418e03 SlackBuild Scripts 0 15 592 572 2012-01-24T19:52:10Z Erik 1 Removed offline/404 sites wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] 5efc3844c6e55de198f33a7ed5009d1bd1cf0049 User:Erik 2 2 595 579 2012-01-27T19:09:24Z Erik 1 wikitext text/x-wiki Name: [mailto:erik@sl1200.org Erik Hanson]<br> Web: [http://sl1200.org/~erik/ http://sl1200s.org/~erik/]<br> IRC: [irc://frop.taphouse.org/ Taphouse Cabal] [irc://irc.efnet.org/ EFnet] [irc://chat.freenode.net/ The Freenode Network]<br> <math>\phi_n(\kappa) = \frac{1}{4\pi^2\kappa^2} \int_0^\infty \frac{\sin(\kappa R)}{\kappa R} \frac{\partial}{\partial R}\left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR</math> 257679b7c1f151fdf71e38739eaf945dfc06575e 597 595 2012-01-29T18:41:28Z Erik 1 wikitext text/x-wiki Name: [mailto:erik@sl1200.org Erik Hanson]<br> Web: [http://sl1200.org/~erik/ http://sl1200s.org/~erik/]<br> IRC: [irc://frop.taphouse.org/ Taphouse Cabal] [irc://irc.efnet.org/ EFnet] [irc://chat.freenode.net/ The Freenode Network]<br> <math>\phi_n(\kappa) = \frac{1}{4\pi^2\kappa^2} \int_0^\infty \frac{\sin(\kappa R)}{\kappa R} \frac{\partial}{\partial R}\left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR</math> b5215ba87566a9a98450050030df078927c182a2 List of security updates missing in 13 37 0 263 596 2012-01-29T18:10:20Z Adrien 260 created wikitext text/x-wiki This page is meant to give a list of the packages which have known security issues in Slackware 13.37 and which haven't been updated yet. 5639d63816bc7d430f0cb3bea14a16caa4d61e11 Category:Security:SSA 14 264 598 2012-01-29T18:48:30Z Asteroid 259 news SSA pages wikitext text/x-wiki Because we need software up to date, especially when we talk about securities upgrades. This is a list of packages with securities risks, sort by Slackware's categories What can we do ? Simply provide an up to date SlackBuilds, based on the officials ones, in a dedicated page. == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == perl : CVE-2011-2939 ruby : CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == bind : CVE-2011-4313 httpd : CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 dhcp : CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 openssl : CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 proftpd : CVE-2011-4130 php : CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 9642403a2230cc929a6efd35cff45e7c5f9f8d05 599 598 2012-01-29T18:55:00Z Asteroid 259 add the tips to create page in this category wikitext text/x-wiki Because we need software up to date, especially when we talk about securities upgrades. This is a list of packages with securities risks, sort by Slackware's categories What can we do ? Simply provide an up to date SlackBuilds, based on the officials ones, in a dedicated page. ''(Add <nowiki>[[Category:Security:SSA]]</nowiki> to the very bottom of your page to have it appear on this page)'' == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == perl : CVE-2011-2939 ruby : CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == bind : CVE-2011-4313 httpd : CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 dhcp : CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 openssl : CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 proftpd : CVE-2011-4130 php : CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 b714a5bf39f72273ee8d5b7217af90b13b7e96c8 600 599 2012-01-29T19:30:22Z Adrien 260 Rewrote introduction wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable. ''(Add <nowiki>[[Category:Security:SSA]]</nowiki> to the very bottom of your page to have it appear on this page)'' == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == perl : CVE-2011-2939 ruby : CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == bind : CVE-2011-4313 httpd : CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 dhcp : CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 openssl : CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 proftpd : CVE-2011-4130 php : CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 a5d369d9eba3d850ad15c0b1a871bf9a81e0c829 601 600 2012-01-29T20:05:13Z Adrien 260 explain why we're not always giving specific CVEs all the time (hopeless software) wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). ''(Add <nowiki>[[Category:Security:SSA]]</nowiki> to the very bottom of your page to have it appear on this page)'' == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == perl : CVE-2011-2939 ruby : CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == bind : CVE-2011-4313 httpd : CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 dhcp : CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 openssl : CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 proftpd : CVE-2011-4130 php : CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 67032dd8ced4cf0434e8f0abae212814b4c793d6 602 601 2012-01-29T20:27:35Z Adrien 260 d/perl: more detailled CVE wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). ''(Add <nowiki>[[Category:Security:SSA]]</nowiki> to the very bottom of your page to have it appear on this page)'' == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow. ===== Fix ===== Available in upstream version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) Fixed upstream on: Tue, 9 Aug 2011 Upstream commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 ==== ruby ==== CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == bind : CVE-2011-4313 httpd : CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 dhcp : CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 openssl : CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 proftpd : CVE-2011-4130 php : CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 8a2b1f7b6162dc8205e5e93bb91cc3e37ba6ce0f 603 602 2012-01-29T20:40:53Z Adrien 260 /* perl */ wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). ''(Add <nowiki>[[Category:Security:SSA]]</nowiki> to the very bottom of your page to have it appear on this page)'' == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow. ===== Fix ===== Available in upstream version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) Fixed upstream on: Tue, 9 Aug 2011 Upstream commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 ===== Reference ===== http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 ==== ruby ==== CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == bind : CVE-2011-4313 httpd : CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 dhcp : CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 openssl : CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 proftpd : CVE-2011-4130 php : CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 5a507e86cc149386f9b9eae1f657bf8e8b259688 604 603 2012-01-29T20:47:35Z Adrien 260 d/perl: better formatting wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). ''(Add <nowiki>[[Category:Security:SSA]]</nowiki> to the very bottom of your page to have it appear on this page)'' == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Upstream commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 ==== ruby ==== CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == bind : CVE-2011-4313 httpd : CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 dhcp : CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 openssl : CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 proftpd : CVE-2011-4130 php : CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 626038d18823510e03806ed98f0e86401b56a75b 605 604 2012-01-29T21:06:24Z Adrien 260 intro: explain the format for the CVEs on the page wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Upstream commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 ==== ruby ==== CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == bind : CVE-2011-4313 httpd : CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 dhcp : CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 openssl : CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 proftpd : CVE-2011-4130 php : CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 77befe9a6e2a213ce94b8666ccebec0e68ed100e 606 605 2012-01-29T21:15:24Z Asteroid 259 /* d */ fix ruby title wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Upstream commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == bind : CVE-2011-4313 httpd : CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 dhcp : CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 openssl : CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 proftpd : CVE-2011-4130 php : CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 f25fbd64a5103a21fd1db741ad172026d33859f1 607 606 2012-01-29T21:31:36Z Asteroid 259 /* n */ bind 9.7.4P1 seems to be not affected, only 9.7.4 is wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Upstream commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == httpd : CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 dhcp : CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 openssl : CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 proftpd : CVE-2011-4130 php : CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 e66c7b1279b5eeaae3cc06af232a37be8465e6a4 608 607 2012-01-29T21:43:12Z Asteroid 259 /* n */ add all infos for proftpd fix wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Upstream commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == ==== httpd ==== CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 ==== dhcp ==== CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 ==== openssl ==== CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 ==== proftpd ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. ==== php ==== CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 80f92dd39a1c7e62c7b6c33e7ef215da2202cf7d 609 608 2012-01-29T21:46:22Z Adrien 260 d/perl: more detailled title (kind of vuln; affected slackware releases) wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Upstream commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == ==== httpd ==== CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 ==== dhcp ==== CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 ==== openssl ==== CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 ==== proftpd ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. ==== php ==== CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 92436cd29b3e02450848575d22b864916740c307 610 609 2012-01-29T21:46:46Z Asteroid 259 /* proftpd */ wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Upstream commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == ==== httpd ==== CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 ==== dhcp ==== CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 ==== openssl ==== CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) ==== AFFECTED : -current : 1.3.3e, -13.37 : 1.3.3e, and all before Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. ==== php ==== CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 5ab10794291b1b83c3e0d055b768e470cbfe314b 611 610 2012-01-29T21:46:48Z Adrien 260 /* CVE-2011-2939 (DDoS, affected: current and stable) */ wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == ==== httpd ==== CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 ==== dhcp ==== CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 ==== openssl ==== CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) ==== AFFECTED : -current : 1.3.3e, -13.37 : 1.3.3e, and all before Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. ==== php ==== CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 a1f71bed1e6a4882c6fddd5f13d78d4021e3f822 612 611 2012-01-29T21:53:26Z Asteroid 259 /* CVE-2011-4130 (proftpd bug tracker #3711) */ wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == ==== httpd ==== CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 ==== dhcp ==== CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 ==== openssl ==== CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. ==== php ==== CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 0c598f7a5d1bae042a8d7f2d4b6e217e333dc38e 613 612 2012-01-29T21:53:42Z Asteroid 259 /* CVE-2011-4130 (Execute Code, affected : current, 13.37, and all before */ wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == ==== httpd ==== CVE-2011-4415 CVE-2011-4317 CVE-2011-3607 CVE-2011-3368 ==== dhcp ==== CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 ==== openssl ==== CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. ==== php ==== CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 50edcf79fa8d5715422324cfe28924738ee59ef2 620 613 2012-01-30T10:32:26Z Asteroid 259 /* httpd */ detail for httpd holes wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (OverflowGain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (CSRF , affected : current, 13.37 and all before) ==== Cross-site request forgery (CSRF) vulnerability in post_bug.cgi in Bugzilla 2.x, 3.x, and 4.x before 4.2rc1 allows remote attackers to hijack the authentication of arbitrary users for requests that create bug reports. ==== dhcp ==== CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 ==== openssl ==== CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. ==== php ==== CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 8834dddba34557f51ba08dc8def86b0608b84797 621 620 2012-01-30T10:33:31Z Asteroid 259 /* n */ typo in title header wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (OverflowGain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (CSRF , affected : current, 13.37 and all before) ==== Cross-site request forgery (CSRF) vulnerability in post_bug.cgi in Bugzilla 2.x, 3.x, and 4.x before 4.2rc1 allows remote attackers to hijack the authentication of arbitrary users for requests that create bug reports. === dhcp === CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 === openssl === CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 adc62cb1f3ad637ddbd58e434ebe8b1895633b3d 622 621 2012-01-30T10:40:33Z Asteroid 259 /* CVE-2011-3368 (CSRF , affected : current, 13.37 and all before) */ wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (OverflowGain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 === openssl === CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === CVE-2011-4885 CVE-2011-3379 == x == libXfont : CVE-2011-2895 == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 7541d0a0e07d600fcdd9658e422d7a09dd0a7bbf 623 622 2012-01-30T10:59:24Z Asteroid 259 add libXfont cve-2011-2895 wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (OverflowGain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 === openssl === CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === CVE-2011-4885 CVE-2011-3379 == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute CodeOverflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 d9ed089975a7113ad63b95dc7b020e144f15dead 624 623 2012-01-30T11:07:08Z Asteroid 259 /* php */ add cve-2001-3379 for php wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (OverflowGain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 === openssl === CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== CVE-2011-4885 CVE-2011-3379 (Denial Of Service, affected : current, 13.37 and all before ) ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute CodeOverflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 e28162a0c95682017d57f58c0483fc35bb57de05 625 624 2012-01-30T11:08:13Z Asteroid 259 /* CVE-2011-4130 (Execute Code, affected : current, 13.37, and all before) */ typo wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (OverflowGain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 === openssl === CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== CVE-2011-4885 CVE-2011-3379 (Denial Of Service, affected : current, 13.37 and all before ) ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute CodeOverflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == pidgin : CVE-2011-4603 CVE-2011-4602 CVE-2011-4601 CVE-2011-3594 CVE-2011-3184 CVE-2011-2943 8679b722622d5ace318d5057e78970a1108aab49 626 625 2012-01-30T17:31:45Z Erik 1 details for pidgin wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (OverflowGain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 === openssl === CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== CVE-2011-4885 CVE-2011-3379 (Denial Of Service, affected : current, 13.37 and all before ) ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute CodeOverflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. db4427e5edfc1f4864d3f4db8fdfa05568fa72f5 627 626 2012-01-30T17:33:01Z Erik 1 wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 === openssl === CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== CVE-2011-4885 CVE-2011-3379 (Denial Of Service, affected : current, 13.37 and all before ) ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. 80c30591c0c9cac9da871ff1337e4409d9f3189c 628 627 2012-01-30T17:51:15Z Erik 1 seperate php CVEs wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == linux == ap == cups : CVE-2011-3170 CVE-2011-2896 == d == === perl === ==== CVE-2011-2939 (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === CVE-2011-2705 CVE-2011-1004 CVE-2011-0188 == e == emacs == l == t1lib : CVE-2011-1554 CVE-2011-1553 CVE-2011-1552 CVE-2011-0764 freetype2 : CVE-2011-0226 libxml2 : CVE-2011-1944 == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === CVE-2011-4868 CVE-2011-4539 CVE-2011-2749 CVE-2011-2748 === openssl === CVE-2012-0027 CVE-2011-4619 CVE-2011-4576 CVE-2011-4109 CVE-2011-4108 CVE-2011-3210 === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected : current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected : current ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. c46ed7954714ba2a87e086438455b45fc7caaa9f 629 628 2012-01-30T18:00:36Z Erik 1 make more CVEs into links wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === linux === == ap == === cups === [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] [http://cvedetails.com/cve/CVE-2011-1004 CVE-2011-1004] [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] == e == === emacs === == l == === t1lib === [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] === freetype2 === [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] === libxml2 === [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] === openssl === [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected : current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected : current ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. bee8431a0ad1bf4eb952b5044f7eb6bf3efb909c 630 629 2012-01-30T18:04:41Z Erik 1 added freetype2 details wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === linux === == ap == === cups === [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] [http://cvedetails.com/cve/CVE-2011-1004 CVE-2011-1004] [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] == e == === emacs === == l == === t1lib === [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected : current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] === openssl === [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected : current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected : current ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. b27a5364afeb1cde7203e638ec7fb7ecdfbe4497 631 630 2012-01-30T18:07:24Z Erik 1 added libxml2 details wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === linux === == ap == === cups === [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] [http://cvedetails.com/cve/CVE-2011-1004 CVE-2011-1004] [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] == e == === emacs === == l == === t1lib === [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected : current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected : current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] === openssl === [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected : current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected : current ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. d643d6acdc56db187626e083cc7bd92a8e493e8f 632 631 2012-01-30T18:15:00Z Erik 1 added cups details wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] [http://cvedetails.com/cve/CVE-2011-1004 CVE-2011-1004] [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] == e == === emacs === == k == === kernel === == l == === t1lib === [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected : current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected : current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] === openssl === [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected : current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected : current ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. eaed92dc1535cf6a77c5e7008edab274ced43a12 633 632 2012-01-30T18:25:18Z Erik 1 added t1lib details wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] [http://cvedetails.com/cve/CVE-2011-1004 CVE-2011-1004] [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected : current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected : current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected : current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] === openssl === [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected : current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected : current ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. fa4e9172b3d9ccd08af63d5f8c9d6b0886f8446b 634 633 2012-01-30T18:43:53Z Erik 1 added openssl details wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] [http://cvedetails.com/cve/CVE-2011-1004 CVE-2011-1004] [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected : current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected : current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected : current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected : current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected : current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected : current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] affected : current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected : current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected : current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected : current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected : current ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. c06c63ce5c903dc4840e5ab9339001b0bbf0a483 635 634 2012-01-30T18:59:23Z Erik 1 added dhcp details wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (DDoS, affected: current and stable) ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] [http://cvedetails.com/cve/CVE-2011-1004 CVE-2011-1004] [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected : current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected : current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected : current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected : current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected : current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected : current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected : current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected : current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected : current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected : current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] affected : current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected : current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected : current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected : current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected : current ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. 11dcc13b63076cd95b7b4d746bf4be1dbfc924c8 636 635 2012-01-30T19:04:49Z Erik 1 wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected : current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] [http://cvedetails.com/cve/CVE-2011-1004 CVE-2011-1004] [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected : current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected : current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected : current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected : current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected : current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected : current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected : current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected : current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected : current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected : current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] affected : current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected : current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected : current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected : current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected : current ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. 9b1e55073ae89294a45c67e6b3d7ceca4262e180 637 636 2012-01-30T19:26:27Z Erik 1 wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected : current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] [http://cvedetails.com/cve/CVE-2011-1004 CVE-2011-1004] [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected : current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected : current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected : current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected : current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected : current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected : current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected : current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected : current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected : current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected : current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] affected : current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected : current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected : current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected : current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected : current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. e1d2cf22eba17c095edb55f4caf921751d0f0d2b 638 637 2012-01-30T19:52:14Z Asteroid 259 /* ruby */ remove cve-2011-1004 which does not affect slackware current, nore 1337, nore 13.1 wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected : current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected : current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected : current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected : current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected : current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected : current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected : current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected : current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected : current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected : current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected : current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] affected : current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected : current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected : current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected : current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected : current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. fd5b38ed1336e63c6300be3fc5d0cb890549894b 639 638 2012-01-30T19:56:18Z Asteroid 259 /* ruby */ wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected : current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected : current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] affect current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of ServiceExecute Code) affect current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected : current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected : current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected : current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected : current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (DoS, affected : current, 13.37 and all before) ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges, affected : current, 13.37 and all before) ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] (affected : current, 13.37 and all before) ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected : current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected : current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected : current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected : current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected : current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected : current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected : current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] affected : current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected : current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected : current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code, affected : current, 13.37, and all before) ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected : current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected : current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow, current, 13.37 and all before) ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected : current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected : current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected : current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected : current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected : current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected : current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. 1b2161e29449a9a21657e88d34c2ca490844cf2d 640 639 2012-01-30T22:58:14Z Erik 1 minor changes for consistency wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected: current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (Denial Of Service) affected: current, 13.37 and all before ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges) affected: current, 13.37 and all before ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] affected: current, 13.37 and all before ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected: current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected: current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected: current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] affected: current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected: current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected: current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code) affected: current, 13.37, and all before ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected: current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. dea72b9dc0f51ad7003cfb75a4a2f504d62e28d2 641 640 2012-01-31T07:29:48Z Adrien 260 /* CVE-2011-4109 affected: current, 13.37 through 11.0 */ - title: add "unspecified impact" wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected: current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (Denial Of Service) affected: current, 13.37 and all before ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges) affected: current, 13.37 and all before ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] affected: current, 13.37 and all before ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected: current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected: current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected: current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] (unspecified impact) affected: current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected: current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected: current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code) affected: current, 13.37, and all before ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected: current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. 7635dac35ee810cdc9bcb759a89195c238f263b5 642 641 2012-01-31T07:33:18Z Adrien 260 /* CVE-2011-2705 affected: current, 13.37 and all before */ - title: classify as "PRNG weakness" wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] (PRNG weakness) affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected: current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (Denial Of Service) affected: current, 13.37 and all before ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges) affected: current, 13.37 and all before ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] affected: current, 13.37 and all before ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected: current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected: current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected: current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] (unspecified impact) affected: current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected: current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected: current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code) affected: current, 13.37, and all before ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected: current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. fe879915f3ccd46208e0317962cfd18cd71d898f 643 642 2012-01-31T10:21:39Z Adrien 260 xap/mozilla-*: new; quick note wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] (PRNG weakness) affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected: current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (Denial Of Service) affected: current, 13.37 and all before ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges) affected: current, 13.37 and all before ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] affected: current, 13.37 and all before ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected: current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected: current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected: current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] (unspecified impact) affected: current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected: current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected: current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code) affected: current, 13.37, and all before ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected: current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. === mozilla-* === No specific CVE, you know they are vulnerable to at leas tone thing. 304789e99d75babb2d3cebfcb31d71ee670ee340 644 643 2012-01-31T10:34:29Z Adrien 260 Turn mozilla-* into mozilla-firefox; add _some_ know issues (those fixed in ff9) wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] (PRNG weakness) affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected: current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (Denial Of Service) affected: current, 13.37 and all before ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges) affected: current, 13.37 and all before ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] affected: current, 13.37 and all before ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected: current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected: current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected: current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] (unspecified impact) affected: current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected: current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected: current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code) affected: current, 13.37, and all before ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected: current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. === mozilla-firefox (various issues, all versions vulnerable) === From http://www.mozilla.org/security/known-vulnerabilities/firefox.html#firefox9, at LEAST: Fixed in Firefox 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) 3fd729f9fd020edd8c1d8a4ef3fb08095863b464 645 644 2012-01-31T10:39:25Z Cccc828 262 /* n */ wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] (PRNG weakness) affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected: current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (Denial Of Service) affected: current, 13.37 and all before ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges) affected: current, 13.37 and all before ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] affected: current, 13.37 and all before ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected: current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected: current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected: current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] (unspecified impact) affected: current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected: current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected: current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code) affected: current, 13.37, and all before ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected: current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. === curl === ==== [http://curl.haxx.se/docs/adv_20120124.html CVE-2012-0036] (Execute Code) affected: current, and all before ==== curl is vulnerable to a data injection attack for certain protocols through control characters embedded or percent-encoded in URLs. ==== [http://curl.haxx.se/docs/adv_20120124B.html CVE-2011-3389] (man-in-the-middle attacks) affected: current, 13.37 ==== curl is vulnerable to a SSL CBC IV vulnerability when built to use OpenSSL for the SSL/TLS layer. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. === mozilla-firefox (various issues, all versions vulnerable) === From http://www.mozilla.org/security/known-vulnerabilities/firefox.html#firefox9, at LEAST: Fixed in Firefox 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) 1542f7def137c233d78a4fdee328a600dc5ad102 User talk:Merge-delete 3 255 614 539 2012-01-30T03:52:30Z Erik 1 moved [[User talk:Amanda27]] to [[User talk:Merge-delete]]: Automatically moved page while merging the user "[[User:Amanda27|Amanda27]]" to "[[User:Merge-delete|Merge-delete]]" wikitext text/x-wiki Boutique Hotels In India Indulge yourself in sheer luxury throughout your remain in boutique hotels in India.[http://hotelslonavala.net/ hotels in lonavala] These are the places where one can live like rajas and maharajas. They're simply unique within their architecture and hang up where one can get highly personalized services inside a distinctive manner. They are heritage hotels that supply you with a unique connection with living existence.[http://hotelslonavala.net/ hotels in lonavala] Just opposite to western style hotels, these places permit you to know and have the wealthy culture and history of India. On a trip from the beaten tracks in India, you might find several boutique hotels where one can unwind yourself and also have home-cooked food. With enchanting folk music, amazing architecture, peace and exceptional hospitality, these hotels can bring alive the times of rajas and maharajas of older occasions. Their architecture, gardens, food and luxuries echo from the glorious past of India. Although you will find several hotels in India but when youre searching for best hotels, then certainly Rajasthan may be the condition that you need to visit whenever you arrived at India. You will find several havelis-converted-hotels in Rajasthan where you can unwind yourself and dip your senses in luxury. Remaining during these hotels is definitely an entirely different experience. Youll feel like you aren't nowadays. For experience a completely different lifestyle, you have to visit these hotels and spend your trip. Trust, youll possess a lifetime experience. The deserted great thing about Rajasthan and wealthy tradition enables you to definitely go through the luxury in simplicity. You no more have to pretend as possible be genuine and do what youve always loved. The best hotels in Rajasthan are Rawla Narlai, Raas Hotel, The Serai, Udai Kothi, Bhainsrorgarh and Devigarh. From the sights of those hotels, regal inside and grass to authentic antiques, lodging and fooding may be worth admiring. You seem like wandering within the deserts, going through the wonder, studying wealthy tradition, listening folk music and gorging on local meals. Several companies offer vacation packages to Rajasthan. Whenever you arrived at India, you just cant manage to miss these places. They feature glorious past of India. 41ee596bca7edd95e7e87a4ae8e86d225025fc69 The Regulars 0 4 618 583 2012-01-30T04:18:02Z Erik 1 cpunches is not a regular wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Adioe3|adioe3]] * [[User:Alisonken1|Alisonken1]] * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|dchmelik]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:Erik|erik]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jcm |jcm]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:robert-brown|robert-brown]] * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] * [[User:natex|natex]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. e392d1ec0ab6533f48eb63e226c1c296c8eee6b9 619 618 2012-01-30T04:19:41Z Erik 1 wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Adioe3|adioe3]] * [[User:Alisonken1|Alisonken1]] * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[USer:codermaniac|codermaniac]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|dchmelik]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:Erik|erik]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jcm |jcm]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[User:natex|natex]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:robert-brown|robert-brown]] * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. a6cb9ddfd5e967a7ca0605ff0c4b957843fa85ae Category:Security:SSA 14 264 646 645 2012-01-31T10:49:13Z Adrien 260 seamonkey wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] (PRNG weakness) affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected: current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (Denial Of Service) affected: current, 13.37 and all before ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges) affected: current, 13.37 and all before ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] affected: current, 13.37 and all before ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected: current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected: current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected: current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] (unspecified impact) affected: current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected: current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected: current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code) affected: current, 13.37, and all before ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected: current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. === curl === ==== [http://curl.haxx.se/docs/adv_20120124.html CVE-2012-0036] (Execute Code) affected: current, and all before ==== curl is vulnerable to a data injection attack for certain protocols through control characters embedded or percent-encoded in URLs. ==== [http://curl.haxx.se/docs/adv_20120124B.html CVE-2011-3389] (man-in-the-middle attacks) affected: current, 13.37 ==== curl is vulnerable to a SSL CBC IV vulnerability when built to use OpenSSL for the SSL/TLS layer. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. === mozilla-firefox (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/firefox.html#firefox9, at LEAST: Fixed in Firefox 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) === seamonkey (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/seamonkey.html#seamonkey2.6, at LEAST: Fixed in SeaMonkey 2.6: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) 389e3eecd81d2d5bca61d749fe1b666797682c14 647 646 2012-01-31T10:53:36Z Adrien 260 mozilla-thunderbird wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] (PRNG weakness) affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected: current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (Denial Of Service) affected: current, 13.37 and all before ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges) affected: current, 13.37 and all before ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] affected: current, 13.37 and all before ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === openssl === ==== [http://cvedetails.com/cve/CVE-2012-0027 CVE-2012-0027] (Denial Of Service) affected: current, 13.37, and all before ==== The GOST ENGINE in OpenSSL before 1.0.0f does not properly handle invalid parameters for the GOST block cipher, which allows remote attackers to cause a denial of service (daemon crash) via crafted data from a TLS client. ==== [http://cvedetails.com/cve/CVE-2011-4619 CVE-2011-4619] (Denial Of Service) affected: current, 13.37, and all before ==== The Server Gated Cryptography (SGC) implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly handle handshake restarts, which allows remote attackers to cause a denial of service via unspecified vectors. ==== [http://cvedetails.com/cve/CVE-2011-4576 CVE-2011-4576] (Obtain Information) affected: current, 13.37, and all before ==== The SSL 3.0 implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f does not properly initialize data structures for block cipher padding, which might allow remote attackers to obtain sensitive information by decrypting the padding data sent by an SSL peer. ==== [http://cvedetails.com/cve/CVE-2011-4109 CVE-2011-4109] (unspecified impact) affected: current, 13.37 through 11.0 ==== Double free vulnerability in OpenSSL 0.9.8 before 0.9.8s, when X509_V_FLAG_POLICY_CHECK is enabled, allows remote attackers to have an unspecified impact by triggering failure of a policy check. ==== [http://cvedetails.com/cve/CVE-2011-4108 CVE-2011-4108] affected: current, 13.37, and all before ==== The DTLS implementation in OpenSSL before 0.9.8s and 1.x before 1.0.0f performs a MAC check only if certain padding is valid, which makes it easier for remote attackers to recover plaintext via a padding oracle attack. ==== [http://cvedetails.com/cve/CVE-2011-3210 CVE-2011-3210] (Denial Of Service) affected: current, 13.37 through 11.0 ==== The ephemeral ECDH ciphersuite functionality in OpenSSL 0.9.8 through 0.9.8r and 1.0.x before 1.0.0e does not ensure thread safety during processing of handshake messages from clients, which allows remote attackers to cause a denial of service (daemon crash) via out-of-order messages that violate the TLS protocol. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code) affected: current, 13.37, and all before ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected: current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. === curl === ==== [http://curl.haxx.se/docs/adv_20120124.html CVE-2012-0036] (Execute Code) affected: current, and all before ==== curl is vulnerable to a data injection attack for certain protocols through control characters embedded or percent-encoded in URLs. ==== [http://curl.haxx.se/docs/adv_20120124B.html CVE-2011-3389] (man-in-the-middle attacks) affected: current, 13.37 ==== curl is vulnerable to a SSL CBC IV vulnerability when built to use OpenSSL for the SSL/TLS layer. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. === mozilla-firefox (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/firefox.html#firefox9, at LEAST: Fixed in Firefox 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) === mozilla-thunderbird (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/thunderbird.html#thunderbird9, at LEAST: Fixed in Thunderbird 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) === seamonkey (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/seamonkey.html#seamonkey2.6, at LEAST: Fixed in SeaMonkey 2.6: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) 0f1acb17056835664f8a03a87481a827f5c42013 648 647 2012-02-03T08:58:30Z Asteroid 259 /* openssl */ OpenSSL up to date on february, 02 2012 wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] (PRNG weakness) affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === freetype2 === ==== [http://cvedetails.com/cve/CVE-2011-0226 CVE-2011-0226] (Denial Of Service, Execute Code, Memory corruption) affected: current, 13.37 and all before ==== Integer signedness error in psaux/t1decode.c in FreeType before 2.4.6, as used in CoreGraphics in Apple iOS before 4.2.9 and 4.3.x before 4.3.4 and other products, allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption and application crash) via a crafted Type 1 font in a PDF document, as exploited in the wild in July 2011. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (Denial Of Service) affected: current, 13.37 and all before ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges) affected: current, 13.37 and all before ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] affected: current, 13.37 and all before ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code) affected: current, 13.37, and all before ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected: current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. === curl === ==== [http://curl.haxx.se/docs/adv_20120124.html CVE-2012-0036] (Execute Code) affected: current, and all before ==== curl is vulnerable to a data injection attack for certain protocols through control characters embedded or percent-encoded in URLs. ==== [http://curl.haxx.se/docs/adv_20120124B.html CVE-2011-3389] (man-in-the-middle attacks) affected: current, 13.37 ==== curl is vulnerable to a SSL CBC IV vulnerability when built to use OpenSSL for the SSL/TLS layer. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. === mozilla-firefox (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/firefox.html#firefox9, at LEAST: Fixed in Firefox 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) === mozilla-thunderbird (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/thunderbird.html#thunderbird9, at LEAST: Fixed in Thunderbird 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) === seamonkey (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/seamonkey.html#seamonkey2.6, at LEAST: Fixed in SeaMonkey 2.6: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) ad1e1868e4027f4dcc99800065c9a07646812a49 649 648 2012-02-04T02:34:56Z Erik 1 freetype2 up to date wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] (PRNG weakness) affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === httpd === ==== [http://cvedetails.com/cve/CVE-2011-4415 CVE-2011-4415] (Denial Of Service) affected: current, 13.37 and all before ==== The ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, does not restrict the size of values of environment variables, which allows local users to cause a denial of service (memory consumption or NULL pointer dereference) via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, related to (1) the "len +=" statement and (2) the apr_pcalloc function call, a different vulnerability than CVE-2011-3607. ==== [http://cvedetails.com/cve/CVE-2011-3607 CVE-2011-3607] (Overflow, Gain privileges) affected: current, 13.37 and all before ==== Integer overflow in the ap_pregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the mod_setenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow. ==== [http://cvedetails.com/cve/CVE-2011-3368 CVE-2011-3368] affected: current, 13.37 and all before ==== The mod_proxy module in the Apache HTTP Server 1.3.x through 1.3.42, 2.0.x through 2.0.64, and 2.2.x through 2.2.21 does not properly interact with use of (1) RewriteRule and (2) ProxyPassMatch pattern matches for configuration of a reverse proxy, which allows remote attackers to send requests to intranet servers via a malformed URI containing an initial @ (at sign) character. === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code) affected: current, 13.37, and all before ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected: current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. === curl === ==== [http://curl.haxx.se/docs/adv_20120124.html CVE-2012-0036] (Execute Code) affected: current, and all before ==== curl is vulnerable to a data injection attack for certain protocols through control characters embedded or percent-encoded in URLs. ==== [http://curl.haxx.se/docs/adv_20120124B.html CVE-2011-3389] (man-in-the-middle attacks) affected: current, 13.37 ==== curl is vulnerable to a SSL CBC IV vulnerability when built to use OpenSSL for the SSL/TLS layer. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. === mozilla-firefox (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/firefox.html#firefox9, at LEAST: Fixed in Firefox 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) === mozilla-thunderbird (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/thunderbird.html#thunderbird9, at LEAST: Fixed in Thunderbird 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) === seamonkey (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/seamonkey.html#seamonkey2.6, at LEAST: Fixed in SeaMonkey 2.6: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) 460ebf65b951d572ed92f4e51c85ae58aab34f38 650 649 2012-02-10T14:28:17Z Erik 1 httpd up to date wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] (PRNG weakness) affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === proftpd === ==== [http://cvedetails.com/cve/CVE-2011-4130 CVE-2011-4130] (Execute Code) affected: current, 13.37, and all before ==== ([http://bugs.proftpd.org/show_bug.cgi?id=3711 proftpd bug tracker #3711]) Use-after-free vulnerability in the Response API in ProFTPD '''before 1.3.3g''' allows remote authenticated users to execute arbitrary code via vectors involving an error that occurs after an FTP data transfer. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected: current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. === curl === ==== [http://curl.haxx.se/docs/adv_20120124.html CVE-2012-0036] (Execute Code) affected: current, and all before ==== curl is vulnerable to a data injection attack for certain protocols through control characters embedded or percent-encoded in URLs. ==== [http://curl.haxx.se/docs/adv_20120124B.html CVE-2011-3389] (man-in-the-middle attacks) affected: current, 13.37 ==== curl is vulnerable to a SSL CBC IV vulnerability when built to use OpenSSL for the SSL/TLS layer. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. === mozilla-firefox (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/firefox.html#firefox9, at LEAST: Fixed in Firefox 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) === mozilla-thunderbird (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/thunderbird.html#thunderbird9, at LEAST: Fixed in Thunderbird 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) === seamonkey (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/seamonkey.html#seamonkey2.6, at LEAST: Fixed in SeaMonkey 2.6: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) 325c355c4736c26fff473944faf2965cbbe2a3f2 651 650 2012-02-10T14:28:47Z Erik 1 proftpd up to date wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] (PRNG weakness) affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. === php === ==== [http://cvedetails.com/cve/CVE-2011-4885 CVE-2011-4885] (Denial Of Service) affected: current, 13.37 and all before ==== PHP before 5.3.9 computes hash values for form parameters without restricting the ability to trigger hash collisions predictably, which allows remote attackers to cause a denial of service (CPU consumption) by sending many crafted parameters. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. === curl === ==== [http://curl.haxx.se/docs/adv_20120124.html CVE-2012-0036] (Execute Code) affected: current, and all before ==== curl is vulnerable to a data injection attack for certain protocols through control characters embedded or percent-encoded in URLs. ==== [http://curl.haxx.se/docs/adv_20120124B.html CVE-2011-3389] (man-in-the-middle attacks) affected: current, 13.37 ==== curl is vulnerable to a SSL CBC IV vulnerability when built to use OpenSSL for the SSL/TLS layer. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. === mozilla-firefox (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/firefox.html#firefox9, at LEAST: Fixed in Firefox 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) === mozilla-thunderbird (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/thunderbird.html#thunderbird9, at LEAST: Fixed in Thunderbird 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) === seamonkey (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/seamonkey.html#seamonkey2.6, at LEAST: Fixed in SeaMonkey 2.6: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) 874770e79960ec5863254d7cb00aa7ead5483866 652 651 2012-02-10T14:29:23Z Erik 1 php up to date wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] (PRNG weakness) affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. === curl === ==== [http://curl.haxx.se/docs/adv_20120124.html CVE-2012-0036] (Execute Code) affected: current, and all before ==== curl is vulnerable to a data injection attack for certain protocols through control characters embedded or percent-encoded in URLs. ==== [http://curl.haxx.se/docs/adv_20120124B.html CVE-2011-3389] (man-in-the-middle attacks) affected: current, 13.37 ==== curl is vulnerable to a SSL CBC IV vulnerability when built to use OpenSSL for the SSL/TLS layer. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. === mozilla-firefox (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/firefox.html#firefox9, at LEAST: Fixed in Firefox 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) === mozilla-thunderbird (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/thunderbird.html#thunderbird9, at LEAST: Fixed in Thunderbird 9: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) === seamonkey (various issues, all versions impacted) === From http://www.mozilla.org/security/known-vulnerabilities/seamonkey.html#seamonkey2.6, at LEAST: Fixed in SeaMonkey 2.6: *MFSA 2011-58 Crash scaling <video> to extreme sizes *MFSA 2011-57 Crash when plugin removes itself on Mac OS X *MFSA 2011-56 Key detection without JavaScript via SVG animation *MFSA 2011-55 nsSVGValue out-of-bounds access *MFSA 2011-54 Potentially exploitable crash in the YARR regular expression library *MFSA 2011-53 Miscellaneous memory safety hazards (rv:9.0) 17420e6eb3400c211e5b033e79f0304ddbb7c48e 653 652 2012-02-10T14:30:07Z Erik 1 mozilla-* up to date wikitext text/x-wiki Slackware has recently started to be inactive. At the same time, a number of security issues have been found in various components. This page aims at listing them in order to help everyone know which components have known vulnerabilities. The list below is provided as-is. It is meant to be as good as possible but we can't guarantee anything. It is sorted by slackware categories: a/, ap/, d/, ... A more comprehensive effort might appear at some point in the future (binary packages?) but this is currently only a list of packages and their CVEs when applicable and useful. In some cases, we consider pointing out a specific CVE is not useful because of the number of issues (i.e. get the last version; e.g. mozilla-*). The CVEs are typically listed as follow: ${SUMMARY} * Fix: ** Fixed upstream on: ${DATE} ** Available in version: ${UPSTREAM_VERSION_WITH_FIX} (-current ${VERSION_IN_CURRENT}; -stable: ${VERSION_IN_13_37}) ** Upstream commit: ${URL_TO_THE_SPECIFIC_FIX_COMMIT} == a == === cups === ==== [http://cvedetails.com/cve/CVE-2011-3170 CVE-2011-3170] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The gif_read_lzw function in filter/image-gif.c in CUPS 1.4.8 and earlier does not properly handle the first code word in an LZW stream, which allows remote attackers to trigger a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted stream, a different vulnerability than CVE-2011-2896. ==== [http://cvedetails.com/cve/CVE-2011-2896 CVE-2011-2896] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. == d == === perl === ==== [http://cvedetails.com/cve/CVE-2011-2939 CVE-2011-2939] (Denial Of Service, Overflow, Memory corruption) affected: current, 13.37 through 10.0 ==== Off-by-one error in the decode_xs function in Unicode/Unicode.xs in the Encode module before 2.44, as used in Perl before 5.15.6, might allow context-dependent attackers to cause a denial of service (memory corruption) via a crafted Unicode string, which triggers a heap-based buffer overflow [http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2939 (on cve.mitre.org)]. * Fix: ** Fixed upstream on: Tue, 9 Aug 2011 ** Available in version: 5.14.2 (-current: 5.14.0; -stable: 5.12.3) ** Commit: http://perl5.git.perl.org/perl.git/commitdiff/e46d973584785af1f445c4dedbee4243419cb860#patch5 === ruby === ==== [http://cvedetails.com/cve/CVE-2011-2705 CVE-2011-2705] (PRNG weakness) affected: current, 13.37 and all before ==== The SecureRandom.random_bytes function in lib/securerandom.rb in Ruby before 1.8.7-p352 and 1.9.x before 1.9.2-p290 relies on PID values for initialization, which makes it easier for context-dependent attackers to predict the result string by leveraging knowledge of random strings obtained in an earlier process with the same PID. ==== [http://cvedetails.com/cve/CVE-2011-0188 CVE-2011-0188] (Denial Of Service, Execute Code) affected: current, 13.37 and all before ==== The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue." == e == === emacs === == k == === kernel === == l == === t1lib === ==== [http://cvedetails.com/cve/CVE-2011-1554 CVE-2011-1554] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== Off-by-one error in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory read, integer overflow, and invalid pointer dereference, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1553 CVE-2011-1553] (Denial Of Service) affected: current, 13.37 and all before ==== Use-after-free vulnerability in t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, allows remote attackers to cause a denial of service (application crash) via a PDF document containing a crafted Type 1 font that triggers an invalid memory write, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-1552 CVE-2011-1552] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, reads from invalid memory locations, which allows remote attackers to cause a denial of service (application crash) via a crafted Type 1 font in a PDF document, a different vulnerability than CVE-2011-0764. ==== [http://cvedetails.com/cve/CVE-2011-0764 CVE-2011-0764] (Execute Code) affected: current, 13.37 and all before ==== t1lib 5.1.2 and earlier, as used in Xpdf before 3.02pl6 and other products, uses an invalid pointer in conjunction with a dereference operation, which allows remote attackers to execute arbitrary code via a crafted Type 1 font in a PDF document, as demonstrated by testz.2184122398.pdf. === libxml2 === ==== [http://cvedetails.com/cve/CVE-2011-1944 CVE-2011-1944] (Denial Of Service, Execute Code, Overflow) affected: current, 13.37 and all before ==== Integer overflow in xpath.c in libxml2 2.6.x through 2.6.32 and 2.7.x through 2.7.8, and libxml 1.8.16 and earlier, allows context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted XML file that triggers a heap-based buffer overflow when adding a new namespace node, related to handling of XPath expressions. == n == === dhcp === ==== [http://cvedetails.com/cve/CVE-2011-4868 CVE-2011-4868] (Denial Of Service) affected: current, 13.37, and all before ==== The logging functionality in dhcpd in ISC DHCP before 4.2.3-P2, when using Dynamic DNS (DDNS) and issuing IPv6 addresses, does not properly handle the DHCPv6 lease structure, which allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via crafted packets related to a lease-status update. ==== [http://cvedetails.com/cve/CVE-2011-4539 CVE-2011-4539] (Denial Of Service) affected: current, 13.37, 13.1 ==== dhcpd in ISC DHCP 4.x before 4.2.3-P1 and 4.1-ESV before 4.1-ESV-R4 does not properly handle regular expressions in dhcpd.conf, which allows remote attackers to cause a denial of service (daemon crash) via a crafted request packet. ==== [http://cvedetails.com/cve/CVE-2011-2749 CVE-2011-2749] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted BOOTP packet. ==== [http://cvedetails.com/cve/CVE-2011-2748 CVE-2011-2748] (Denial Of Service) affected: current, 13.37, and all before ==== The server in ISC DHCP 3.x and 4.x before 4.2.2, 3.1-ESV before 3.1-ESV-R3, and 4.1-ESV before 4.1-ESV-R3 allows remote attackers to cause a denial of service (daemon exit) via a crafted DHCP packet. ==== [http://cvedetails.com/cve/CVE-2011-3379 CVE-2011-3379] (Execute Code) affected: current, 13.37 through 12.0 ==== The is_a function in PHP 5.3.7 and 5.3.8 triggers a call to the __autoload function, which makes it easier for remote attackers to execute arbitrary code by providing a crafted URL and leveraging potentially unsafe behavior in certain PEAR packages and custom autoloaders. === curl === ==== [http://curl.haxx.se/docs/adv_20120124.html CVE-2012-0036] (Execute Code) affected: current, and all before ==== curl is vulnerable to a data injection attack for certain protocols through control characters embedded or percent-encoded in URLs. ==== [http://curl.haxx.se/docs/adv_20120124B.html CVE-2011-3389] (man-in-the-middle attacks) affected: current, 13.37 ==== curl is vulnerable to a SSL CBC IV vulnerability when built to use OpenSSL for the SSL/TLS layer. == x == === libXfont === ==== [http://cvedetails.com/cve/CVE-2011-2895 CVE-2011-2895] (Execute Code, Overflow) affected: current, 13.37 and all before ==== The LZW decompressor in (1) the BufCompressedFill function in fontfile/decompress.c in X.Org libXfont before 1.4.4 and (2) compress/compress.c in 4.3BSD, as used in zopen.c in OpenBSD before 3.8, FreeBSD, NetBSD 4.0.x and 5.0.x before 5.0.3 and 5.1.x before 5.1.1, FreeType 2.1.9, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows context-dependent attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2896. == xap == === pidgin === ==== [http://cvedetails.com/cve/CVE-2011-4603 CVE-2011-4603] (Denial Of Service) affected: current, 13.37 and all before ==== The silc_channel_message function in ops.c in the SILC protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted message, a different vulnerability than CVE-2011-3594. ==== [http://cvedetails.com/cve/CVE-2011-4602 CVE-2011-4602] (Denial Of Service) affected: current, 13.37 and all before ==== The XMPP protocol plugin in libpurple in Pidgin before 2.10.1 does not properly handle missing fields in (1) voice-chat and (2) video-chat stanzas, which allows remote attackers to cause a denial of service (application crash) via a crafted message. ==== [http://cvedetails.com/cve/CVE-2011-4601 CVE-2011-4601] (Denial Of Service) affected: current, 13.37 and all before ==== family_feedbag.c in the oscar protocol plugin in libpurple in Pidgin before 2.10.1 does not perform the expected UTF-8 validation on message data, which allows remote attackers to cause a denial of service (application crash) via a crafted (1) AIM or (2) ICQ message associated with buddy-list addition. ==== [http://cvedetails.com/cve/CVE-2011-3594 CVE-2011-3594] (Denial Of Service, Overflow) affected: current, 13.37 and all before ==== The g_markup_escape_text function in the SILC protocol plug-in in libpurple 2.10.0 and earlier, as used in Pidgin and possibly other products, allows remote attackers to cause a denial of service (crash) via invalid UTF-8 sequences that trigger use of invalid pointers and an out-of-bounds read, related to interactions with certain versions of glib2. ==== [http://cvedetails.com/cve/CVE-2011-3184 CVE-2011-3184] (Denial Of Service) affected: current, 13.37 and all before ==== The msn_httpconn_parse_data function in httpconn.c in the MSN protocol plugin in libpurple in Pidgin before 2.10.0 does not properly handle HTTP 100 responses, which allows remote attackers to cause a denial of service (incorrect memory access and application crash) via vectors involving a crafted server message. ==== [http://cvedetails.com/cve/CVE-2011-2943 CVE-2011-2943] (Denial Of Service) affected: current, 13.37 and all before ==== The irc_msg_who function in msgs.c in the IRC protocol plugin in libpurple 2.8.0 through 2.9.0 in Pidgin before 2.10.0 does not properly validate characters in nicknames, which allows user-assisted remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted nickname that is not properly handled in a WHO response. 99ba4909f45381b03898a07fa88371a205c941a0 Third Party Package Managers 0 170 658 198 2012-03-17T03:09:21Z Vegasseo 268 /* Purpose */ wikitext text/x-wiki = Purpose = The mere mention of third party package managers (such as [http://software.jaos.org/#slapt-get slapt-get] and [http://swaret.sourceforge.net/ swaret]) often results in a quick admonishment from Slackware users, and unfortunately, the only reason given in most cases is something along the lines of "they'll break your system." This leaves users in a state of confusion, as the respective web sites of these third party tools tout them as an improvement. The purpose of this page is to explain why and how these tools will often result in system breakage[http://www.bobsseo.com .] = Overview of Slackware's Native Package Tools = Slackware's native package management utilities (<tt>pkgtool(8)</tt>, <tt>installpkg(8)</tt>, <tt>removepkg(8)</tt>, and <tt>upgradepkg(8)</tt>) do not support any form of dependency checking. A Slackware package is essentially a compressed tarball of the files associated with an application, a file containing a short description of the application (<tt>./install/slack-desc</tt>), and a script that performs some essential post-installation tasks (<tt>./install/doinst.sh</tt>). Installing a Slackware package simply copies those files to the filesystem and then executes the post-install script, while removing the package removes the files and reverses the post-install script. As result, there is no guarantee that libraries and other files needed by a particular package are already present on the system when that particular package is installed. = Overview of Selected Third Party Tools = As stated above, Slackware's native package management suite neither has nor supports dependency resolution. Because the third-party add-ons all use Slackware's native package tools, they are bound by this same limitation, at least to some extent, but some of them try to mitigate this in various ways; the following is an overview. == swaret == === Overview === Swaret makes use of an unofficial file that tries to list all package dependencies based on output of <tt>ldd(1)</tt>. The idea is that by running <tt>ldd(1)</tt> on some binary or shared object, you can see what that file is linked to, and then see what package(s) contain those files, and then install those packages. === Potential Problems === Since some library developers don't see the need to update their shared object version strings when making changes that are incompatible with the previous release, it's easy to need a newer release of some package but for swaret to not be able to determine this. Since swaret is meant for upgrading packages, it will fail to roll back a package's version number if this occurs in the upstream Slackware tree for some reason. == slapt-get == === Overview === Slapt-get makes use of additional files (<tt>slack-required</tt>, <tt>slack-suggests</tt>, <tt>slack-conflicts</tt>) inside a Slackware package. Essentially, if a package is listed in <tt>slack-required</tt>, then slapt-get will install or upgrade it first; if a package is listed in <tt>slack-conflicts</tt>, then slapt-get will remove it first; if a package is listed in <tt>slack-suggests</tt>, then slapt-get will offer to install it in addition to the packages noted in <tt>slack-required</tt>. === Potential Problems === Since official Slackware packages do not have the <tt>slack-required</tt> and other files needed for slapt-get to determine dependencies, it is not able to resolve dependencies for them. Therefore, slapt-get's perceived usefulness is in keeping unofficial third-party packages (or at least those which do contain the necessary files) up to date. See the discussion below for more information on unofficial third-party packages. Also, slapt-get, like swaret, will not "downgrade" a package to a previous version if it occurs in the upstream Slackware tree. == sbopkg == === Overview === [http://www.sbopkg.org/ SBopkg] is a tool for automating the download, compile and package build for SBo projects hosted in the [http://www.slackbuilds.org SlackBuilds.org ] repository. SBo packages are reviewed by team members for completeness as well as applicability to each Slackware release. SBo package documentation includes information regarding dependencies. = Third Party (Unofficial) Packages = This subject can elicit opinions just as strong as the topic of third-party package managers, and there are knowledgeable people on both sides of the issue. Third party packages can obviously present a security risk, as there's no way to know what's really in them, but for the average user, there are (amazingly enough) bigger concerns. On one hand, the user wants a package of some application that's not included with Slackware, but he doesn't want it to create other problems. Oftentimes, third party packages are not built on "clean" systems -- that is, the computer on which they're built has quite a few other non-official packages installed -- so the resulting package needs those other things to work properly. If the packager doesn't make note of all the different packages that this one depends on, the user installs it only to find that it still doesn't work. Even worse, those other dependencies are often not even necessary if the package is built on a clean system - if the other package had not been present, the new one obviously wouldn't have linked against it. Installing third party packages from two different packagers can cause problems. Package A might depend on Package B, which depends on Package C and optionally Package D. If the person who built Package B only linked it against Package C (not D), but the Package A expects Package B to have both Package C and Package D dependencies, then Package A may not work, even though you (think you) have everything it needs installed. Another frequent problem with third party packages is encountered by replacing stock (official) packages with unofficial ones. In addition to the library version issues mentioned in the swaret discussion, newer package versions often require newer versions of other packages, which might require newer versions of still other packages, and before you know it, you have replaced a sizable portion of the official Slackware packages. If/when something breaks, you will find it very difficult to find someone willing to help you, as there's no way to know how much effect the unofficial packages are having. = Slackware -current = Slackware -current is *not* a stable release of Slackware. It is intended for advanced users who are familiar with how Slackware works to test (and report success/failure, find and fix bugs, etcetera) the new packages leading to the next stable release of Slackware. Packages are constantly being added, removed, split up, merged, and otherwise mangled, and third party package managers (swaret/slapt-get/et al) should not be expected to know how to deal with this. If you use one of those tools while trying to run Slackware -current and you don't understand how they work and their limitations, you *will* break your system and you will *not* have much luck finding someone who is sympathetic. You have been warned. You may be wondering why these tools have trouble with -current. I won't even attempt to detail all of the potential issues, but here are a couple: 1. When upgrading to -current with one of these tools, the package sets are upgraded in alphabetical order (and the packages therein also in alphabetical order). This means that a/bash will be upgraded before a/glibc-solibs. If bash has been recompiled against newer glibc, and you upgrade to that new version, it will promptly stop working due to the fact that the needed version of glibc has not been upgraded yet; at that point, you are stuck with a "chicken and egg" problem. 2. Third party package tools will not install *new* packages that have been added in Slackware -current. This is not a bug - it's a feature; if you purposefully didn't install something, then you don't want your automatic package updater reinstalling it. However, when a package depends on something else that has been added or split out of an existing package, and your add-on package manager upgrades the existing package but doesn't install the added one, then the (upgraded) existing package will not work any more. = Solutions and Suggestions = For upgrading to Slackware -current, there is only *one* supported method: <tt>UPGRADE.TXT</tt> -- you can find this file on any Slackware mirror. Note that this is also the only supported method to upgrade from one stable release of Slackware to another. For keeping up to date on post-release patches added to a stable release of Slackware, you will *usually* be okay to use one of the third party package managers. You should still read the <tt>ChangeLog.txt</tt> before doing any upgrades, though, as new packages are occasionally added in /patches when circumstances require it. For software not included in official Slackware, consider building it yourself or using a SlackBuild script from one of the projects which provides them. One of the regular Slackware contributors, PiterPUNK, wrote and maintains a third-party package manager that minimizes all of the risks mentioned above. [http://slackpkg.org Slackpkg] does not support downloading or installing unofficial packages, and it has provisions to install any added packages and uninstall any removed packages as well as the normal install/upgrade/remove routines. Another third party package manager that promotes good practices is [http://slackroll.sourceforge.net/ SlackRoll] (see [[SlackRoll Tutorial|tutorial]]). Its philosophy is similar to that of Slackpkg but it is not included as part of Slackware. Programmed in Python, it is faster, has more features and detects more events from Slackware -current. However, the initial setup and workflow are a bit more complex. = See Also = * <tt>pkgtool(8)</tt> -- man 8 pkgtool * <tt>installpkg(8)</tt> -- man 8 installpkg * <tt>removepkg(8)</tt> -- man 8 removepkg * <tt>upgradepkg(8)</tt> -- man 8 upgradepkg * <tt>makepkg(8)</tt> -- man 8 makepkg * <tt>explodepkg(8)</tt> -- man 8 explodepkg = TODO = * Add links to other wiki pages that are related to this topic (add to "See Also" above) * Add hyperlinks to slapt-get, swaret, and other projects mentioned on this page * Others? [[Category:Information]] [[Category:Tutorials]] 88722135f2668827f33b5fbe260080d8a6a4dff5 659 658 2012-03-17T18:24:51Z Erik 1 Reverted edits by [[Special:Contributions/Vegasseo|Vegasseo]] ([[User talk:Vegasseo|talk]]) to last revision by [[User:Erik|Erik]] wikitext text/x-wiki = Purpose = The mere mention of third party package managers (such as [http://software.jaos.org/#slapt-get slapt-get] and [http://swaret.sourceforge.net/ swaret]) often results in a quick admonishment from Slackware users, and unfortunately, the only reason given in most cases is something along the lines of "they'll break your system." This leaves users in a state of confusion, as the respective web sites of these third party tools tout them as an improvement. The purpose of this page is to explain why and how these tools will often result in system breakage. = Overview of Slackware's Native Package Tools = Slackware's native package management utilities (<tt>pkgtool(8)</tt>, <tt>installpkg(8)</tt>, <tt>removepkg(8)</tt>, and <tt>upgradepkg(8)</tt>) do not support any form of dependency checking. A Slackware package is essentially a compressed tarball of the files associated with an application, a file containing a short description of the application (<tt>./install/slack-desc</tt>), and a script that performs some essential post-installation tasks (<tt>./install/doinst.sh</tt>). Installing a Slackware package simply copies those files to the filesystem and then executes the post-install script, while removing the package removes the files and reverses the post-install script. As result, there is no guarantee that libraries and other files needed by a particular package are already present on the system when that particular package is installed. = Overview of Selected Third Party Tools = As stated above, Slackware's native package management suite neither has nor supports dependency resolution. Because the third-party add-ons all use Slackware's native package tools, they are bound by this same limitation, at least to some extent, but some of them try to mitigate this in various ways; the following is an overview. == swaret == === Overview === Swaret makes use of an unofficial file that tries to list all package dependencies based on output of <tt>ldd(1)</tt>. The idea is that by running <tt>ldd(1)</tt> on some binary or shared object, you can see what that file is linked to, and then see what package(s) contain those files, and then install those packages. === Potential Problems === Since some library developers don't see the need to update their shared object version strings when making changes that are incompatible with the previous release, it's easy to need a newer release of some package but for swaret to not be able to determine this. Since swaret is meant for upgrading packages, it will fail to roll back a package's version number if this occurs in the upstream Slackware tree for some reason. == slapt-get == === Overview === Slapt-get makes use of additional files (<tt>slack-required</tt>, <tt>slack-suggests</tt>, <tt>slack-conflicts</tt>) inside a Slackware package. Essentially, if a package is listed in <tt>slack-required</tt>, then slapt-get will install or upgrade it first; if a package is listed in <tt>slack-conflicts</tt>, then slapt-get will remove it first; if a package is listed in <tt>slack-suggests</tt>, then slapt-get will offer to install it in addition to the packages noted in <tt>slack-required</tt>. === Potential Problems === Since official Slackware packages do not have the <tt>slack-required</tt> and other files needed for slapt-get to determine dependencies, it is not able to resolve dependencies for them. Therefore, slapt-get's perceived usefulness is in keeping unofficial third-party packages (or at least those which do contain the necessary files) up to date. See the discussion below for more information on unofficial third-party packages. Also, slapt-get, like swaret, will not "downgrade" a package to a previous version if it occurs in the upstream Slackware tree. == sbopkg == === Overview === [http://www.sbopkg.org/ SBopkg] is a tool for automating the download, compile and package build for SBo projects hosted in the [http://www.slackbuilds.org SlackBuilds.org ] repository. SBo packages are reviewed by team members for completeness as well as applicability to each Slackware release. SBo package documentation includes information regarding dependencies. = Third Party (Unofficial) Packages = This subject can elicit opinions just as strong as the topic of third-party package managers, and there are knowledgeable people on both sides of the issue. Third party packages can obviously present a security risk, as there's no way to know what's really in them, but for the average user, there are (amazingly enough) bigger concerns. On one hand, the user wants a package of some application that's not included with Slackware, but he doesn't want it to create other problems. Oftentimes, third party packages are not built on "clean" systems -- that is, the computer on which they're built has quite a few other non-official packages installed -- so the resulting package needs those other things to work properly. If the packager doesn't make note of all the different packages that this one depends on, the user installs it only to find that it still doesn't work. Even worse, those other dependencies are often not even necessary if the package is built on a clean system - if the other package had not been present, the new one obviously wouldn't have linked against it. Installing third party packages from two different packagers can cause problems. Package A might depend on Package B, which depends on Package C and optionally Package D. If the person who built Package B only linked it against Package C (not D), but the Package A expects Package B to have both Package C and Package D dependencies, then Package A may not work, even though you (think you) have everything it needs installed. Another frequent problem with third party packages is encountered by replacing stock (official) packages with unofficial ones. In addition to the library version issues mentioned in the swaret discussion, newer package versions often require newer versions of other packages, which might require newer versions of still other packages, and before you know it, you have replaced a sizable portion of the official Slackware packages. If/when something breaks, you will find it very difficult to find someone willing to help you, as there's no way to know how much effect the unofficial packages are having. = Slackware -current = Slackware -current is *not* a stable release of Slackware. It is intended for advanced users who are familiar with how Slackware works to test (and report success/failure, find and fix bugs, etcetera) the new packages leading to the next stable release of Slackware. Packages are constantly being added, removed, split up, merged, and otherwise mangled, and third party package managers (swaret/slapt-get/et al) should not be expected to know how to deal with this. If you use one of those tools while trying to run Slackware -current and you don't understand how they work and their limitations, you *will* break your system and you will *not* have much luck finding someone who is sympathetic. You have been warned. You may be wondering why these tools have trouble with -current. I won't even attempt to detail all of the potential issues, but here are a couple: 1. When upgrading to -current with one of these tools, the package sets are upgraded in alphabetical order (and the packages therein also in alphabetical order). This means that a/bash will be upgraded before a/glibc-solibs. If bash has been recompiled against newer glibc, and you upgrade to that new version, it will promptly stop working due to the fact that the needed version of glibc has not been upgraded yet; at that point, you are stuck with a "chicken and egg" problem. 2. Third party package tools will not install *new* packages that have been added in Slackware -current. This is not a bug - it's a feature; if you purposefully didn't install something, then you don't want your automatic package updater reinstalling it. However, when a package depends on something else that has been added or split out of an existing package, and your add-on package manager upgrades the existing package but doesn't install the added one, then the (upgraded) existing package will not work any more. = Solutions and Suggestions = For upgrading to Slackware -current, there is only *one* supported method: <tt>UPGRADE.TXT</tt> -- you can find this file on any Slackware mirror. Note that this is also the only supported method to upgrade from one stable release of Slackware to another. For keeping up to date on post-release patches added to a stable release of Slackware, you will *usually* be okay to use one of the third party package managers. You should still read the <tt>ChangeLog.txt</tt> before doing any upgrades, though, as new packages are occasionally added in /patches when circumstances require it. For software not included in official Slackware, consider building it yourself or using a SlackBuild script from one of the projects which provides them. One of the regular Slackware contributors, PiterPUNK, wrote and maintains a third-party package manager that minimizes all of the risks mentioned above. [http://slackpkg.org Slackpkg] does not support downloading or installing unofficial packages, and it has provisions to install any added packages and uninstall any removed packages as well as the normal install/upgrade/remove routines. Another third party package manager that promotes good practices is [http://slackroll.sourceforge.net/ SlackRoll] (see [[SlackRoll Tutorial|tutorial]]). Its philosophy is similar to that of Slackpkg but it is not included as part of Slackware. Programmed in Python, it is faster, has more features and detects more events from Slackware -current. However, the initial setup and workflow are a bit more complex. = See Also = * <tt>pkgtool(8)</tt> -- man 8 pkgtool * <tt>installpkg(8)</tt> -- man 8 installpkg * <tt>removepkg(8)</tt> -- man 8 removepkg * <tt>upgradepkg(8)</tt> -- man 8 upgradepkg * <tt>makepkg(8)</tt> -- man 8 makepkg * <tt>explodepkg(8)</tt> -- man 8 explodepkg = TODO = * Add links to other wiki pages that are related to this topic (add to "See Also" above) * Add hyperlinks to slapt-get, swaret, and other projects mentioned on this page * Others? [[Category:Information]] [[Category:Tutorials]] 87b633ead33c6105087ad9f9bdb3b153f769897e Writing A SlackBuild Script 0 16 661 591 2012-03-27T15:42:57Z Badassbob 270 /* Getting Started */ wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like linuxpackages.net, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget http://www.latex2html.org/~latex2ht/current/latex2html-2002-2-1.tar.gz # 03.27.2012 Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar -xzf latex2html-2002-2-1.tar.gz || exit 1 = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ 43ab669844750a4b9351243609edb30805849c87 Chromium browser 0 249 662 590 2012-03-29T11:11:39Z Perlna 272 /* Resources */ wikitext text/x-wiki [[Category:Tutorials]] == Introduction == Chromium is an open source web browser from Google. It is based on the WebKit rendering engine and is the upstream project for Google's popular Chrome Web Browser. Keep in mind that Chromium is the '''testing''' branch of the Chrome web browser, and is not recommended for mission-critical systems. Consider using [http://www.google.com/chrome Google Chrome] or [http://www.mozilla.org/en-US/firefox/ Mozilla Firefox] for production systems. === Use Case === This tutorial explains how to install the latest Chromium build on Slackware and automate the process of updating it regularly. It is aimed at users on a personal desktop or laptop, especially on a single-user system. While the [http://slackbuilds.org slackbuilds.org] project provides excellent quality build scripts for Chromium, downloading 140MB+ source code and doing compilations that often take more than a couple of hours to complete is generally not feasible for people with laptops, slower computers or slow internet connections. Therefore, this guide aims on how to automate the process of installing and updating Chromium using daily binary builds that are much smaller in size and take up negligible resources for the install and update process, thus helping the user always run the latest and greatest builds without the hassle of downloading and compiling the source code. == Getting started == Chromium depends on <code>GConf</code> and <code>ORBit2</code>, and these should be installed first. Newer versions may also need the PAM library. === Slackware 13.37 === The above mentioned dependencies are included in the '''extra/''' tree of Slackware 13.37, so these can be simply installed by : <pre> # slackpkg install GConf ORBit2 google-chrome-pam-solibs </pre> === Slackware 13.1 === GConf and ORBit2 are availabe at the [http://slackbuilds.org slackbuilds.org] repository. These can be installed manually or using [http://sbopkg.org Sbopkg] : <pre> # sbopkg -i 'ORBit2 GConf' </pre> Get the <code>google-chrome-pam-solibs</code> package [http://slackware.osuosl.org/slackware-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-i486-1.txz 32-bit] [http://slackware.osuosl.org/slackware64-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-x86_64-1.txz 64-bit] and install it : <pre> # installpkg ./google-chrome-pam-solibs-1.1.3-x86_64-1.txz </pre> == Getting and installing the latest Chromium build == Google maintains a repository of daily chromium builds that you can get from [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux/ here] (32bit) or [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux_x64/ here] for 64 bit. Scroll down to the bottom and navigate to the latest build directory, and download the 'chrome-linux.zip' file there. Extract the zip file to a place of your liking (I like to keep mine in /home/username/soft), and run the 'chrome-wrapper' binary that will run Chromium and also generate a 'chromium-dev.desktop' file in /home/user/.local/share/applications/ and a Chromium entry will appear in your KDE or Xfce menu. Copy that file to your desktop if you prefer a desktop shortcut. To upgrade Chromium, just download the latest zip file and extract it where you previously did, overwriting the previous files. == Automating the Process == The following script helps to automate the process of installing and upgrading Chromium. Edit the <code>INSTALLDIR</code> variable to your liking - that is the place where chromium will be installed. Its recommended to keep it in a folder in your home directory to make it easy to manage. make sure the folder exists before running the script, or the script will fail. <pre> #!/bin/bash # Installation directory - change this to a directory of your choice # Please make sure the directory exists first, or the script won't work INSTALLDIR=$HOME/soft # Determine the architecture of the machine in use and set variables accordingly if [ -z "$ARCH" ]; then case "$( uname -m )" in i686) ARCH=i686 ;; *) ARCH=$( uname -m ) ;; esac fi if [ "$ARCH" = "i686" ];then DIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then DIRSUFFIX="_x64" else echo "The ARCH should be either i686 or x86_64. Exiting." exit fi # Determine the build number of the latest build LATESTBUILD=$(curl http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/LAST_CHANGE) # The URL to download from CHROMEURL="http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux"$DIRSUFFIX/$LATESTBUILD/"chrome-linux.zip" cd $INSTALLDIR if [ -e chrome-linux.zip ]; then # Check to see if `chrome-linux.zip` already exists mv chrome-linux.zip chrome-linux.zip.old # if it does, rename it to chrome-linux.zip.old as backup fi # in case the current build has problems wget -O chrome-linux.zip $CHROMEURL unzip -u -o ./chrome-linux.zip </pre> To automate the process, first save the script as '''chromium-update.sh''' and add it to your users's cron jobs. Here is an example on how to set it up : <pre> $ cd $HOME $ mkdir .cron $ cp ./chromium-update.sh ./.cron/ $ chmod a+x ./.cron/chromium-update.sh $ crontab -e </pre> Add the following to your crontab : <pre> # Run daily cron job at 13:20 every day: 20 13 * * * ~/.cron/chromium-update.sh 1> /dev/null </pre> This will run the script at 13:20 every day. See <code>man crontab</code> for more on how to customize your cron jobs. == Resources == [http://www.chromium.org/Home Chromium home page] [http://en.wikipedia.org/wiki/Chromium_(web_browser)#Differences_from_Google_Chrome Differences from Google Chrome] [http://www.spywaretoolshed.com/ Spyware doctor] [https://wiki.archlinux.org/index.php/Chromium#Configuration Tips on configuration and customization from Archwiki] 00ea7832d17f2e936af4a5e996fe16ef61a2efda 663 662 2012-03-29T14:08:01Z Erik 1 Reverted edits by [[Special:Contributions/Perlna|Perlna]] ([[User talk:Perlna|talk]]) to last revision by [[User:Klickback|Klickback]] wikitext text/x-wiki [[Category:Tutorials]] == Introduction == Chromium is an open source web browser from Google. It is based on the WebKit rendering engine and is the upstream project for Google's popular Chrome Web Browser. Keep in mind that Chromium is the '''testing''' branch of the Chrome web browser, and is not recommended for mission-critical systems. Consider using [http://www.google.com/chrome Google Chrome] or [http://www.mozilla.org/en-US/firefox/ Mozilla Firefox] for production systems. === Use Case === This tutorial explains how to install the latest Chromium build on Slackware and automate the process of updating it regularly. It is aimed at users on a personal desktop or laptop, especially on a single-user system. While the [http://slackbuilds.org slackbuilds.org] project provides excellent quality build scripts for Chromium, downloading 140MB+ source code and doing compilations that often take more than a couple of hours to complete is generally not feasible for people with laptops, slower computers or slow internet connections. Therefore, this guide aims on how to automate the process of installing and updating Chromium using daily binary builds that are much smaller in size and take up negligible resources for the install and update process, thus helping the user always run the latest and greatest builds without the hassle of downloading and compiling the source code. == Getting started == Chromium depends on <code>GConf</code> and <code>ORBit2</code>, and these should be installed first. Newer versions may also need the PAM library. === Slackware 13.37 === The above mentioned dependencies are included in the '''extra/''' tree of Slackware 13.37, so these can be simply installed by : <pre> # slackpkg install GConf ORBit2 google-chrome-pam-solibs </pre> === Slackware 13.1 === GConf and ORBit2 are availabe at the [http://slackbuilds.org slackbuilds.org] repository. These can be installed manually or using [http://sbopkg.org Sbopkg] : <pre> # sbopkg -i 'ORBit2 GConf' </pre> Get the <code>google-chrome-pam-solibs</code> package [http://slackware.osuosl.org/slackware-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-i486-1.txz 32-bit] [http://slackware.osuosl.org/slackware64-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-x86_64-1.txz 64-bit] and install it : <pre> # installpkg ./google-chrome-pam-solibs-1.1.3-x86_64-1.txz </pre> == Getting and installing the latest Chromium build == Google maintains a repository of daily chromium builds that you can get from [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux/ here] (32bit) or [http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux_x64/ here] for 64 bit. Scroll down to the bottom and navigate to the latest build directory, and download the 'chrome-linux.zip' file there. Extract the zip file to a place of your liking (I like to keep mine in /home/username/soft), and run the 'chrome-wrapper' binary that will run Chromium and also generate a 'chromium-dev.desktop' file in /home/user/.local/share/applications/ and a Chromium entry will appear in your KDE or Xfce menu. Copy that file to your desktop if you prefer a desktop shortcut. To upgrade Chromium, just download the latest zip file and extract it where you previously did, overwriting the previous files. == Automating the Process == The following script helps to automate the process of installing and upgrading Chromium. Edit the <code>INSTALLDIR</code> variable to your liking - that is the place where chromium will be installed. Its recommended to keep it in a folder in your home directory to make it easy to manage. make sure the folder exists before running the script, or the script will fail. <pre> #!/bin/bash # Installation directory - change this to a directory of your choice # Please make sure the directory exists first, or the script won't work INSTALLDIR=$HOME/soft # Determine the architecture of the machine in use and set variables accordingly if [ -z "$ARCH" ]; then case "$( uname -m )" in i686) ARCH=i686 ;; *) ARCH=$( uname -m ) ;; esac fi if [ "$ARCH" = "i686" ];then DIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then DIRSUFFIX="_x64" else echo "The ARCH should be either i686 or x86_64. Exiting." exit fi # Determine the build number of the latest build LATESTBUILD=$(curl http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/LAST_CHANGE) # The URL to download from CHROMEURL="http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux"$DIRSUFFIX/$LATESTBUILD/"chrome-linux.zip" cd $INSTALLDIR if [ -e chrome-linux.zip ]; then # Check to see if `chrome-linux.zip` already exists mv chrome-linux.zip chrome-linux.zip.old # if it does, rename it to chrome-linux.zip.old as backup fi # in case the current build has problems wget -O chrome-linux.zip $CHROMEURL unzip -u -o ./chrome-linux.zip </pre> To automate the process, first save the script as '''chromium-update.sh''' and add it to your users's cron jobs. Here is an example on how to set it up : <pre> $ cd $HOME $ mkdir .cron $ cp ./chromium-update.sh ./.cron/ $ chmod a+x ./.cron/chromium-update.sh $ crontab -e </pre> Add the following to your crontab : <pre> # Run daily cron job at 13:20 every day: 20 13 * * * ~/.cron/chromium-update.sh 1> /dev/null </pre> This will run the script at 13:20 every day. See <code>man crontab</code> for more on how to customize your cron jobs. == Resources == [http://www.chromium.org/Home Chromium home page] [http://en.wikipedia.org/wiki/Chromium_(web_browser)#Differences_from_Google_Chrome Differences from Google Chrome] [https://wiki.archlinux.org/index.php/Chromium#Configuration Tips on configuration and customization from Archwiki] ca0a7556a92fadafc237a400f8e29766f85967e2 Macbook Air 1,1 0 275 667 2012-04-13T07:08:16Z Gr4nf 276 Created page with "The following are (incomplete) instructions to install and configure Slackware 13.37 on the Macbook Air 1,1 (from early 2008). ===What You'll Need=== *External DVD-R drive (No..." wikitext text/x-wiki The following are (incomplete) instructions to install and configure Slackware 13.37 on the Macbook Air 1,1 (from early 2008). ===What You'll Need=== *External DVD-R drive (No success so far with bootable USB drives) *Bootable disc with some sort of disk utility (Optimally, the Snow Leopard DVD) *Slackware 13.37 DVD (32 bit is best, but it's up to you) *Bootable rEFIt CD ==Overview== The plan of action is this: c6e653527619087349616e52a28d2f698cd8466b 668 667 2012-04-13T07:11:36Z Gr4nf 276 wikitext text/x-wiki The following are (incomplete) instructions to install and configure Slackware 13.37 on the Macbook Air 1,1 (from early 2008). ===What You'll Need=== *External DVD-R drive (No success so far with bootable USB drives) *Bootable disc with some sort of disk utility (Optimally, the Snow Leopard DVD) *Slackware 13.37 DVD (32 bit is best, but it's up to you) *Bootable rEFIt CD ==Overview== The plan of action is this: [[Category:Hardware]] 034bd774330a000b2141850b10d45cc2f0e54087 669 668 2012-04-13T08:50:32Z Gr4nf 276 wikitext text/x-wiki The following are (incomplete) instructions to install and configure Slackware 13.37 on the Macbook Air 1,1 (from early 2008). ===What You'll Need=== *External DVD-R drive (No success so far with bootable USB drives) *Bootable disc with some sort of disk utility (Optimally, the Snow Leopard DVD) *Slackware 13.37 DVD (32 bit is best, but it's up to you) *Bootable rEFIt CD ==Overview== The installation itself is not at all different from a slackware install on any other intel machine. The difficult parts are configuring afterwards and getting the machine to boot to an MBR scheme. Luckily, rEFIt does some arcane magic with it's partition manager that can set your scheme up as Hybrid GPT/MBR. Which brings us to step 1. ==Partitioning== Okay, the first step is to partition your hard drive with the MBR scheme. Boot into the Snow Leopard DVD and run the Disk Utility. Re-partition the hard drive as free space, and make sure to select "Master Boot Record" in the Advanced menu. Now boot into your slackware disk. It will show up in the alt boot menu without any configuration. Partition slackware as you would for any other install and take note of the path to the boot partition (probably /dev/sda2). ==Installation== Install slackware as you would on any intel machine. Make sure to select option 1 when installing the LILO boot loader. ==Make it Bootable== Linux will not initially be bootable since the Apple firmware hates MBR drives. If you need to boot into your slackware install at any time, just put the slack disk back in and follow the instructions in the boot: menu to boot to the hard drive. To make the drive itself bootable, start up into the rEFIt cd. One of the options is the partition manager. Starting that will scan your disk and give you the option to configure it into Hybrid GPT/MBR. Do that. If all went well, your disk is now bootable! ===If it takes forever to boot=== If it is taking forever to go from the pale blue startup screen to the LILO boot loader (30 seconds or so), you need to bless the partition from a terminal with the bless utility. The Snow Leopard DVD has such a terminal. Boot back into that, start up a terminal, and run the command: bless –device /dev/disk0s2 –setboot –legacy –verbose Where the device is your boot partition (it will be in the disk?s? format, not the sd?? format). ==Extra configurations== Your slackware install is actually quite usable exactly as it is at this point. However, there are a number of extra configurations that are at least advisable. ===Runlevel=== The default runlevel is, for some unknowable reason, 3. You won't get a desktop session manager unless you edit your /etc/inittab file and change the line: id:3:initdefault: to be 4 instead of 3. Restart, and you should get kdm (the KDE session manager) on boot. ===Desktop Environment=== The default desktop environment is KDE. This works quite well out of the box. Volume control works fine, the brightness keys are **recognized**, but they don't do anything. For somebody used to OS X or Windows, it's probably the most friendly. Almost every other popular desktop manager (besides Gnome, but there are reasons) is also available. You can change which one is run by default with the command: xwmconfig ===Sleep=== There is a utility called s2ram that will put the machine to sleep. Map it to a keystroke or hardware event to enable sleeping. The machine will not go to sleep by default when you shut the laptop! ===Brightness=== **This section needs to be expanded. If you have had success in this area, please edit this article** ===Fan control=== Install the mac fan control daemon macfanctld and set it to run on startup. It works just fine. [[Category:Hardware]] b817e03d82a0cb53c08b9406f85ea9e9c5872359 670 669 2012-04-13T08:50:51Z Gr4nf 276 /* Brightness */ wikitext text/x-wiki The following are (incomplete) instructions to install and configure Slackware 13.37 on the Macbook Air 1,1 (from early 2008). ===What You'll Need=== *External DVD-R drive (No success so far with bootable USB drives) *Bootable disc with some sort of disk utility (Optimally, the Snow Leopard DVD) *Slackware 13.37 DVD (32 bit is best, but it's up to you) *Bootable rEFIt CD ==Overview== The installation itself is not at all different from a slackware install on any other intel machine. The difficult parts are configuring afterwards and getting the machine to boot to an MBR scheme. Luckily, rEFIt does some arcane magic with it's partition manager that can set your scheme up as Hybrid GPT/MBR. Which brings us to step 1. ==Partitioning== Okay, the first step is to partition your hard drive with the MBR scheme. Boot into the Snow Leopard DVD and run the Disk Utility. Re-partition the hard drive as free space, and make sure to select "Master Boot Record" in the Advanced menu. Now boot into your slackware disk. It will show up in the alt boot menu without any configuration. Partition slackware as you would for any other install and take note of the path to the boot partition (probably /dev/sda2). ==Installation== Install slackware as you would on any intel machine. Make sure to select option 1 when installing the LILO boot loader. ==Make it Bootable== Linux will not initially be bootable since the Apple firmware hates MBR drives. If you need to boot into your slackware install at any time, just put the slack disk back in and follow the instructions in the boot: menu to boot to the hard drive. To make the drive itself bootable, start up into the rEFIt cd. One of the options is the partition manager. Starting that will scan your disk and give you the option to configure it into Hybrid GPT/MBR. Do that. If all went well, your disk is now bootable! ===If it takes forever to boot=== If it is taking forever to go from the pale blue startup screen to the LILO boot loader (30 seconds or so), you need to bless the partition from a terminal with the bless utility. The Snow Leopard DVD has such a terminal. Boot back into that, start up a terminal, and run the command: bless –device /dev/disk0s2 –setboot –legacy –verbose Where the device is your boot partition (it will be in the disk?s? format, not the sd?? format). ==Extra configurations== Your slackware install is actually quite usable exactly as it is at this point. However, there are a number of extra configurations that are at least advisable. ===Runlevel=== The default runlevel is, for some unknowable reason, 3. You won't get a desktop session manager unless you edit your /etc/inittab file and change the line: id:3:initdefault: to be 4 instead of 3. Restart, and you should get kdm (the KDE session manager) on boot. ===Desktop Environment=== The default desktop environment is KDE. This works quite well out of the box. Volume control works fine, the brightness keys are **recognized**, but they don't do anything. For somebody used to OS X or Windows, it's probably the most friendly. Almost every other popular desktop manager (besides Gnome, but there are reasons) is also available. You can change which one is run by default with the command: xwmconfig ===Sleep=== There is a utility called s2ram that will put the machine to sleep. Map it to a keystroke or hardware event to enable sleeping. The machine will not go to sleep by default when you shut the laptop! ===Brightness=== ''This section needs to be expanded. If you have had success in this area, please edit this article'' ===Fan control=== Install the mac fan control daemon macfanctld and set it to run on startup. It works just fine. [[Category:Hardware]] 12f1c77c3bb5ee270b5a323e695bc0d522370917 671 670 2012-04-13T08:51:08Z Gr4nf 276 /* Desktop Environment */ wikitext text/x-wiki The following are (incomplete) instructions to install and configure Slackware 13.37 on the Macbook Air 1,1 (from early 2008). ===What You'll Need=== *External DVD-R drive (No success so far with bootable USB drives) *Bootable disc with some sort of disk utility (Optimally, the Snow Leopard DVD) *Slackware 13.37 DVD (32 bit is best, but it's up to you) *Bootable rEFIt CD ==Overview== The installation itself is not at all different from a slackware install on any other intel machine. The difficult parts are configuring afterwards and getting the machine to boot to an MBR scheme. Luckily, rEFIt does some arcane magic with it's partition manager that can set your scheme up as Hybrid GPT/MBR. Which brings us to step 1. ==Partitioning== Okay, the first step is to partition your hard drive with the MBR scheme. Boot into the Snow Leopard DVD and run the Disk Utility. Re-partition the hard drive as free space, and make sure to select "Master Boot Record" in the Advanced menu. Now boot into your slackware disk. It will show up in the alt boot menu without any configuration. Partition slackware as you would for any other install and take note of the path to the boot partition (probably /dev/sda2). ==Installation== Install slackware as you would on any intel machine. Make sure to select option 1 when installing the LILO boot loader. ==Make it Bootable== Linux will not initially be bootable since the Apple firmware hates MBR drives. If you need to boot into your slackware install at any time, just put the slack disk back in and follow the instructions in the boot: menu to boot to the hard drive. To make the drive itself bootable, start up into the rEFIt cd. One of the options is the partition manager. Starting that will scan your disk and give you the option to configure it into Hybrid GPT/MBR. Do that. If all went well, your disk is now bootable! ===If it takes forever to boot=== If it is taking forever to go from the pale blue startup screen to the LILO boot loader (30 seconds or so), you need to bless the partition from a terminal with the bless utility. The Snow Leopard DVD has such a terminal. Boot back into that, start up a terminal, and run the command: bless –device /dev/disk0s2 –setboot –legacy –verbose Where the device is your boot partition (it will be in the disk?s? format, not the sd?? format). ==Extra configurations== Your slackware install is actually quite usable exactly as it is at this point. However, there are a number of extra configurations that are at least advisable. ===Runlevel=== The default runlevel is, for some unknowable reason, 3. You won't get a desktop session manager unless you edit your /etc/inittab file and change the line: id:3:initdefault: to be 4 instead of 3. Restart, and you should get kdm (the KDE session manager) on boot. ===Desktop Environment=== The default desktop environment is KDE. This works quite well out of the box. Volume control works fine, the brightness keys are ''recognized'', but they don't do anything. For somebody used to OS X or Windows, it's probably the most friendly. Almost every other popular desktop manager (besides Gnome, but there are reasons) is also available. You can change which one is run by default with the command: xwmconfig ===Sleep=== There is a utility called s2ram that will put the machine to sleep. Map it to a keystroke or hardware event to enable sleeping. The machine will not go to sleep by default when you shut the laptop! ===Brightness=== ''This section needs to be expanded. If you have had success in this area, please edit this article'' ===Fan control=== Install the mac fan control daemon macfanctld and set it to run on startup. It works just fine. [[Category:Hardware]] eb4d406c26b38a57c22d6fcb664201d115240840 672 671 2012-04-13T19:37:04Z Gr4nf 276 /* Brightness */ wikitext text/x-wiki The following are (incomplete) instructions to install and configure Slackware 13.37 on the Macbook Air 1,1 (from early 2008). ===What You'll Need=== *External DVD-R drive (No success so far with bootable USB drives) *Bootable disc with some sort of disk utility (Optimally, the Snow Leopard DVD) *Slackware 13.37 DVD (32 bit is best, but it's up to you) *Bootable rEFIt CD ==Overview== The installation itself is not at all different from a slackware install on any other intel machine. The difficult parts are configuring afterwards and getting the machine to boot to an MBR scheme. Luckily, rEFIt does some arcane magic with it's partition manager that can set your scheme up as Hybrid GPT/MBR. Which brings us to step 1. ==Partitioning== Okay, the first step is to partition your hard drive with the MBR scheme. Boot into the Snow Leopard DVD and run the Disk Utility. Re-partition the hard drive as free space, and make sure to select "Master Boot Record" in the Advanced menu. Now boot into your slackware disk. It will show up in the alt boot menu without any configuration. Partition slackware as you would for any other install and take note of the path to the boot partition (probably /dev/sda2). ==Installation== Install slackware as you would on any intel machine. Make sure to select option 1 when installing the LILO boot loader. ==Make it Bootable== Linux will not initially be bootable since the Apple firmware hates MBR drives. If you need to boot into your slackware install at any time, just put the slack disk back in and follow the instructions in the boot: menu to boot to the hard drive. To make the drive itself bootable, start up into the rEFIt cd. One of the options is the partition manager. Starting that will scan your disk and give you the option to configure it into Hybrid GPT/MBR. Do that. If all went well, your disk is now bootable! ===If it takes forever to boot=== If it is taking forever to go from the pale blue startup screen to the LILO boot loader (30 seconds or so), you need to bless the partition from a terminal with the bless utility. The Snow Leopard DVD has such a terminal. Boot back into that, start up a terminal, and run the command: bless –device /dev/disk0s2 –setboot –legacy –verbose Where the device is your boot partition (it will be in the disk?s? format, not the sd?? format). ==Extra configurations== Your slackware install is actually quite usable exactly as it is at this point. However, there are a number of extra configurations that are at least advisable. ===Runlevel=== The default runlevel is, for some unknowable reason, 3. You won't get a desktop session manager unless you edit your /etc/inittab file and change the line: id:3:initdefault: to be 4 instead of 3. Restart, and you should get kdm (the KDE session manager) on boot. ===Desktop Environment=== The default desktop environment is KDE. This works quite well out of the box. Volume control works fine, the brightness keys are ''recognized'', but they don't do anything. For somebody used to OS X or Windows, it's probably the most friendly. Almost every other popular desktop manager (besides Gnome, but there are reasons) is also available. You can change which one is run by default with the command: xwmconfig ===Sleep=== There is a utility called s2ram that will put the machine to sleep. Map it to a keystroke or hardware event to enable sleeping. The machine will not go to sleep by default when you shut the laptop! ===Brightness=== The command line utility xbrightness works fine. If you map it with the '-inc' and '-dec' options to the brightness keys (keycodes 232 and 233) it should work fine. ===Fan control=== Install the mac fan control daemon macfanctld and set it to run on startup. It works just fine. [[Category:Hardware]] 20dcbebf30cdefaa4de9a1f241c90139e9318dda 673 672 2012-04-13T19:38:50Z Gr4nf 276 /* Extra configurations */ wikitext text/x-wiki The following are (incomplete) instructions to install and configure Slackware 13.37 on the Macbook Air 1,1 (from early 2008). ===What You'll Need=== *External DVD-R drive (No success so far with bootable USB drives) *Bootable disc with some sort of disk utility (Optimally, the Snow Leopard DVD) *Slackware 13.37 DVD (32 bit is best, but it's up to you) *Bootable rEFIt CD ==Overview== The installation itself is not at all different from a slackware install on any other intel machine. The difficult parts are configuring afterwards and getting the machine to boot to an MBR scheme. Luckily, rEFIt does some arcane magic with it's partition manager that can set your scheme up as Hybrid GPT/MBR. Which brings us to step 1. ==Partitioning== Okay, the first step is to partition your hard drive with the MBR scheme. Boot into the Snow Leopard DVD and run the Disk Utility. Re-partition the hard drive as free space, and make sure to select "Master Boot Record" in the Advanced menu. Now boot into your slackware disk. It will show up in the alt boot menu without any configuration. Partition slackware as you would for any other install and take note of the path to the boot partition (probably /dev/sda2). ==Installation== Install slackware as you would on any intel machine. Make sure to select option 1 when installing the LILO boot loader. ==Make it Bootable== Linux will not initially be bootable since the Apple firmware hates MBR drives. If you need to boot into your slackware install at any time, just put the slack disk back in and follow the instructions in the boot: menu to boot to the hard drive. To make the drive itself bootable, start up into the rEFIt cd. One of the options is the partition manager. Starting that will scan your disk and give you the option to configure it into Hybrid GPT/MBR. Do that. If all went well, your disk is now bootable! ===If it takes forever to boot=== If it is taking forever to go from the pale blue startup screen to the LILO boot loader (30 seconds or so), you need to bless the partition from a terminal with the bless utility. The Snow Leopard DVD has such a terminal. Boot back into that, start up a terminal, and run the command: bless –device /dev/disk0s2 –setboot –legacy –verbose Where the device is your boot partition (it will be in the disk?s? format, not the sd?? format). ==Extra configurations== Your slackware install is actually quite usable exactly as it is at this point. However, there are a number of extra configurations that are at least advisable. ===Wireless=== Broadcom's linux driver should work right out of the box. The readme file explains how to blacklist the conflicting drivers you may have in your install. ===Runlevel=== The default runlevel is, for some unknowable reason, 3. You won't get a desktop session manager unless you edit your /etc/inittab file and change the line: id:3:initdefault: to be 4 instead of 3. Restart, and you should get kdm (the KDE session manager) on boot. ===Desktop Environment=== The default desktop environment is KDE. This works quite well out of the box. Volume control works fine, the brightness keys are ''recognized'', but they don't do anything. For somebody used to OS X or Windows, it's probably the most friendly. Almost every other popular desktop manager (besides Gnome, but there are reasons) is also available. You can change which one is run by default with the command: xwmconfig ===Sleep=== There is a utility called s2ram that will put the machine to sleep. Map it to a keystroke or hardware event to enable sleeping. The machine will not go to sleep by default when you shut the laptop! ===Brightness=== The command line utility xbrightness works fine. If you map it with the '-inc' and '-dec' options to the brightness keys (keycodes 232 and 233) it should work fine. ===Fan control=== Install the mac fan control daemon macfanctld and set it to run on startup. It works just fine. [[Category:Hardware]] d1288ddecb02b84845f67096f206c18a0ef42b0c Customizing Bash Prompt 0 77 675 508 2012-05-15T20:40:43Z Supyrow 196 wikitext text/x-wiki [[Category:Tips]] Originally posted by SU_PyRoW http://compelitepc.host56.com There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from "\033" or "ESC" commands into text commands for better reading, modifying or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes. <pre> #.bashrc DULL=0 BRIGHT=1 FG_BLACK=30 FG_RED=31 FG_GREEN=32 FG_YELLOW=33 FG_BLUE=34 FG_VIOLET=35 FG_CYAN=36 FG_WHITE=37 FG_NULL=00 BG_BLACK=40 BG_RED=41 BG_GREEN=42 BG_YELLOW=43 BG_BLUE=44 BG_VIOLET=45 BG_CYAN=46 BG_WHITE=47 BG_NULL=00 ESC="\033" NORMAL="\[$ESC[m\]" RESET="\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]" BLACK="\[$ESC[${DULL};${FG_BLACK}m\]" RED="\[$ESC[${DULL};${FG_RED}m\]" GREEN="\[$ESC[${DULL};${FG_GREEN}m\]" YELLOW="\[$ESC[${DULL};${FG_YELLOW}m\]" BLUE="\[$ESC[${DULL};${FG_BLUE}m\]" VIOLET="\[$ESC[${DULL};${FG_VIOLET}m\]" CYAN="\[$ESC[${DULL};${FG_CYAN}m\]" WHITE="\[$ESC[${DULL};${FG_WHITE}m\]" BRIGHT_BLACK="\[$ESC[${BRIGHT};${FG_BLACK}m\]" BRIGHT_RED="\[$ESC[${BRIGHT};${FG_RED}m\]" BRIGHT_GREEN="\[$ESC[${BRIGHT};${FG_GREEN}m\]" BRIGHT_YELLOW="\[$ESC[${BRIGHT};${FG_YELLOW}m\]" BRIGHT_BLUE="\[$ESC[${BRIGHT};${FG_BLUE}m\]" BRIGHT_VIOLET="\[$ESC[${BRIGHT};${FG_VIOLET}m\]" BRIGHT_CYAN="\[$ESC[${BRIGHT};${FG_CYAN}m\]" BRIGHT_WHITE="\[$ESC[${BRIGHT};${BG_WHITE}m\]" REV_CYAN="\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]" REV_RED="\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]" PROMPT_COMMAND='export ERR=$?' </pre> If you happen to use Eterm or other advanced terminal its possible you need a ".bash_profile" here is one you can use if you don't have one. <pre> #.bash_profile source .bashrc if [ -f ~/.bashrc ]; then . ~/.bashrc fi #End Script </pre> Lets put it to work: I personally would comment out my currently working ##"PS1=" and put it below it in case you need to change it back for some reason. <pre> PS1="${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@compelitepc.host56.com${BRIGHT_YELLOW}]\n ${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} | ${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n ${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %> ${RESET}" </pre> Should look like this minus the colors: <pre> YOUR COMPANY NAME HERE[support@compelitepc.host56.com] [13:57:23][590.478 MB|563.316 MiB][/media/cdrom] [503] %> </pre> Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past. Now... To get the sum of files in current working directory, I made two files which do the summing. "lsMB" and "lsMiB" which on my system are both located in ~/bin as executable. Here is lsMB: <pre> #!/bin/bash #lsMB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) suffix="kB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) suffix="MB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) suffix="GB" fi fi fi fi echo -n "$TotalSize $suffix" #End Script </pre> Finally, this is the lsMiB executable file located in "~/bin" This has the modification for the conversion to KiB, MiB & GiB one could further the code to handle TiB easily by doing some research on it... Try wiki! <pre> #!/bin/bash #lsMiB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix2="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1024*.976 \nquit" | bc) suffix2="KiB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1048576*.954 \nquit" | bc) suffix2="MiB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1073741824*.931 \nquit" | bc) suffix2="GiB" fi fi fi fi echo -n "$TotalSize2 $suffix2" #End Script </pre> One would be able to see the changes if 1) Restart the Terminal or 2) type:<pre>$ source ~/.bashrc</pre> and you will instantly see the changes. d5b2ca4fceedfe3d08ce1e807712b2e2b5d0f27d 676 675 2012-05-15T20:42:53Z Supyrow 196 moved [[Customising Bash Prompt]] to [[Customizing Bash Prompt]] over redirect wikitext text/x-wiki [[Category:Tips]] Originally posted by SU_PyRoW http://compelitepc.host56.com There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from "\033" or "ESC" commands into text commands for better reading, modifying or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes. <pre> #.bashrc DULL=0 BRIGHT=1 FG_BLACK=30 FG_RED=31 FG_GREEN=32 FG_YELLOW=33 FG_BLUE=34 FG_VIOLET=35 FG_CYAN=36 FG_WHITE=37 FG_NULL=00 BG_BLACK=40 BG_RED=41 BG_GREEN=42 BG_YELLOW=43 BG_BLUE=44 BG_VIOLET=45 BG_CYAN=46 BG_WHITE=47 BG_NULL=00 ESC="\033" NORMAL="\[$ESC[m\]" RESET="\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]" BLACK="\[$ESC[${DULL};${FG_BLACK}m\]" RED="\[$ESC[${DULL};${FG_RED}m\]" GREEN="\[$ESC[${DULL};${FG_GREEN}m\]" YELLOW="\[$ESC[${DULL};${FG_YELLOW}m\]" BLUE="\[$ESC[${DULL};${FG_BLUE}m\]" VIOLET="\[$ESC[${DULL};${FG_VIOLET}m\]" CYAN="\[$ESC[${DULL};${FG_CYAN}m\]" WHITE="\[$ESC[${DULL};${FG_WHITE}m\]" BRIGHT_BLACK="\[$ESC[${BRIGHT};${FG_BLACK}m\]" BRIGHT_RED="\[$ESC[${BRIGHT};${FG_RED}m\]" BRIGHT_GREEN="\[$ESC[${BRIGHT};${FG_GREEN}m\]" BRIGHT_YELLOW="\[$ESC[${BRIGHT};${FG_YELLOW}m\]" BRIGHT_BLUE="\[$ESC[${BRIGHT};${FG_BLUE}m\]" BRIGHT_VIOLET="\[$ESC[${BRIGHT};${FG_VIOLET}m\]" BRIGHT_CYAN="\[$ESC[${BRIGHT};${FG_CYAN}m\]" BRIGHT_WHITE="\[$ESC[${BRIGHT};${BG_WHITE}m\]" REV_CYAN="\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]" REV_RED="\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]" PROMPT_COMMAND='export ERR=$?' </pre> If you happen to use Eterm or other advanced terminal its possible you need a ".bash_profile" here is one you can use if you don't have one. <pre> #.bash_profile source .bashrc if [ -f ~/.bashrc ]; then . ~/.bashrc fi #End Script </pre> Lets put it to work: I personally would comment out my currently working ##"PS1=" and put it below it in case you need to change it back for some reason. <pre> PS1="${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@compelitepc.host56.com${BRIGHT_YELLOW}]\n ${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} | ${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n ${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %> ${RESET}" </pre> Should look like this minus the colors: <pre> YOUR COMPANY NAME HERE[support@compelitepc.host56.com] [13:57:23][590.478 MB|563.316 MiB][/media/cdrom] [503] %> </pre> Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past. Now... To get the sum of files in current working directory, I made two files which do the summing. "lsMB" and "lsMiB" which on my system are both located in ~/bin as executable. Here is lsMB: <pre> #!/bin/bash #lsMB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) suffix="kB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) suffix="MB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) suffix="GB" fi fi fi fi echo -n "$TotalSize $suffix" #End Script </pre> Finally, this is the lsMiB executable file located in "~/bin" This has the modification for the conversion to KiB, MiB & GiB one could further the code to handle TiB easily by doing some research on it... Try wiki! <pre> #!/bin/bash #lsMiB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix2="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1024*.976 \nquit" | bc) suffix2="KiB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1048576*.954 \nquit" | bc) suffix2="MiB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1073741824*.931 \nquit" | bc) suffix2="GiB" fi fi fi fi echo -n "$TotalSize2 $suffix2" #End Script </pre> One would be able to see the changes if 1) Restart the Terminal or 2) type:<pre>$ source ~/.bashrc</pre> and you will instantly see the changes. d5b2ca4fceedfe3d08ce1e807712b2e2b5d0f27d 727 676 2012-08-05T22:15:26Z Supyrow 196 wikitext text/x-wiki [[Category:Tips]] Originally posted by http://insider.compelitepc.host56.com There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from "\033" or "ESC" commands into text commands for better reading, modifying or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes. <pre> #.bashrc DULL=0 BRIGHT=1 FG_BLACK=30 FG_RED=31 FG_GREEN=32 FG_YELLOW=33 FG_BLUE=34 FG_VIOLET=35 FG_CYAN=36 FG_WHITE=37 FG_NULL=00 BG_BLACK=40 BG_RED=41 BG_GREEN=42 BG_YELLOW=43 BG_BLUE=44 BG_VIOLET=45 BG_CYAN=46 BG_WHITE=47 BG_NULL=00 ESC="\033" NORMAL="\[$ESC[m\]" RESET="\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]" BLACK="\[$ESC[${DULL};${FG_BLACK}m\]" RED="\[$ESC[${DULL};${FG_RED}m\]" GREEN="\[$ESC[${DULL};${FG_GREEN}m\]" YELLOW="\[$ESC[${DULL};${FG_YELLOW}m\]" BLUE="\[$ESC[${DULL};${FG_BLUE}m\]" VIOLET="\[$ESC[${DULL};${FG_VIOLET}m\]" CYAN="\[$ESC[${DULL};${FG_CYAN}m\]" WHITE="\[$ESC[${DULL};${FG_WHITE}m\]" BRIGHT_BLACK="\[$ESC[${BRIGHT};${FG_BLACK}m\]" BRIGHT_RED="\[$ESC[${BRIGHT};${FG_RED}m\]" BRIGHT_GREEN="\[$ESC[${BRIGHT};${FG_GREEN}m\]" BRIGHT_YELLOW="\[$ESC[${BRIGHT};${FG_YELLOW}m\]" BRIGHT_BLUE="\[$ESC[${BRIGHT};${FG_BLUE}m\]" BRIGHT_VIOLET="\[$ESC[${BRIGHT};${FG_VIOLET}m\]" BRIGHT_CYAN="\[$ESC[${BRIGHT};${FG_CYAN}m\]" BRIGHT_WHITE="\[$ESC[${BRIGHT};${BG_WHITE}m\]" REV_CYAN="\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]" REV_RED="\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]" PROMPT_COMMAND='export ERR=$?' </pre> If you happen to use Eterm or other advanced terminal its possible you need a ".bash_profile" here is one you can use if you don't have one. <pre> #.bash_profile source .bashrc if [ -f ~/.bashrc ]; then . ~/.bashrc fi #End Script </pre> Lets put it to work: I personally would comment out my currently working ##"PS1=" and put it below it in case you need to change it back for some reason. <pre> PS1="${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@compelitepc.com${BRIGHT_YELLOW}]\n ${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} | ${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n ${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %> ${RESET}" </pre> Should look like this minus the colors: <pre> YOUR COMPANY NAME HERE[support@compelitepc.com] [13:57:23][590.478 MB|563.316 MiB][/media/cdrom] [503] %> </pre> Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past. Now... To get the sum of files in current working directory, I made two files which do the summing. "lsMB" and "lsMiB" which on my system are both located in ~/bin as executable. Here is lsMB: <pre> #!/bin/bash #lsMB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) suffix="kB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) suffix="MB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) suffix="GB" fi fi fi fi echo -n "$TotalSize $suffix" #End Script </pre> Finally, this is the lsMiB executable file located in "~/bin" This has the modification for the conversion to KiB, MiB & GiB one could further the code to handle TiB easily by doing some research on it... Try wiki! <pre> #!/bin/bash #lsMiB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix2="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1024*.976 \nquit" | bc) suffix2="KiB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1048576*.954 \nquit" | bc) suffix2="MiB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1073741824*.931 \nquit" | bc) suffix2="GiB" fi fi fi fi echo -n "$TotalSize2 $suffix2" #End Script </pre> One would be able to see the changes if 1) Restart the Terminal or 2) type:<pre>$ source ~/.bashrc</pre> and you will instantly see the changes. b608907cd1e6cc170f0585303d8ed1fa69b22b14 Customising Bash Prompt 0 277 677 2012-05-15T20:42:53Z Supyrow 196 moved [[Customising Bash Prompt]] to [[Customizing Bash Prompt]] over redirect wikitext text/x-wiki #REDIRECT [[Customizing Bash Prompt]] 40b1752b8d0df62f9838a81eefe08530f9f2f3e3 Directory Permissions Defaults 0 83 683 105 2012-05-19T22:34:14Z Thund3rstruck 285 /* Solution: ACL */ wikitext text/x-wiki [[Category:Tutorials]] = Problem: Sharing Directories = My wife and I keep our pictures of our kids under a shared directory called /home/shared. We download them with Digikam and sometimes edit them to send out to relatives. The problem was this: if I download the pictures off the camera, then Megan can't edit them or read them. We also had problems with shared files (e.g., our accounting spreadsheets) that I would create and she would modify, or vice versa. = Solution: ACL = To set, in effect, default file-creation masks, you can use [[ACL]] (access control lists). The user commands you need to set up [[ACL]] are getfacl(1) and setfacl(1). == Edit /etc/fstab == Edit the fourth field of the fstab entry of the partition you want to use ACL on. In this case, it was /dev/sda6 on /home: <pre> /dev/sda6 /home ext3 defaults,acl 1 1 </pre> adding "acl" to the list of permissions. Without doing this, you'll get <pre> setfacl: /mnt/backup Operation not supported </pre> Then remount the partition: since I was doing this on /home, I rebooted (mount -a did not work). == ACL Commands == getfacl(1) shows you the current ACL status of a file: <pre> /media/multimedia: Zshell> getfacl /home getfacl: Removing leading '/' from absolute path names # file: home # owner: root # group: root user::rwx group::r-x other::r-x </pre> Once the partitions are properly set up (that was the easy part), enter the setfacl(1) commands: <pre> sudo setfacl --recursive -dm g:users:rwx /home/shared </pre> --recursive was important so that each directory beneath /home/shared inherits the default mask. Now getfacl(1) gives me this: <pre> /media/multimedia: Zshell> getfacl /home/shared getfacl: Removing leading '/' from absolute path names # file: home/shared # owner: joel # group: users user::rwx group::rwx other::r-x default:user::rwx default:group::rwx default:group:users:rwx default:mask::rwx default:other::r-x </pre> And when creating a file: <pre> /media/multimedia: Zshell> cd /home/shared /home/shared: Zshell> touch my_self /home/shared: Zshell> ls -l my_self -rw-rw-r--+ 1 joel users 0 2008-04-06 14:36 my_self </pre> The desired outcome! Note: this did what I wanted, but it's just a beginning. Read the setfacl(1) and getfacl(1) man pages for the full story. = Solution 2: SetGuid Flag = Some users are not willing (or able) to apply ACLs on filesystems. There is a way to achieve a similar ''shared'' directory effect using native Linux access controls. For example, imagine a SAMBA server with a share called ''Photos''. You need a sub-set of users on the network to be able to manage the files on the share. Additionally, you need new directories created within the share to ''inherit'' permissions from the parent. To accomplish this goal you create a group called ''mgrphotos'' and you add the users that should manage the share into that group. <pre> # Set ownership on shared folder chown -R root:mgrphotos /media/share/disk1/Photos # Set permissions on shared folder chmod -R 775 /media/share/disk1/Photos # Applying the setguid bit can allow for new files to "inherit" group membership from its parent (use this sparingly) sudo chmod g+s /media/share/disk1/Photos # Verify the setguid bit ls -all /media/share/disk1/Photos/ | grep -i family drwxrwsr-x 24 root mgrphotos 4096 2012-03-01 15:02 Family </pre> All new files created in the path are now owned by the mgrphotos group. Since this volume is mounted as 775, all members of mgrphotos share the files/folders they create on this volume. It's highly recommended that you leverage ACLs wherever possible but this is an alternate solution that works extremely well and required no extra packages or configuration. = Official Package Data = <pre> PACKAGE NAME: acl-2.2.39_1-i486-2 COMPRESSED PACKAGE SIZE: 139 K UNCOMPRESSED PACKAGE SIZE: 350 K PACKAGE LOCATION: ./acl-2.2.39_1-i486-2.tgz PACKAGE DESCRIPTION: acl: acl (tools for using POSIX Access Control Lists) acl: acl: This package contains a set of tools and libraries for manipulating acl: POSIX Access Control Lists. POSIX Access Control Lists (defined in acl: POSIX 1003.1e draft standard 17) are used to define more fine-grained acl: discretionary access rights for files and directories. acl: acl: acl: acl: acl: </pre> in slackware/a[http://packages.slackware.it/search.php?v=12.0&t=1&q=acl] [[User:Trashbird1240|Trashbird1240]] 14:49, 6 April 2008 (EDT) df26bf5527c8d69f9becd59181a5599eb5eeb7a2 684 683 2012-05-19T22:35:59Z Thund3rstruck 285 wikitext text/x-wiki [[Category:Tutorials]] = Problem: Sharing Directories = My wife and I keep our pictures of our kids under a shared directory called /home/shared. We download them with Digikam and sometimes edit them to send out to relatives. The problem was this: if I download the pictures off the camera, then Megan can't edit them or read them. We also had problems with shared files (e.g., our accounting spreadsheets) that I would create and she would modify, or vice versa. = Solution: ACL = To set, in effect, default file-creation masks, you can use [[ACL]] (access control lists). The user commands you need to set up [[ACL]] are getfacl(1) and setfacl(1). == Edit /etc/fstab == Edit the fourth field of the fstab entry of the partition you want to use ACL on. In this case, it was /dev/sda6 on /home: <pre> /dev/sda6 /home ext3 defaults,acl 1 1 </pre> adding "acl" to the list of permissions. Without doing this, you'll get <pre> setfacl: /mnt/backup Operation not supported </pre> Then remount the partition: since I was doing this on /home, I rebooted (mount -a did not work). == ACL Commands == getfacl(1) shows you the current ACL status of a file: <pre> /media/multimedia: Zshell> getfacl /home getfacl: Removing leading '/' from absolute path names # file: home # owner: root # group: root user::rwx group::r-x other::r-x </pre> Once the partitions are properly set up (that was the easy part), enter the setfacl(1) commands: <pre> sudo setfacl --recursive -dm g:users:rwx /home/shared </pre> --recursive was important so that each directory beneath /home/shared inherits the default mask. Now getfacl(1) gives me this: <pre> /media/multimedia: Zshell> getfacl /home/shared getfacl: Removing leading '/' from absolute path names # file: home/shared # owner: joel # group: users user::rwx group::rwx other::r-x default:user::rwx default:group::rwx default:group:users:rwx default:mask::rwx default:other::r-x </pre> And when creating a file: <pre> /media/multimedia: Zshell> cd /home/shared /home/shared: Zshell> touch my_self /home/shared: Zshell> ls -l my_self -rw-rw-r--+ 1 joel users 0 2008-04-06 14:36 my_self </pre> The desired outcome! Note: this did what I wanted, but it's just a beginning. Read the setfacl(1) and getfacl(1) man pages for the full story. == Official ACL Package Data == <pre> PACKAGE NAME: acl-2.2.39_1-i486-2 COMPRESSED PACKAGE SIZE: 139 K UNCOMPRESSED PACKAGE SIZE: 350 K PACKAGE LOCATION: ./acl-2.2.39_1-i486-2.tgz PACKAGE DESCRIPTION: acl: acl (tools for using POSIX Access Control Lists) acl: acl: This package contains a set of tools and libraries for manipulating acl: POSIX Access Control Lists. POSIX Access Control Lists (defined in acl: POSIX 1003.1e draft standard 17) are used to define more fine-grained acl: discretionary access rights for files and directories. acl: acl: acl: acl: acl: </pre> in slackware/a[http://packages.slackware.it/search.php?v=12.0&t=1&q=acl] [[User:Trashbird1240|Trashbird1240]] 14:49, 6 April 2008 (EDT) = Solution 2: SetGuid Flag = Some users are not willing (or able) to apply ACLs on filesystems. There is a way to achieve a similar ''shared'' directory effect using native Linux access controls. For example, imagine a SAMBA server with a share called ''Photos''. You need a sub-set of users on the network to be able to manage the files on the share. Additionally, you need new directories created within the share to ''inherit'' permissions from the parent. To accomplish this goal you create a group called ''mgrphotos'' and you add the users that should manage the share into that group. <pre> # Set ownership on shared folder chown -R root:mgrphotos /media/share/disk1/Photos # Set permissions on shared folder chmod -R 775 /media/share/disk1/Photos # Applying the setguid bit can allow for new files to "inherit" group membership from its parent (use this sparingly) sudo chmod g+s /media/share/disk1/Photos # Verify the setguid bit ls -all /media/share/disk1/Photos/ | grep -i family drwxrwsr-x 24 root mgrphotos 4096 2012-03-01 15:02 Family </pre> All new files created in the path are now owned by the mgrphotos group. Since this volume is mounted as 775, all members of mgrphotos share the files/folders they create on this volume. It's highly recommended that you leverage ACLs wherever possible but this is an alternate solution that works extremely well and required no extra packages or configuration. 2d5e9bfeff66af0294107a1139f0d6adf295ac6e User talk:Tigersharke 3 281 694 2012-05-21T19:31:30Z Tigersharke 288 Created page with "anti-spam researcher of sorts :)" wikitext text/x-wiki anti-spam researcher of sorts :) e1e94186660aa499c510346fe08030502168562a 695 694 2012-05-21T19:32:28Z Tigersharke 288 ok, so after the gatekeeper, no limits? wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Main Page 0 1 704 580 2012-06-01T04:30:56Z Erik 1 MediaWiki Upgrade wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 0408a78241675f01659c1b1585e011ffe61cd6df OpenVPN(ID) 0 284 705 2012-06-06T23:43:07Z Arfon 70 Moved from: http://www.slackwiki.com/OpenVPN wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] As a user-space VPN daemon, OpenVPN is compatible with with SSL/TLS, RSA Certificates and X509 PKI, NAT, DHCP, and TUN/TAP virtual devices. OpenVPN is not compatible with IPSec, IKE, PPTP, or L2TP. __TOC__ == Instalasi == Download source dari [http://openvpn.net openvpn.net] download versi 2.0 instalasi Lzo <pre> tar zxvf lzo-1.08.tar.gz cd lzo-1-08.tar.gz ./configure --prefix=/usr make ; make install-strip </pre> insalasi OpenVPN <pre> tar zxvf openvpn-2.0.tar.gz cd openvpn-2.0 ./configure --prefix=/usr \ --sysconfdir=/etc/openvpn \ --enable-pthread \ --enable-iproute2 \ --with-ssl \ --with-lzo-header=/usr/include \ --with-lzo-lib=/usr/lib \ --with-ifconfig \ --with-route \ --with-mem-check=dmalloc make ; make install-strip </pre> == Konfigurasi == ==Konfigurasi Sertifikat== Simpan seluruh sertifikat di '''''/etc/openvpn/certs''''' <pre> This is a small RSA key management package, based on the openssl command line tool, that can be found in the easy-rsa subdirectory of the OpenVPN distribution. These are reference notes. For step by step instructions, see the HOWTO: http://openvpn.net/howto.html INSTALL 1. Edit vars. 2. Set KEY_CONFIG to point to the openssl.cnf file included in this distribution. 3. Set KEY_DIR to point to a directory which will contain all keys, certificates, etc. This directory need not exist, and if it does, it will be deleted with rm -rf, so BE CAREFUL how you set KEY_DIR. 4. (Optional) Edit other fields in vars per your site data. You may want to increase KEY_SIZE to 2048 if you are paranoid and don't mind slower key processing, but certainly 1024 is fine for testing purposes. KEY_SIZE must be compatible across both peers participating in a secure SSL/TLS connection. 5 . vars 6. ./clean-all 7. As you create certificates, keys, and certificate signing requests, understand that only .key files should be kept confidential. .crt and .csr files can be sent over insecure channels such as plaintext email. 8. You should never need to copy a .key file between computers. Normally each computer will have its own certificate/key pair. BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY 1. ./build-ca 2. ca.crt and ca.key will be built in your KEY_DIR directory BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) 1. ./build-inter inter 2. inter.crt and inter.key will be built in your KEY_DIR directory and signed with your root certificate. BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). 1. ./build-dh BUILD A CERTIFICATE SIGNING REQUEST (If you want to sign your certificate with a root certificate controlled by another individual or organization, or residing on a different machine). 1. Get ca.crt (the root certificate) from your certificate authority. Though this transfer can be over an insecure channel, to prevent man-in-the-middle attacks you must confirm that ca.crt was not tampered with. Large CAs solve this problem by hardwiring their root certificates into popular web browsers. A simple way to verify a root CA is to call the issuer on the telephone and confirm that the md5sum or sha1sum signatures on the ca.crt files match (such as with the command: "md5sum ca.crt"). 2. Choose a name for your certificate such as your computer name. In our example we will use "mycert". 3. ./build-req mycert 4. You can ignore most of the fields, but set "Common Name" to something unique such as your computer's host name. Leave all password fields blank, unless you want your private key to be protected by password. Using a password is not required -- it will make your key more secure but also more inconvenient to use, because you will need to supply your password anytime the key is used. NOTE: if you are using a password, use ./build-req-pass instead of ./build-req 5. Your key will be written to $KEY_DIR/mycert.key 6. Your certificate signing request will be written to to $KEY_DIR/mycert.csr 7. Email mycert.csr to the individual or organization which controls the root certificate. This can be done over an insecure channel. 8. After the .csr file is signed by the root certificate authority, you will receive a file mycert.crt (your certificate). Place mycert.crt in your KEY_DIR directory. 9. The combined files of mycert.crt, mycert.key, and ca.crt can now be used to secure one end of an SSL/TLS connection. SIGN A CERTIFICATE SIGNING REQUEST 1. ./sign-req mycert 2. mycert.crt will be built in your KEY_DIR directory using mycert.csr and your root CA file as input. BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY -- this script generates and signs a certificate in one step, but it requires that the generated certificate and private key files be copied to the destination host over a secure channel. 1. ./build-key mycert (no password protection) 2. OR ./build-key-pass mycert (with password protection) 3. OR ./build-key-pkcs12 mycert (PKCS #12 format) 4. OR ./build-key-server mycert (with nsCertType=server) 5. mycert.crt and mycert.key will be built in your KEY_DIR directory, and mycert.crt will be signed by your root CA. If ./build-key-pkcs12 was used a mycert.p12 file will also be created including the private key, certificate and the ca certificate. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. (4) Sign server certificates with one CA and client certificates with a different CA. The client config "ca" directive should reference the server-signing CA while the server config "ca" directive should reference the client-signing CA. NOTES Show certificate fields: openssl x509 -in cert.crt -text </pre> <pre> # cd easy-rsa # vi vars . vars ./clean-all ## BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY ./build.ca ## BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) ./build-inter inter ## BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). ./build.dh ## BUILD A CERTIFICATE SIGNING REQUEST ## (If you want to sign your certificate with a root certificate controlled by another individual ## or organization, or residing on a different machine) ./build-req mycert ## SIGN A CERTIFICATE SIGNING REQUEST ./sign-req mycert ## BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY ./build-key mycert (no password protection) OR ./build-key-pass mycert (with password protection) OR ./build-key-pkcs12 mycert (PKCS #12 format) OR ./build-key-server mycert (with nsCertType=server) </pre> ==Konfigurasi Server== edit server.conf '''''vi /etc/openvpn/server.conf''''' <pre> ## Mode Server mode server ## Local Host Name/IP Server ;local 127.0.0.1 ## Protocol ;proto tcp proto udp ## Port ; port 1194 ## Device Interface ;dev tap dev tun ## TAP-Win32 adapter name ;dev-node MyTap ## SSL/TLS ## root certificate (ca) ## certificate (cert) ## private key (key) ca /etc/openvpn/certs/ca.crt cert /etc/openvpn/certs/server.crt key /etc/openvpn/certs/server.key ## Diffie hellman parameters dh dh1024.pem ## VPN subnet server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt ##ethernet bridging ;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100 ## dhcpcaveats ;push "route 192.168.10.0 255.255.255.0" ;push "route 192.168.20.0 255.255.255.0" ;client-config-dir ccd ;route 192.168.40.128 255.255.255.248 ;client-config-dir ccd ;route 10.9.0.0 255.255.255.252 ;learn-address ./script ## dhcpcaveats ;push "redirect-gateway" ;push "dhcp-option DNS 10.8.0.1" ;push "dhcp-option WINS 10.8.0.1" ## ;client-to-client ## same "COMMON NAME" certificate/key ;duplicate-cn ## Status Connection keepalive 10 120 ## tls-auth key ;tls-auth ta.key 0 ## Cryptographic cipher ;cipher BF-CBC # Blowfish (default) ;cipher AES-128-CBC # AES ;cipher DES-EDE3-CBC # Triple-DES ## Link Compresion comp-lzo ## Max Client Connections ;max-clients 100 ## daemon privileges (non windows saja) user nobody group nobody persist-key persist-tun ## Openvpn Log ;log /var/log/openvpn/openvpn.log ;log-append /var/log/openvpn/openvpn.log ## Output Log status /var/log/openvpn/openvpn-status.log ## Log Verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## Repeating Messages ;mute 20 ## Pid File writepid /var/run/openvpn.pid </pre> '''Routing''' <pre> echo 1 > /proc/sys/net/ipv4/ip_forward route add -net 10.0.1.0 netmask 255.255.255.0 gw 10.4.0.2 </pre> '''Firewall''' <pre> iptables -A INPUT -p udp -s 1.2.3.4 --dport 1194 -j ACCEPT OR iptables -A INPUT -p udp --dport 1194 -j ACCEPT ## Tun Device iptables -A INPUT -i tun+ -j ACCEPT iptables -A FORWARD -i tun+ -j ACCEPT ## Tap Device iptables -A INPUT -i tap+ -j ACCEPT iptables -A FORWARD -i tap+ -j ACCEPT </pre> ==Konfigurasi client== edit file client.conf '''''vi /etc/openvpn/client.conf''''' <pre> ## Config client ## Device Interface ;dev tap dev tun ## Tap adapter name (Win only) ;dev-node MyTap ## Conectivity ;proto tcp proto udp ## Server [hostname/ip] [port] remote my-server-1 1194 ;remote my-server-2 1194 ## load-balancing ;remote-random ## resolve host name OpenVPN server resolv-retry infinite # local port nobind ## privileges (non windows saja) user nobody group nobody ## preserve persist-key persist-tun ## HTTP proxy ;http-proxy-retry ;http-proxy [proxy server] [proxy port] ## duplicate packet warnings ;mute-replay-warnings ## SSL/TLS parms /etc/openvpn/certs/ca ca.crt /etc/openvpn/certs/cert client.crt /etc/openvpn/certs/key client.key ## nsCertType key ;ns-cert-type server ## tls-auth key ;tls-auth /etc/openvpn/certs/ta.key 1 ## Cryptographic cipher ;cipher x ## Link compression comp-lzo ## verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## repeating messages ;mute 20 </pre> '''Routing''' <pre> route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.4.0.1 </pre> ==Example== '''Example 1:''' A simple tunnel without security<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9 </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 2:''' A tunnel with static-key security (i.e. using a pre-shared secret)<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --verb 5 --secret key </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --verb 5 --secret key </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 3:''' A tunnel with full TLS-based security <br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --tls-client --ca tmp-ca.crt --cert client.crt --key client.key \ --reneg-sec 60 --verb 5 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --tls-server --ca tmp-ca.crt --cert server.crt --key server.key \ --reneg-sec 60 --verb 5 --dh dh1024.pem </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 == External Links == * http://dmalloc.com/ * http://valgrind.org/ * http://www.oberhumer.com/opensource/lzo/ * http://openvpn.net/ * http://openvpn.net/howto.html * http://openvpn.net/1xhowto.html (Old-v1.06) * http://openvpn.net/man.html a1601b7ee4db3b7301b533a706c6829931779591 OpenVPN 0 127 706 150 2012-06-06T23:52:31Z Arfon 70 Moved English page here, made a new page for Indonesian translation and added link wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] As a user-space VPN daemon, OpenVPN is compatible with with SSL/TLS, RSA Certificates and X509 PKI, NAT, DHCP, and TUN/TAP virtual devices. OpenVPN is not compatible with IPSec, IKE, PPTP, or L2TP. '''[[OpenVPN(ID)|OpenVPN Instructions - Bahasa Indonesia]]''' __TOC__ == Installation == Download source from [http://openvpn.net openvpn.net] Download verison 2.0 install Lzo <pre> tar zxvf lzo-1.08.tar.gz cd lzo-1-08.tar.gz ./configure --prefix=/usr make ; make install-strip </pre> install OpenVPN <pre> tar zxvf openvpn-2.0.tar.gz cd openvpn-2.0 ./configure --prefix=/usr \ --sysconfdir=/etc/openvpn \ --enable-pthread \ --enable-iproute2 \ --with-ssl \ --with-lzo-header=/usr/include \ --with-lzo-lib=/usr/lib \ --with-ifconfig \ --with-route \ --with-mem-check=dmalloc make ; make install-strip </pre> == Configuration == ==Configuring Certificates== Save all certificates in '''''/etc/openvpn/certs''''' <pre> This is a small RSA key management package, based on the openssl command line tool, that can be found in the easy-rsa subdirectory of the OpenVPN distribution. These are reference notes. For step by step instructions, see the HOWTO: http://openvpn.net/howto.html INSTALL 1. Edit vars. 2. Set KEY_CONFIG to point to the openssl.cnf file included in this distribution. 3. Set KEY_DIR to point to a directory which will contain all keys, certificates, etc. This directory need not exist, and if it does, it will be deleted with rm -rf, so BE CAREFUL how you set KEY_DIR. 4. (Optional) Edit other fields in vars per your site data. You may want to increase KEY_SIZE to 2048 if you are paranoid and don't mind slower key processing, but certainly 1024 is fine for testing purposes. KEY_SIZE must be compatible across both peers participating in a secure SSL/TLS connection. 5 . vars 6. ./clean-all 7. As you create certificates, keys, and certificate signing requests, understand that only .key files should be kept confidential. .crt and .csr files can be sent over insecure channels such as plaintext email. 8. You should never need to copy a .key file between computers. Normally each computer will have its own certificate/key pair. BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY 1. ./build-ca 2. ca.crt and ca.key will be built in your KEY_DIR directory BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) 1. ./build-inter inter 2. inter.crt and inter.key will be built in your KEY_DIR directory and signed with your root certificate. BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). 1. ./build-dh BUILD A CERTIFICATE SIGNING REQUEST (If you want to sign your certificate with a root certificate controlled by another individual or organization, or residing on a different machine). 1. Get ca.crt (the root certificate) from your certificate authority. Though this transfer can be over an insecure channel, to prevent man-in-the-middle attacks you must confirm that ca.crt was not tampered with. Large CAs solve this problem by hardwiring their root certificates into popular web browsers. A simple way to verify a root CA is to call the issuer on the telephone and confirm that the md5sum or sha1sum signatures on the ca.crt files match (such as with the command: "md5sum ca.crt"). 2. Choose a name for your certificate such as your computer name. In our example we will use "mycert". 3. ./build-req mycert 4. You can ignore most of the fields, but set "Common Name" to something unique such as your computer's host name. Leave all password fields blank, unless you want your private key to be protected by password. Using a password is not required -- it will make your key more secure but also more inconvenient to use, because you will need to supply your password anytime the key is used. NOTE: if you are using a password, use ./build-req-pass instead of ./build-req 5. Your key will be written to $KEY_DIR/mycert.key 6. Your certificate signing request will be written to to $KEY_DIR/mycert.csr 7. Email mycert.csr to the individual or organization which controls the root certificate. This can be done over an insecure channel. 8. After the .csr file is signed by the root certificate authority, you will receive a file mycert.crt (your certificate). Place mycert.crt in your KEY_DIR directory. 9. The combined files of mycert.crt, mycert.key, and ca.crt can now be used to secure one end of an SSL/TLS connection. SIGN A CERTIFICATE SIGNING REQUEST 1. ./sign-req mycert 2. mycert.crt will be built in your KEY_DIR directory using mycert.csr and your root CA file as input. BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY -- this script generates and signs a certificate in one step, but it requires that the generated certificate and private key files be copied to the destination host over a secure channel. 1. ./build-key mycert (no password protection) 2. OR ./build-key-pass mycert (with password protection) 3. OR ./build-key-pkcs12 mycert (PKCS #12 format) 4. OR ./build-key-server mycert (with nsCertType=server) 5. mycert.crt and mycert.key will be built in your KEY_DIR directory, and mycert.crt will be signed by your root CA. If ./build-key-pkcs12 was used a mycert.p12 file will also be created including the private key, certificate and the ca certificate. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. (4) Sign server certificates with one CA and client certificates with a different CA. The client config "ca" directive should reference the server-signing CA while the server config "ca" directive should reference the client-signing CA. NOTES Show certificate fields: openssl x509 -in cert.crt -text </pre> <pre> # cd easy-rsa # vi vars . vars ./clean-all ## BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY ./build.ca ## BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) ./build-inter inter ## BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). ./build.dh ## BUILD A CERTIFICATE SIGNING REQUEST ## (If you want to sign your certificate with a root certificate controlled by another individual ## or organization, or residing on a different machine) ./build-req mycert ## SIGN A CERTIFICATE SIGNING REQUEST ./sign-req mycert ## BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY ./build-key mycert (no password protection) OR ./build-key-pass mycert (with password protection) OR ./build-key-pkcs12 mycert (PKCS #12 format) OR ./build-key-server mycert (with nsCertType=server) </pre> ==Configuring the Server== Edit the server.conf file: '''''vi /etc/openvpn/server.conf''''' <pre> ## Mode Server mode server ## Local Host Name/IP Server ;local 127.0.0.1 ## Protocol ;proto tcp proto udp ## Port ; port 1194 ## Device Interface ;dev tap dev tun ## TAP-Win32 adapter name ;dev-node MyTap ## SSL/TLS ## root certificate (ca) ## certificate (cert) ## private key (key) ca /etc/openvpn/certs/ca.crt cert /etc/openvpn/certs/server.crt key /etc/openvpn/certs/server.key ## Diffie hellman parameters dh dh1024.pem ## VPN subnet server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt ##ethernet bridging ;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100 ## dhcpcaveats ;push "route 192.168.10.0 255.255.255.0" ;push "route 192.168.20.0 255.255.255.0" ;client-config-dir ccd ;route 192.168.40.128 255.255.255.248 ;client-config-dir ccd ;route 10.9.0.0 255.255.255.252 ;learn-address ./script ## dhcpcaveats ;push "redirect-gateway" ;push "dhcp-option DNS 10.8.0.1" ;push "dhcp-option WINS 10.8.0.1" ## ;client-to-client ## same "COMMON NAME" certificate/key ;duplicate-cn ## Status Connection keepalive 10 120 ## tls-auth key ;tls-auth ta.key 0 ## Cryptographic cipher ;cipher BF-CBC # Blowfish (default) ;cipher AES-128-CBC # AES ;cipher DES-EDE3-CBC # Triple-DES ## Link Compresion comp-lzo ## Max Client Connections ;max-clients 100 ## daemon privileges (non windows saja) user nobody group nobody persist-key persist-tun ## Openvpn Log ;log /var/log/openvpn/openvpn.log ;log-append /var/log/openvpn/openvpn.log ## Output Log status /var/log/openvpn/openvpn-status.log ## Log Verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## Repeating Messages ;mute 20 ## Pid File writepid /var/run/openvpn.pid </pre> '''Routing''' <pre> echo 1 > /proc/sys/net/ipv4/ip_forward route add -net 10.0.1.0 netmask 255.255.255.0 gw 10.4.0.2 </pre> '''Firewall''' <pre> iptables -A INPUT -p udp -s 1.2.3.4 --dport 1194 -j ACCEPT OR iptables -A INPUT -p udp --dport 1194 -j ACCEPT ## Tun Device iptables -A INPUT -i tun+ -j ACCEPT iptables -A FORWARD -i tun+ -j ACCEPT ## Tap Device iptables -A INPUT -i tap+ -j ACCEPT iptables -A FORWARD -i tap+ -j ACCEPT </pre> ==Configuring the Client== Edit the client.conf file: '''''vi /etc/openvpn/client.conf''''' <pre> ## Config client ## Device Interface ;dev tap dev tun ## Tap adapter name (Win only) ;dev-node MyTap ## Conectivity ;proto tcp proto udp ## Server [hostname/ip] [port] remote my-server-1 1194 ;remote my-server-2 1194 ## load-balancing ;remote-random ## resolve host name OpenVPN server resolv-retry infinite # local port nobind ## privileges (non windows saja) user nobody group nobody ## preserve persist-key persist-tun ## HTTP proxy ;http-proxy-retry ;http-proxy [proxy server] [proxy port] ## duplicate packet warnings ;mute-replay-warnings ## SSL/TLS parms /etc/openvpn/certs/ca ca.crt /etc/openvpn/certs/cert client.crt /etc/openvpn/certs/key client.key ## nsCertType key ;ns-cert-type server ## tls-auth key ;tls-auth /etc/openvpn/certs/ta.key 1 ## Cryptographic cipher ;cipher x ## Link compression comp-lzo ## verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## repeating messages ;mute 20 </pre> '''Routing''' <pre> route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.4.0.1 </pre> ==Example== '''Example 1:''' A simple tunnel without security<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9 </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 2:''' A tunnel with static-key security (i.e. using a pre-shared secret)<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --verb 5 --secret key </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --verb 5 --secret key </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 3:''' A tunnel with full TLS-based security <br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --tls-client --ca tmp-ca.crt --cert client.crt --key client.key \ --reneg-sec 60 --verb 5 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --tls-server --ca tmp-ca.crt --cert server.crt --key server.key \ --reneg-sec 60 --verb 5 --dh dh1024.pem </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 == External Links == * http://dmalloc.com/ * http://valgrind.org/ * http://www.oberhumer.com/opensource/lzo/ * http://openvpn.net/ * http://openvpn.net/howto.html * http://openvpn.net/1xhowto.html (Old-v1.06) * http://openvpn.net/man.html 16cf36f6e50d2eddcad9877ac59cc03d3ef1c699 707 706 2012-06-07T00:05:04Z Arfon 70 ADDED: Install from Slackbuilds.org wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] As a user-space VPN daemon, OpenVPN is compatible with with SSL/TLS, RSA Certificates and X509 PKI, NAT, DHCP, and TUN/TAP virtual devices. OpenVPN is not compatible with IPSec, IKE, PPTP, or L2TP. '''[[OpenVPN(ID)|OpenVPN Instructions - Bahasa Indonesia]]''' __TOC__ == Installation == '''EASY WAY:''' Download and install from Slackbuilds.org or sbopkg. or '''HARD WAY:''' Install from source. Download source from [http://openvpn.net openvpn.net] Download verison 2.0 install Lzo <pre> tar zxvf lzo-1.08.tar.gz cd lzo-1-08.tar.gz ./configure --prefix=/usr make ; make install-strip </pre> install OpenVPN <pre> tar zxvf openvpn-2.0.tar.gz cd openvpn-2.0 ./configure --prefix=/usr \ --sysconfdir=/etc/openvpn \ --enable-pthread \ --enable-iproute2 \ --with-ssl \ --with-lzo-header=/usr/include \ --with-lzo-lib=/usr/lib \ --with-ifconfig \ --with-route \ --with-mem-check=dmalloc make ; make install-strip </pre> ==Creating The Certificates== Save all certificates in '''''/etc/openvpn/certs''''' <pre> This is a small RSA key management package, based on the openssl command line tool, that can be found in the easy-rsa subdirectory of the OpenVPN distribution. These are reference notes. For step by step instructions, see the HOWTO: http://openvpn.net/howto.html INSTALL 1. Edit vars. 2. Set KEY_CONFIG to point to the openssl.cnf file included in this distribution. 3. Set KEY_DIR to point to a directory which will contain all keys, certificates, etc. This directory need not exist, and if it does, it will be deleted with rm -rf, so BE CAREFUL how you set KEY_DIR. 4. (Optional) Edit other fields in vars per your site data. You may want to increase KEY_SIZE to 2048 if you are paranoid and don't mind slower key processing, but certainly 1024 is fine for testing purposes. KEY_SIZE must be compatible across both peers participating in a secure SSL/TLS connection. 5 . vars 6. ./clean-all 7. As you create certificates, keys, and certificate signing requests, understand that only .key files should be kept confidential. .crt and .csr files can be sent over insecure channels such as plaintext email. 8. You should never need to copy a .key file between computers. Normally each computer will have its own certificate/key pair. BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY 1. ./build-ca 2. ca.crt and ca.key will be built in your KEY_DIR directory BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) 1. ./build-inter inter 2. inter.crt and inter.key will be built in your KEY_DIR directory and signed with your root certificate. BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). 1. ./build-dh BUILD A CERTIFICATE SIGNING REQUEST (If you want to sign your certificate with a root certificate controlled by another individual or organization, or residing on a different machine). 1. Get ca.crt (the root certificate) from your certificate authority. Though this transfer can be over an insecure channel, to prevent man-in-the-middle attacks you must confirm that ca.crt was not tampered with. Large CAs solve this problem by hardwiring their root certificates into popular web browsers. A simple way to verify a root CA is to call the issuer on the telephone and confirm that the md5sum or sha1sum signatures on the ca.crt files match (such as with the command: "md5sum ca.crt"). 2. Choose a name for your certificate such as your computer name. In our example we will use "mycert". 3. ./build-req mycert 4. You can ignore most of the fields, but set "Common Name" to something unique such as your computer's host name. Leave all password fields blank, unless you want your private key to be protected by password. Using a password is not required -- it will make your key more secure but also more inconvenient to use, because you will need to supply your password anytime the key is used. NOTE: if you are using a password, use ./build-req-pass instead of ./build-req 5. Your key will be written to $KEY_DIR/mycert.key 6. Your certificate signing request will be written to to $KEY_DIR/mycert.csr 7. Email mycert.csr to the individual or organization which controls the root certificate. This can be done over an insecure channel. 8. After the .csr file is signed by the root certificate authority, you will receive a file mycert.crt (your certificate). Place mycert.crt in your KEY_DIR directory. 9. The combined files of mycert.crt, mycert.key, and ca.crt can now be used to secure one end of an SSL/TLS connection. SIGN A CERTIFICATE SIGNING REQUEST 1. ./sign-req mycert 2. mycert.crt will be built in your KEY_DIR directory using mycert.csr and your root CA file as input. BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY -- this script generates and signs a certificate in one step, but it requires that the generated certificate and private key files be copied to the destination host over a secure channel. 1. ./build-key mycert (no password protection) 2. OR ./build-key-pass mycert (with password protection) 3. OR ./build-key-pkcs12 mycert (PKCS #12 format) 4. OR ./build-key-server mycert (with nsCertType=server) 5. mycert.crt and mycert.key will be built in your KEY_DIR directory, and mycert.crt will be signed by your root CA. If ./build-key-pkcs12 was used a mycert.p12 file will also be created including the private key, certificate and the ca certificate. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. (4) Sign server certificates with one CA and client certificates with a different CA. The client config "ca" directive should reference the server-signing CA while the server config "ca" directive should reference the client-signing CA. NOTES Show certificate fields: openssl x509 -in cert.crt -text </pre> <pre> # cd easy-rsa # vi vars . vars ./clean-all ## BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY ./build.ca ## BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) ./build-inter inter ## BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). ./build.dh ## BUILD A CERTIFICATE SIGNING REQUEST ## (If you want to sign your certificate with a root certificate controlled by another individual ## or organization, or residing on a different machine) ./build-req mycert ## SIGN A CERTIFICATE SIGNING REQUEST ./sign-req mycert ## BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY ./build-key mycert (no password protection) OR ./build-key-pass mycert (with password protection) OR ./build-key-pkcs12 mycert (PKCS #12 format) OR ./build-key-server mycert (with nsCertType=server) </pre> ==Configuring the Server== Edit the server.conf file: '''''vi /etc/openvpn/server.conf''''' <pre> ## Mode Server mode server ## Local Host Name/IP Server ;local 127.0.0.1 ## Protocol ;proto tcp proto udp ## Port ; port 1194 ## Device Interface ;dev tap dev tun ## TAP-Win32 adapter name ;dev-node MyTap ## SSL/TLS ## root certificate (ca) ## certificate (cert) ## private key (key) ca /etc/openvpn/certs/ca.crt cert /etc/openvpn/certs/server.crt key /etc/openvpn/certs/server.key ## Diffie hellman parameters dh dh1024.pem ## VPN subnet server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt ##ethernet bridging ;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100 ## dhcpcaveats ;push "route 192.168.10.0 255.255.255.0" ;push "route 192.168.20.0 255.255.255.0" ;client-config-dir ccd ;route 192.168.40.128 255.255.255.248 ;client-config-dir ccd ;route 10.9.0.0 255.255.255.252 ;learn-address ./script ## dhcpcaveats ;push "redirect-gateway" ;push "dhcp-option DNS 10.8.0.1" ;push "dhcp-option WINS 10.8.0.1" ## ;client-to-client ## same "COMMON NAME" certificate/key ;duplicate-cn ## Status Connection keepalive 10 120 ## tls-auth key ;tls-auth ta.key 0 ## Cryptographic cipher ;cipher BF-CBC # Blowfish (default) ;cipher AES-128-CBC # AES ;cipher DES-EDE3-CBC # Triple-DES ## Link Compresion comp-lzo ## Max Client Connections ;max-clients 100 ## daemon privileges (non windows saja) user nobody group nobody persist-key persist-tun ## Openvpn Log ;log /var/log/openvpn/openvpn.log ;log-append /var/log/openvpn/openvpn.log ## Output Log status /var/log/openvpn/openvpn-status.log ## Log Verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## Repeating Messages ;mute 20 ## Pid File writepid /var/run/openvpn.pid </pre> '''Routing''' <pre> echo 1 > /proc/sys/net/ipv4/ip_forward route add -net 10.0.1.0 netmask 255.255.255.0 gw 10.4.0.2 </pre> '''Firewall''' <pre> iptables -A INPUT -p udp -s 1.2.3.4 --dport 1194 -j ACCEPT OR iptables -A INPUT -p udp --dport 1194 -j ACCEPT ## Tun Device iptables -A INPUT -i tun+ -j ACCEPT iptables -A FORWARD -i tun+ -j ACCEPT ## Tap Device iptables -A INPUT -i tap+ -j ACCEPT iptables -A FORWARD -i tap+ -j ACCEPT </pre> ==Configuring the Client== Edit the client.conf file: '''''vi /etc/openvpn/client.conf''''' <pre> ## Config client ## Device Interface ;dev tap dev tun ## Tap adapter name (Win only) ;dev-node MyTap ## Conectivity ;proto tcp proto udp ## Server [hostname/ip] [port] remote my-server-1 1194 ;remote my-server-2 1194 ## load-balancing ;remote-random ## resolve host name OpenVPN server resolv-retry infinite # local port nobind ## privileges (non windows saja) user nobody group nobody ## preserve persist-key persist-tun ## HTTP proxy ;http-proxy-retry ;http-proxy [proxy server] [proxy port] ## duplicate packet warnings ;mute-replay-warnings ## SSL/TLS parms /etc/openvpn/certs/ca ca.crt /etc/openvpn/certs/cert client.crt /etc/openvpn/certs/key client.key ## nsCertType key ;ns-cert-type server ## tls-auth key ;tls-auth /etc/openvpn/certs/ta.key 1 ## Cryptographic cipher ;cipher x ## Link compression comp-lzo ## verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## repeating messages ;mute 20 </pre> '''Routing''' <pre> route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.4.0.1 </pre> ==Example== '''Example 1:''' A simple tunnel without security<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9 </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 2:''' A tunnel with static-key security (i.e. using a pre-shared secret)<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --verb 5 --secret key </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --verb 5 --secret key </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 3:''' A tunnel with full TLS-based security <br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --tls-client --ca tmp-ca.crt --cert client.crt --key client.key \ --reneg-sec 60 --verb 5 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --tls-server --ca tmp-ca.crt --cert server.crt --key server.key \ --reneg-sec 60 --verb 5 --dh dh1024.pem </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 == External Links == * http://dmalloc.com/ * http://valgrind.org/ * http://www.oberhumer.com/opensource/lzo/ * http://openvpn.net/ * http://openvpn.net/howto.html * http://openvpn.net/1xhowto.html (Old-v1.06) * http://openvpn.net/man.html 0462ca3047258dda5e6c37ec123b891898da6831 712 707 2012-06-09T19:10:37Z Arfon 70 Moved old instructions to their own page. Made this page a menu for the instructions wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] As a user-space VPN daemon, OpenVPN is compatible with with SSL/TLS, RSA Certificates and X509 PKI, NAT, DHCP, and TUN/TAP virtual devices. OpenVPN is not compatible with IPSec, IKE, PPTP, or L2TP. [[openvpn_smcr_2012|OpenVPN server setup on Slackware 13.37]] - Multi-client with routing (not bridged). (2012) [[openvpn_pre-2009|OpenVPN server/client instructions]] (Pre-2009) [[OpenVPN(ID)|OpenVPN Instructions - Bahasa Indonesia]] (Pre-2009) c4dcfbe0b1b7c77302665f1f61a11c36b109a679 713 712 2012-06-09T19:12:02Z Arfon 70 Fixed broken link wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] As a user-space VPN daemon, OpenVPN is compatible with with SSL/TLS, RSA Certificates and X509 PKI, NAT, DHCP, and TUN/TAP virtual devices. OpenVPN is not compatible with IPSec, IKE, PPTP, or L2TP. [[OpenVPN_smcr_2012|OpenVPN server setup on Slackware 13.37]] - Multi-client with routing (not bridged). (2012) [[OpenVPN_pre-2009|OpenVPN server/client instructions]] (Pre-2009) [[OpenVPN(ID)|OpenVPN Instructions - Bahasa Indonesia]] (Pre-2009) 46595cab4b4db12413ceb82b2c8e661358a584d9 Pptp 0 285 708 2012-06-09T18:13:06Z Arfon 70 Created! wikitext text/x-wiki ==(Poptop) pptpd Server Setup== Here's what I did to get Poptop pptpd (1.3.4) running on my Slackware (13.37) box. 1) Install the official Slackware ppp package using pkgtool or slackpkg. 2) Install the ppptpd package from Slackbuilds.org using sbopkg. ***NOTE: The package name is NOT Poptop, it's pptpd*** 3) Edit /etc/pptpd.conf ADD: localip 10.7.0.1 remoteip 10.7.0.2-50 CHANGE: option /etc/ppp/options.pptpd -> option /etc/ppp/options 4) Edit /etc/ppp/options HERE IS A GOTCHA- The official Slackware ppp package (at the time of this writing) contains an error in the options file. The pppd binary was compiled to look for the new ms-dns parameter but the option file has the old dns-addr parameter. CHANGE: # dns-addr 192.168.1.1 -> ms-dns 8.8.8.8 (or whatever your dns server is) 5) Edit the /etc/ppp/chap-secrets file. For some reason, the default Slackware package has 4 example entries in it that are not commented (jacco,*,sam,*) delete these. You don't want jacco or sam to have a free connection into your box... ADD: one entry for each user you want to allow access. Format is: CLIENT [tab] SERVER [tab] PASSWORD [tab] IP ADDRESS Mine looks like this: bob * "BobsPasswordIsStrong" * sue * "FluffyBunnies92" * 6) Finally to start pptpd, n0rmally you would just execute 'pptpd &' but being that I'm a good Slacker, I wrote an rc.pptpd script. Create /etc/rc.d/rc.pptpd contents: #!/bin/sh # # /etc/rc.d/rc.pptpd # # Start/stop/restart the pptpd server. # # To make PopTop start automatically at boot, make this # file executable: chmod 755 /etc/rc.d/rc.pptpd # pptpd_start() { if [ -x /usr/sbin/pptpd ]; then echo "Starting PopTop pptpd: /usr/sbin/pptpd server.conf" /usr/sbin/pptpd & fi } pptpd_stop() { killall pptpd } pptpd_restart() { pptpd_stop sleep 2 pptpd_start } case "$1" in 'start') pptpd_start ;; 'stop') pptpd_stop ;; 'restart') pptpd_restart ;; *) # Default is "start", for backwards compatibility with previous # Slackware versions. This may change to a 'usage' error someday. pptpd_start esac 7) Make it executable (and autobootable on start up) chmod 755 /etc/rc.d/rc.pptpd To start it manually- /etc/rc.d/rc.pptpd start To be useful you next need to configure your firewall to forward and masquerade traffic from the vpn out to the world... 8) Edit/create: /etc/rc.d/rc.firewall ADD: iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i ppp+ -j ACCEPT iptables -A FORWARD -o ppp+ -j ACCEPT iptables -A FORWARD -j ACCEPT iptables -t nat -A POSTROUTING -s 10.7.0.0/24 -o ppp+ -j MASQUERADE 9) Make it executable chmod 755 /etc/rc.d/rc.firewall 10) Flush the old firewall rules (forgetting to do this caused me all sorts of grief (Thanks mancha)) iptables -f 11) Execute the new firewall rules /etc/rc.d/rc.firewall If you and I haven't made any mistakes, you should now have pptp (server) and router working on your box. ==pptp Client Setup== Needs to be added. 04087f08d587a72677a2abcec795f43b6fcba306 709 708 2012-06-09T18:16:31Z Arfon 70 /* (Poptop) pptpd Server Setup */ typo fix wikitext text/x-wiki ==(Poptop) pptpd Server Setup== Here's what I did to get Poptop pptpd (1.3.4) running on my Slackware (13.37) box. 1) Install the official Slackware ppp package using pkgtool or slackpkg. 2) Install the ppptpd package from Slackbuilds.org using sbopkg. ***NOTE: The package name is NOT Poptop, it's pptpd*** 3) Edit /etc/pptpd.conf ADD: localip 10.7.0.1 remoteip 10.7.0.2-50 CHANGE: option /etc/ppp/options.pptpd -> option /etc/ppp/options 4) Edit /etc/ppp/options HERE IS A GOTCHA- The official Slackware ppp package (at the time of this writing) contains an error in the options file. The pppd binary was compiled to look for the new ms-dns parameter but the option file has the old dns-addr parameter. CHANGE: # dns-addr 192.168.1.1 -> ms-dns 8.8.8.8 (or whatever your dns server is) 5) Edit the /etc/ppp/chap-secrets file. For some reason, the default Slackware package has 4 example entries in it that are not commented (jacco,*,sam,*) delete these. You don't want jacco or sam to have a free connection into your box... ADD: one entry for each user you want to allow access. Format is: CLIENT [tab] SERVER [tab] PASSWORD [tab] IP ADDRESS Mine looks like this: bob * "BobsPasswordIsStrong" * sue * "FluffyBunnies92" * 6) Finally to start pptpd, normally you would just execute 'pptpd &' but being that I'm a good Slacker, I wrote an rc.pptpd script. Create /etc/rc.d/rc.pptpd contents: #!/bin/sh # # /etc/rc.d/rc.pptpd # # Start/stop/restart the pptpd server. # # To make PopTop start automatically at boot, make this # file executable: chmod 755 /etc/rc.d/rc.pptpd # pptpd_start() { if [ -x /usr/sbin/pptpd ]; then echo "Starting PopTop pptpd: /usr/sbin/pptpd server.conf" /usr/sbin/pptpd & fi } pptpd_stop() { killall pptpd } pptpd_restart() { pptpd_stop sleep 2 pptpd_start } case "$1" in 'start') pptpd_start ;; 'stop') pptpd_stop ;; 'restart') pptpd_restart ;; *) # Default is "start", for backwards compatibility with previous # Slackware versions. This may change to a 'usage' error someday. pptpd_start esac 7) Make it executable (and autobootable on start up) chmod 755 /etc/rc.d/rc.pptpd To start it manually- /etc/rc.d/rc.pptpd start To be useful you next need to configure your firewall to forward and masquerade traffic from the vpn out to the world... 8) Edit/create: /etc/rc.d/rc.firewall ADD: iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i ppp+ -j ACCEPT iptables -A FORWARD -o ppp+ -j ACCEPT iptables -A FORWARD -j ACCEPT iptables -t nat -A POSTROUTING -s 10.7.0.0/24 -o ppp+ -j MASQUERADE 9) Make it executable chmod 755 /etc/rc.d/rc.firewall 10) Flush the old firewall rules (forgetting to do this caused me all sorts of grief (Thanks mancha)) iptables -f 11) Execute the new firewall rules /etc/rc.d/rc.firewall If you and I haven't made any mistakes, you should now have pptp (server) and router working on your box. ==pptp Client Setup== Needs to be added. f5a5426ef0503c838e44548b65e63465012b2af8 710 709 2012-06-09T19:00:22Z Arfon 70 /* (Poptop) pptpd Server Setup */ iptables -f --> iptables -F wikitext text/x-wiki ==(Poptop) pptpd Server Setup== Here's what I did to get Poptop pptpd (1.3.4) running on my Slackware (13.37) box. 1) Install the official Slackware ppp package using pkgtool or slackpkg. 2) Install the ppptpd package from Slackbuilds.org using sbopkg. ***NOTE: The package name is NOT Poptop, it's pptpd*** 3) Edit /etc/pptpd.conf ADD: localip 10.7.0.1 remoteip 10.7.0.2-50 CHANGE: option /etc/ppp/options.pptpd -> option /etc/ppp/options 4) Edit /etc/ppp/options HERE IS A GOTCHA- The official Slackware ppp package (at the time of this writing) contains an error in the options file. The pppd binary was compiled to look for the new ms-dns parameter but the option file has the old dns-addr parameter. CHANGE: # dns-addr 192.168.1.1 -> ms-dns 8.8.8.8 (or whatever your dns server is) 5) Edit the /etc/ppp/chap-secrets file. For some reason, the default Slackware package has 4 example entries in it that are not commented (jacco,*,sam,*) delete these. You don't want jacco or sam to have a free connection into your box... ADD: one entry for each user you want to allow access. Format is: CLIENT [tab] SERVER [tab] PASSWORD [tab] IP ADDRESS Mine looks like this: bob * "BobsPasswordIsStrong" * sue * "FluffyBunnies92" * 6) Finally to start pptpd, normally you would just execute 'pptpd &' but being that I'm a good Slacker, I wrote an rc.pptpd script. Create /etc/rc.d/rc.pptpd contents: #!/bin/sh # # /etc/rc.d/rc.pptpd # # Start/stop/restart the pptpd server. # # To make PopTop start automatically at boot, make this # file executable: chmod 755 /etc/rc.d/rc.pptpd # pptpd_start() { if [ -x /usr/sbin/pptpd ]; then echo "Starting PopTop pptpd: /usr/sbin/pptpd server.conf" /usr/sbin/pptpd & fi } pptpd_stop() { killall pptpd } pptpd_restart() { pptpd_stop sleep 2 pptpd_start } case "$1" in 'start') pptpd_start ;; 'stop') pptpd_stop ;; 'restart') pptpd_restart ;; *) # Default is "start", for backwards compatibility with previous # Slackware versions. This may change to a 'usage' error someday. pptpd_start esac 7) Make it executable (and autobootable on start up) chmod 755 /etc/rc.d/rc.pptpd To start it manually- /etc/rc.d/rc.pptpd start To be useful you next need to configure your firewall to forward and masquerade traffic from the vpn out to the world... 8) Edit/create: /etc/rc.d/rc.firewall ADD: iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i ppp+ -j ACCEPT iptables -A FORWARD -o ppp+ -j ACCEPT iptables -A FORWARD -j ACCEPT iptables -t nat -A POSTROUTING -s 10.7.0.0/24 -o ppp+ -j MASQUERADE 9) Make it executable chmod 755 /etc/rc.d/rc.firewall 10) Flush the old firewall rules (forgetting to do this caused me all sorts of grief (Thanks mancha)) iptables -F 11) Execute the new firewall rules /etc/rc.d/rc.firewall If you and I haven't made any mistakes, you should now have pptp (server) and router working on your box. ==pptp Client Setup== Needs to be added. d6ca6f32fbd8bdc4361414e4b2f4a70f84d87995 725 710 2012-06-13T14:50:40Z Arfon 70 ADDED: categories wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] ==(Poptop) pptpd Server Setup== Here's what I did to get Poptop pptpd (1.3.4) running on my Slackware (13.37) box. 1) Install the official Slackware ppp package using pkgtool or slackpkg. 2) Install the ppptpd package from Slackbuilds.org using sbopkg. ***NOTE: The package name is NOT Poptop, it's pptpd*** 3) Edit /etc/pptpd.conf ADD: localip 10.7.0.1 remoteip 10.7.0.2-50 CHANGE: option /etc/ppp/options.pptpd -> option /etc/ppp/options 4) Edit /etc/ppp/options HERE IS A GOTCHA- The official Slackware ppp package (at the time of this writing) contains an error in the options file. The pppd binary was compiled to look for the new ms-dns parameter but the option file has the old dns-addr parameter. CHANGE: # dns-addr 192.168.1.1 -> ms-dns 8.8.8.8 (or whatever your dns server is) 5) Edit the /etc/ppp/chap-secrets file. For some reason, the default Slackware package has 4 example entries in it that are not commented (jacco,*,sam,*) delete these. You don't want jacco or sam to have a free connection into your box... ADD: one entry for each user you want to allow access. Format is: CLIENT [tab] SERVER [tab] PASSWORD [tab] IP ADDRESS Mine looks like this: bob * "BobsPasswordIsStrong" * sue * "FluffyBunnies92" * 6) Finally to start pptpd, normally you would just execute 'pptpd &' but being that I'm a good Slacker, I wrote an rc.pptpd script. Create /etc/rc.d/rc.pptpd contents: #!/bin/sh # # /etc/rc.d/rc.pptpd # # Start/stop/restart the pptpd server. # # To make PopTop start automatically at boot, make this # file executable: chmod 755 /etc/rc.d/rc.pptpd # pptpd_start() { if [ -x /usr/sbin/pptpd ]; then echo "Starting PopTop pptpd: /usr/sbin/pptpd server.conf" /usr/sbin/pptpd & fi } pptpd_stop() { killall pptpd } pptpd_restart() { pptpd_stop sleep 2 pptpd_start } case "$1" in 'start') pptpd_start ;; 'stop') pptpd_stop ;; 'restart') pptpd_restart ;; *) # Default is "start", for backwards compatibility with previous # Slackware versions. This may change to a 'usage' error someday. pptpd_start esac 7) Make it executable (and autobootable on start up) chmod 755 /etc/rc.d/rc.pptpd To start it manually- /etc/rc.d/rc.pptpd start To be useful you next need to configure your firewall to forward and masquerade traffic from the vpn out to the world... 8) Edit/create: /etc/rc.d/rc.firewall ADD: iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i ppp+ -j ACCEPT iptables -A FORWARD -o ppp+ -j ACCEPT iptables -A FORWARD -j ACCEPT iptables -t nat -A POSTROUTING -s 10.7.0.0/24 -o ppp+ -j MASQUERADE 9) Make it executable chmod 755 /etc/rc.d/rc.firewall 10) Flush the old firewall rules (forgetting to do this caused me all sorts of grief (Thanks mancha)) iptables -F 11) Execute the new firewall rules /etc/rc.d/rc.firewall If you and I haven't made any mistakes, you should now have pptp (server) and router working on your box. ==pptp Client Setup== Needs to be added. a28dd0fdb696a708217fbb99c929d401a1f060b9 OpenVPN pre-2009 0 286 711 2012-06-09T19:03:37Z Arfon 70 Moved from OpenVPN wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] As a user-space VPN daemon, OpenVPN is compatible with with SSL/TLS, RSA Certificates and X509 PKI, NAT, DHCP, and TUN/TAP virtual devices. OpenVPN is not compatible with IPSec, IKE, PPTP, or L2TP. '''[[OpenVPN(ID)|OpenVPN Instructions - Bahasa Indonesia]]''' __TOC__ == Installation == '''EASY WAY:''' Download and install from Slackbuilds.org or sbopkg. or '''HARD WAY:''' Install from source. Download source from [http://openvpn.net openvpn.net] Download verison 2.0 install Lzo <pre> tar zxvf lzo-1.08.tar.gz cd lzo-1-08.tar.gz ./configure --prefix=/usr make ; make install-strip </pre> install OpenVPN <pre> tar zxvf openvpn-2.0.tar.gz cd openvpn-2.0 ./configure --prefix=/usr \ --sysconfdir=/etc/openvpn \ --enable-pthread \ --enable-iproute2 \ --with-ssl \ --with-lzo-header=/usr/include \ --with-lzo-lib=/usr/lib \ --with-ifconfig \ --with-route \ --with-mem-check=dmalloc make ; make install-strip </pre> ==Creating The Certificates== Save all certificates in '''''/etc/openvpn/certs''''' <pre> This is a small RSA key management package, based on the openssl command line tool, that can be found in the easy-rsa subdirectory of the OpenVPN distribution. These are reference notes. For step by step instructions, see the HOWTO: http://openvpn.net/howto.html INSTALL 1. Edit vars. 2. Set KEY_CONFIG to point to the openssl.cnf file included in this distribution. 3. Set KEY_DIR to point to a directory which will contain all keys, certificates, etc. This directory need not exist, and if it does, it will be deleted with rm -rf, so BE CAREFUL how you set KEY_DIR. 4. (Optional) Edit other fields in vars per your site data. You may want to increase KEY_SIZE to 2048 if you are paranoid and don't mind slower key processing, but certainly 1024 is fine for testing purposes. KEY_SIZE must be compatible across both peers participating in a secure SSL/TLS connection. 5 . vars 6. ./clean-all 7. As you create certificates, keys, and certificate signing requests, understand that only .key files should be kept confidential. .crt and .csr files can be sent over insecure channels such as plaintext email. 8. You should never need to copy a .key file between computers. Normally each computer will have its own certificate/key pair. BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY 1. ./build-ca 2. ca.crt and ca.key will be built in your KEY_DIR directory BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) 1. ./build-inter inter 2. inter.crt and inter.key will be built in your KEY_DIR directory and signed with your root certificate. BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). 1. ./build-dh BUILD A CERTIFICATE SIGNING REQUEST (If you want to sign your certificate with a root certificate controlled by another individual or organization, or residing on a different machine). 1. Get ca.crt (the root certificate) from your certificate authority. Though this transfer can be over an insecure channel, to prevent man-in-the-middle attacks you must confirm that ca.crt was not tampered with. Large CAs solve this problem by hardwiring their root certificates into popular web browsers. A simple way to verify a root CA is to call the issuer on the telephone and confirm that the md5sum or sha1sum signatures on the ca.crt files match (such as with the command: "md5sum ca.crt"). 2. Choose a name for your certificate such as your computer name. In our example we will use "mycert". 3. ./build-req mycert 4. You can ignore most of the fields, but set "Common Name" to something unique such as your computer's host name. Leave all password fields blank, unless you want your private key to be protected by password. Using a password is not required -- it will make your key more secure but also more inconvenient to use, because you will need to supply your password anytime the key is used. NOTE: if you are using a password, use ./build-req-pass instead of ./build-req 5. Your key will be written to $KEY_DIR/mycert.key 6. Your certificate signing request will be written to to $KEY_DIR/mycert.csr 7. Email mycert.csr to the individual or organization which controls the root certificate. This can be done over an insecure channel. 8. After the .csr file is signed by the root certificate authority, you will receive a file mycert.crt (your certificate). Place mycert.crt in your KEY_DIR directory. 9. The combined files of mycert.crt, mycert.key, and ca.crt can now be used to secure one end of an SSL/TLS connection. SIGN A CERTIFICATE SIGNING REQUEST 1. ./sign-req mycert 2. mycert.crt will be built in your KEY_DIR directory using mycert.csr and your root CA file as input. BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY -- this script generates and signs a certificate in one step, but it requires that the generated certificate and private key files be copied to the destination host over a secure channel. 1. ./build-key mycert (no password protection) 2. OR ./build-key-pass mycert (with password protection) 3. OR ./build-key-pkcs12 mycert (PKCS #12 format) 4. OR ./build-key-server mycert (with nsCertType=server) 5. mycert.crt and mycert.key will be built in your KEY_DIR directory, and mycert.crt will be signed by your root CA. If ./build-key-pkcs12 was used a mycert.p12 file will also be created including the private key, certificate and the ca certificate. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. IMPORTANT To avoid a possible Man-in-the-Middle attack where an authorized client tries to connect to another client by impersonating the server, make sure to enforce some kind of server certificate verification by clients. There are currently four different ways of accomplishing this, listed in the order of preference: (1) Build your server certificates with the build-key-server script. This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration: ns-cert-type server This will block clients from connecting to any server which lacks the nsCertType=server designation in its certificate, even if the certificate has been signed by the CA which is cited in the OpenVPN configuration file (--ca directive). (2) Use the --tls-remote directive on the client to accept/reject the server connection based on the common name of the server certificate. (3) Use a --tls-verify script or plugin to accept/reject the server connection based on a custom test of the server certificate's embedded X509 subject details. (4) Sign server certificates with one CA and client certificates with a different CA. The client config "ca" directive should reference the server-signing CA while the server config "ca" directive should reference the client-signing CA. NOTES Show certificate fields: openssl x509 -in cert.crt -text </pre> <pre> # cd easy-rsa # vi vars . vars ./clean-all ## BUILD YOUR OWN ROOT CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY ./build.ca ## BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional) ./build-inter inter ## BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection). ./build.dh ## BUILD A CERTIFICATE SIGNING REQUEST ## (If you want to sign your certificate with a root certificate controlled by another individual ## or organization, or residing on a different machine) ./build-req mycert ## SIGN A CERTIFICATE SIGNING REQUEST ./sign-req mycert ## BUILD AND SIGN A CERTIFICATE SIGNING REQUEST USING A LOCALLY INSTALLED ROOT CERTIFICATE/KEY ./build-key mycert (no password protection) OR ./build-key-pass mycert (with password protection) OR ./build-key-pkcs12 mycert (PKCS #12 format) OR ./build-key-server mycert (with nsCertType=server) </pre> ==Configuring the Server== Edit the server.conf file: '''''vi /etc/openvpn/server.conf''''' <pre> ## Mode Server mode server ## Local Host Name/IP Server ;local 127.0.0.1 ## Protocol ;proto tcp proto udp ## Port ; port 1194 ## Device Interface ;dev tap dev tun ## TAP-Win32 adapter name ;dev-node MyTap ## SSL/TLS ## root certificate (ca) ## certificate (cert) ## private key (key) ca /etc/openvpn/certs/ca.crt cert /etc/openvpn/certs/server.crt key /etc/openvpn/certs/server.key ## Diffie hellman parameters dh dh1024.pem ## VPN subnet server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt ##ethernet bridging ;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100 ## dhcpcaveats ;push "route 192.168.10.0 255.255.255.0" ;push "route 192.168.20.0 255.255.255.0" ;client-config-dir ccd ;route 192.168.40.128 255.255.255.248 ;client-config-dir ccd ;route 10.9.0.0 255.255.255.252 ;learn-address ./script ## dhcpcaveats ;push "redirect-gateway" ;push "dhcp-option DNS 10.8.0.1" ;push "dhcp-option WINS 10.8.0.1" ## ;client-to-client ## same "COMMON NAME" certificate/key ;duplicate-cn ## Status Connection keepalive 10 120 ## tls-auth key ;tls-auth ta.key 0 ## Cryptographic cipher ;cipher BF-CBC # Blowfish (default) ;cipher AES-128-CBC # AES ;cipher DES-EDE3-CBC # Triple-DES ## Link Compresion comp-lzo ## Max Client Connections ;max-clients 100 ## daemon privileges (non windows saja) user nobody group nobody persist-key persist-tun ## Openvpn Log ;log /var/log/openvpn/openvpn.log ;log-append /var/log/openvpn/openvpn.log ## Output Log status /var/log/openvpn/openvpn-status.log ## Log Verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## Repeating Messages ;mute 20 ## Pid File writepid /var/run/openvpn.pid </pre> '''Routing''' <pre> echo 1 > /proc/sys/net/ipv4/ip_forward route add -net 10.0.1.0 netmask 255.255.255.0 gw 10.4.0.2 </pre> '''Firewall''' <pre> iptables -A INPUT -p udp -s 1.2.3.4 --dport 1194 -j ACCEPT OR iptables -A INPUT -p udp --dport 1194 -j ACCEPT ## Tun Device iptables -A INPUT -i tun+ -j ACCEPT iptables -A FORWARD -i tun+ -j ACCEPT ## Tap Device iptables -A INPUT -i tap+ -j ACCEPT iptables -A FORWARD -i tap+ -j ACCEPT </pre> ==Configuring the Client== Edit the client.conf file: '''''vi /etc/openvpn/client.conf''''' <pre> ## Config client ## Device Interface ;dev tap dev tun ## Tap adapter name (Win only) ;dev-node MyTap ## Conectivity ;proto tcp proto udp ## Server [hostname/ip] [port] remote my-server-1 1194 ;remote my-server-2 1194 ## load-balancing ;remote-random ## resolve host name OpenVPN server resolv-retry infinite # local port nobind ## privileges (non windows saja) user nobody group nobody ## preserve persist-key persist-tun ## HTTP proxy ;http-proxy-retry ;http-proxy [proxy server] [proxy port] ## duplicate packet warnings ;mute-replay-warnings ## SSL/TLS parms /etc/openvpn/certs/ca ca.crt /etc/openvpn/certs/cert client.crt /etc/openvpn/certs/key client.key ## nsCertType key ;ns-cert-type server ## tls-auth key ;tls-auth /etc/openvpn/certs/ta.key 1 ## Cryptographic cipher ;cipher x ## Link compression comp-lzo ## verbosity ## 0 is silent, except for fatal errors ## 4 is reasonable for general usage ## 5 and 6 can help to debug connection problems ## 9 is extremely verbose verb 3 ## repeating messages ;mute 20 </pre> '''Routing''' <pre> route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.4.0.1 </pre> ==Example== '''Example 1:''' A simple tunnel without security<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 --verb 9 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 --verb 9 </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 2:''' A tunnel with static-key security (i.e. using a pre-shared secret)<br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --verb 5 --secret key </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --verb 5 --secret key </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 '''Example 3:''' A tunnel with full TLS-based security <br> '''On May: Server Side''' <pre> openvpn --remote jun.kg --dev tun1 --ifconfig 10.4.0.1 10.4.0.2 \ --tls-client --ca tmp-ca.crt --cert client.crt --key client.key \ --reneg-sec 60 --verb 5 </pre> '''On Jun: Client Side''' <pre> openvpn --remote may.kg --dev tun1 --ifconfig 10.4.0.2 10.4.0.1 \ --tls-server --ca tmp-ca.crt --cert server.crt --key server.key \ --reneg-sec 60 --verb 5 --dh dh1024.pem </pre> On May: ping 10.4.0.2 On Jun: ping 10.4.0.1 == External Links == * http://dmalloc.com/ * http://valgrind.org/ * http://www.oberhumer.com/opensource/lzo/ * http://openvpn.net/ * http://openvpn.net/howto.html * http://openvpn.net/1xhowto.html (Old-v1.06) * http://openvpn.net/man.html 0462ca3047258dda5e6c37ec123b891898da6831 OpenVPN smcr 2012 0 287 714 2012-06-09T19:16:19Z Arfon 70 CREATED! Saved because I put a lot of work into it so far and don't wanna lose it wikitext text/x-wiki Here's what I did yo get OpenVPN (2.1.4) on my Slackware (13.37) box. I wanted to get on the internet from public wifi WITHOUT being snooped on so I installed a MULTI-CLIENT, ROUTED (not bridged) OpenVPN server on my Linode. Again, this is MULTI-CLIENT and ROUTED. 1) Install OpenVPN from Slackbuilds.org or using sbopkg 2) Generate the needed certificates and keys- cd /usr/doc/openvpn-2.1.4/easy-rsa/2.0/ vi vars Set the KEY_COUNTRY, KEY_PROVINCE, KEY_CITY, KEY_ORG, and KEY_EMAIL parameters. Don't leave any of these parameters blank. source ./vars ./clean-all ./build-ca answer questions ./build-key-server server (server could be anything e.g. VPN1.blah.net) answer questions ./build-key client1 (client1 can be anything e.g bobs-phone) answer questions repeat for each client to have ./build-dh 3) Put the server certs and keys where they need to be- mkdir /etc/openvpn/certsnkeys cp ca.crt /etc/openvpn/certsnkeys/ cp ca.key /etc/openvpn/certsnkeys/ cp server.crt /etc/openvpn/certsnkeys/ cp server.key /etc/openvpn/certsnkeys/ cp dh1024.pem /etc/openvpn/ 4) Send the client certs and keys where they need to be- Each client gets a copy of his client.crt and client.key AND a copy of ca.crt EXAMPLE: My android got a copy of client1.crt, client2.key and ca.crt. My laptop got a copy of client2.crt, client2.key and ca.crt NOTE: my android need a .p12 file, more on that below. 5) Configure the server.conf file- cd /usr/doc/openvpn-2.1.4 cp server.conf.sample /etc/openvpn/server.conf cd /etc/openvpn ***NOTE: in /etc/openvpn you will see a file called openvpn.conf. DO NOT USE THAT! Use server.conf*** Edit /etc/openvpn/server.conf CHANGE: ca ca.crt -> ca /etc/openvpn/certs/ca.crt cert server.crt -> cert /etc/openvpn/certsnkeys/server.crt key server.key -> key /etc/openvpn/certsnkeys/server.key dh dh.pem -> dh /etc/openvpn/dh1024.pem 6) Start OpenVPN- Normally you would start OpenVPN by: openvpn /etc/openvpn/server.conf but, being that I'm a good Slacker, I created an rc.openvpn file... CREATE: /etc/rc.d/rc.openvpn CONTAINS: #!/bin/sh # # /etc/rc.d/rc.openvpn # # Start/stop/restart the openvpn server. # # To make OpenVPN start automatically at boot, make this # file executable: chmod 755 /etc/rc.d/rc.openvpn # ovpn_start() { if [ -x /usr/sbin/openvpn -a -r /etc/openvpn/server.conf ]; then echo "Starting OpenVPN: /usr/sbin/openvpn server.conf" /usr/sbin/openvpn /etc/openvpn/server.conf & fi } ovpn_stop() { killall openvpn } ovpn_restart() { ovpn_stop sleep 2 ovpn_start } case "$1" in 'start') ovpn_start ;; 'stop') ovpn_stop ;; 'restart') ovpn_restart ;; *) # Default is "start", for backwards compatibility with previous # Slackware versions. This may change to a 'usage' error someday. ovpn_start esac 7) Make it executable (and autostart on reboots)- chmod 755 /etc/rc.d/rc.openvpn To start/stop it manually- /etc/rc.d/rc.openvpn start (or stop or restart) Now let's fix the firewall so our clients can get to the rest of the world... 8) Edit/create /etc/rc.d/rc.firewall ADD: iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i tun+ -j ACCEPT iptables -A FORWARD -o tun+ -j ACCEPT iptables -A FORWARD -j ACCEPT iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE 9) Flush the old firewall rules- iptables -F 10) Activate the new rules now- /etc/rc.d/rc.firewall If the planets are aligned, you should now have a working OpenVPN server/router. 219738788818d7a21a5c5ec28e7438c7f5a654bb 715 714 2012-06-09T19:18:24Z Arfon 70 Fixed some trash wikitext text/x-wiki '''OPENVPN MULTI-CLIENT ROUTED SERVER''' Here's what I did to get OpenVPN (2.1.4) on my Slackware (13.37) box. I wanted to get on the internet from public wifi WITHOUT being snooped on so I installed a MULTI-CLIENT, ROUTED (not bridged) OpenVPN server on my Linode. Again, this is MULTI-CLIENT and ROUTED. 1) Install OpenVPN from Slackbuilds.org or using sbopkg 2) Generate the needed certificates and keys- cd /usr/doc/openvpn-2.1.4/easy-rsa/2.0/ vi vars Set the KEY_COUNTRY, KEY_PROVINCE, KEY_CITY, KEY_ORG, and KEY_EMAIL parameters. Don't leave any of these parameters blank. source ./vars ./clean-all ./build-ca answer questions ./build-key-server server (server could be anything e.g. VPN1.blah.net) answer questions ./build-key client1 (client1 can be anything e.g bobs-phone) answer questions repeat for each client to have ./build-dh 3) Put the server certs and keys where they need to be- mkdir /etc/openvpn/certsnkeys cp ca.crt /etc/openvpn/certsnkeys/ cp ca.key /etc/openvpn/certsnkeys/ cp server.crt /etc/openvpn/certsnkeys/ cp server.key /etc/openvpn/certsnkeys/ cp dh1024.pem /etc/openvpn/ 4) Send the client certs and keys where they need to be- Each client gets a copy of his client.crt and client.key AND a copy of ca.crt EXAMPLE: My android got a copy of client1.crt, client2.key and ca.crt. My laptop got a copy of client2.crt, client2.key and ca.crt NOTE: my android need a .p12 file, more on that below. 5) Configure the server.conf file- cd /usr/doc/openvpn-2.1.4 cp server.conf.sample /etc/openvpn/server.conf cd /etc/openvpn ***NOTE: in /etc/openvpn you will see a file called openvpn.conf. DO NOT USE THAT! Use server.conf*** Edit /etc/openvpn/server.conf CHANGE: ca ca.crt -> ca /etc/openvpn/certs/ca.crt cert server.crt -> cert /etc/openvpn/certsnkeys/server.crt key server.key -> key /etc/openvpn/certsnkeys/server.key dh dh.pem -> dh /etc/openvpn/dh1024.pem 6) Start OpenVPN- Normally you would start OpenVPN by: openvpn /etc/openvpn/server.conf but, being that I'm a good Slacker, I created an rc.openvpn file... CREATE: /etc/rc.d/rc.openvpn CONTAINS: #!/bin/sh # # /etc/rc.d/rc.openvpn # # Start/stop/restart the openvpn server. # # To make OpenVPN start automatically at boot, make this # file executable: chmod 755 /etc/rc.d/rc.openvpn # ovpn_start() { if [ -x /usr/sbin/openvpn -a -r /etc/openvpn/server.conf ]; then echo "Starting OpenVPN: /usr/sbin/openvpn server.conf" /usr/sbin/openvpn /etc/openvpn/server.conf & fi } ovpn_stop() { killall openvpn } ovpn_restart() { ovpn_stop sleep 2 ovpn_start } case "$1" in 'start') ovpn_start ;; 'stop') ovpn_stop ;; 'restart') ovpn_restart ;; *) # Default is "start", for backwards compatibility with previous # Slackware versions. This may change to a 'usage' error someday. ovpn_start esac 7) Make it executable (and autostart on reboots)- chmod 755 /etc/rc.d/rc.openvpn To start/stop it manually- /etc/rc.d/rc.openvpn start (or stop or restart) Now let's fix the firewall so our clients can get to the rest of the world... 8) Edit/create /etc/rc.d/rc.firewall ADD: iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i tun+ -j ACCEPT iptables -A FORWARD -o tun+ -j ACCEPT iptables -A FORWARD -j ACCEPT iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE 9) Flush the old firewall rules- iptables -F 10) Activate the new rules now- /etc/rc.d/rc.firewall If the planets are aligned, you should now have a working OpenVPN server/router. c916ddaf07d38f37e5dc5736e0a24b3d9d277398 716 715 2012-06-09T19:21:54Z Arfon 70 ADDED: Categories wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] '''OPENVPN MULTI-CLIENT ROUTED SERVER''' Here's what I did to get OpenVPN (2.1.4) on my Slackware (13.37) box. I wanted to get on the internet from public wifi WITHOUT being snooped on so I installed a MULTI-CLIENT, ROUTED (not bridged) OpenVPN server on my Linode. Again, this is MULTI-CLIENT and ROUTED. 1) Install OpenVPN from Slackbuilds.org or using sbopkg 2) Generate the needed certificates and keys- cd /usr/doc/openvpn-2.1.4/easy-rsa/2.0/ vi vars Set the KEY_COUNTRY, KEY_PROVINCE, KEY_CITY, KEY_ORG, and KEY_EMAIL parameters. Don't leave any of these parameters blank. source ./vars ./clean-all ./build-ca answer questions ./build-key-server server (server could be anything e.g. VPN1.blah.net) answer questions ./build-key client1 (client1 can be anything e.g bobs-phone) answer questions repeat for each client to have ./build-dh 3) Put the server certs and keys where they need to be- mkdir /etc/openvpn/certsnkeys cp ca.crt /etc/openvpn/certsnkeys/ cp ca.key /etc/openvpn/certsnkeys/ cp server.crt /etc/openvpn/certsnkeys/ cp server.key /etc/openvpn/certsnkeys/ cp dh1024.pem /etc/openvpn/ 4) Send the client certs and keys where they need to be- Each client gets a copy of his client.crt and client.key AND a copy of ca.crt EXAMPLE: My android got a copy of client1.crt, client2.key and ca.crt. My laptop got a copy of client2.crt, client2.key and ca.crt NOTE: my android need a .p12 file, more on that below. 5) Configure the server.conf file- cd /usr/doc/openvpn-2.1.4 cp server.conf.sample /etc/openvpn/server.conf cd /etc/openvpn ***NOTE: in /etc/openvpn you will see a file called openvpn.conf. DO NOT USE THAT! Use server.conf*** Edit /etc/openvpn/server.conf CHANGE: ca ca.crt -> ca /etc/openvpn/certs/ca.crt cert server.crt -> cert /etc/openvpn/certsnkeys/server.crt key server.key -> key /etc/openvpn/certsnkeys/server.key dh dh.pem -> dh /etc/openvpn/dh1024.pem 6) Start OpenVPN- Normally you would start OpenVPN by: openvpn /etc/openvpn/server.conf but, being that I'm a good Slacker, I created an rc.openvpn file... CREATE: /etc/rc.d/rc.openvpn CONTAINS: #!/bin/sh # # /etc/rc.d/rc.openvpn # # Start/stop/restart the openvpn server. # # To make OpenVPN start automatically at boot, make this # file executable: chmod 755 /etc/rc.d/rc.openvpn # ovpn_start() { if [ -x /usr/sbin/openvpn -a -r /etc/openvpn/server.conf ]; then echo "Starting OpenVPN: /usr/sbin/openvpn server.conf" /usr/sbin/openvpn /etc/openvpn/server.conf & fi } ovpn_stop() { killall openvpn } ovpn_restart() { ovpn_stop sleep 2 ovpn_start } case "$1" in 'start') ovpn_start ;; 'stop') ovpn_stop ;; 'restart') ovpn_restart ;; *) # Default is "start", for backwards compatibility with previous # Slackware versions. This may change to a 'usage' error someday. ovpn_start esac 7) Make it executable (and autostart on reboots)- chmod 755 /etc/rc.d/rc.openvpn To start/stop it manually- /etc/rc.d/rc.openvpn start (or stop or restart) Now let's fix the firewall so our clients can get to the rest of the world... 8) Edit/create /etc/rc.d/rc.firewall ADD: iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i tun+ -j ACCEPT iptables -A FORWARD -o tun+ -j ACCEPT iptables -A FORWARD -j ACCEPT iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE 9) Flush the old firewall rules- iptables -F 10) Activate the new rules now- /etc/rc.d/rc.firewall If the planets are aligned, you should now have a working OpenVPN server/router. 02f89eb91c02afbee29c7a3279e93a9294796f01 724 716 2012-06-13T14:50:07Z Arfon 70 ca /etc/openvpn/certs/ca.crt -->ca /etc/openvpn/certsnkeys/ca.crt wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] '''OPENVPN MULTI-CLIENT ROUTED SERVER''' Here's what I did to get OpenVPN (2.1.4) on my Slackware (13.37) box. I wanted to get on the internet from public wifi WITHOUT being snooped on so I installed a MULTI-CLIENT, ROUTED (not bridged) OpenVPN server on my Linode. Again, this is MULTI-CLIENT and ROUTED. 1) Install OpenVPN from Slackbuilds.org or using sbopkg 2) Generate the needed certificates and keys- cd /usr/doc/openvpn-2.1.4/easy-rsa/2.0/ vi vars Set the KEY_COUNTRY, KEY_PROVINCE, KEY_CITY, KEY_ORG, and KEY_EMAIL parameters. Don't leave any of these parameters blank. source ./vars ./clean-all ./build-ca answer questions ./build-key-server server (server could be anything e.g. VPN1.blah.net) answer questions ./build-key client1 (client1 can be anything e.g bobs-phone) answer questions repeat for each client to have ./build-dh 3) Put the server certs and keys where they need to be- mkdir /etc/openvpn/certsnkeys cp ca.crt /etc/openvpn/certsnkeys/ cp ca.key /etc/openvpn/certsnkeys/ cp server.crt /etc/openvpn/certsnkeys/ cp server.key /etc/openvpn/certsnkeys/ cp dh1024.pem /etc/openvpn/ 4) Send the client certs and keys where they need to be- Each client gets a copy of his client.crt and client.key AND a copy of ca.crt EXAMPLE: My android got a copy of client1.crt, client2.key and ca.crt. My laptop got a copy of client2.crt, client2.key and ca.crt NOTE: my android need a .p12 file, more on that below. 5) Configure the server.conf file- cd /usr/doc/openvpn-2.1.4 cp server.conf.sample /etc/openvpn/server.conf cd /etc/openvpn ***NOTE: in /etc/openvpn you will see a file called openvpn.conf. DO NOT USE THAT! Use server.conf*** Edit /etc/openvpn/server.conf CHANGE: ca ca.crt -> ca /etc/openvpn/certsnkeys/ca.crt cert server.crt -> cert /etc/openvpn/certsnkeys/server.crt key server.key -> key /etc/openvpn/certsnkeys/server.key dh dh.pem -> dh /etc/openvpn/dh1024.pem 6) Start OpenVPN- Normally you would start OpenVPN by: openvpn /etc/openvpn/server.conf but, being that I'm a good Slacker, I created an rc.openvpn file... CREATE: /etc/rc.d/rc.openvpn CONTAINS: #!/bin/sh # # /etc/rc.d/rc.openvpn # # Start/stop/restart the openvpn server. # # To make OpenVPN start automatically at boot, make this # file executable: chmod 755 /etc/rc.d/rc.openvpn # ovpn_start() { if [ -x /usr/sbin/openvpn -a -r /etc/openvpn/server.conf ]; then echo "Starting OpenVPN: /usr/sbin/openvpn server.conf" /usr/sbin/openvpn /etc/openvpn/server.conf & fi } ovpn_stop() { killall openvpn } ovpn_restart() { ovpn_stop sleep 2 ovpn_start } case "$1" in 'start') ovpn_start ;; 'stop') ovpn_stop ;; 'restart') ovpn_restart ;; *) # Default is "start", for backwards compatibility with previous # Slackware versions. This may change to a 'usage' error someday. ovpn_start esac 7) Make it executable (and autostart on reboots)- chmod 755 /etc/rc.d/rc.openvpn To start/stop it manually- /etc/rc.d/rc.openvpn start (or stop or restart) Now let's fix the firewall so our clients can get to the rest of the world... 8) Edit/create /etc/rc.d/rc.firewall ADD: iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i tun+ -j ACCEPT iptables -A FORWARD -o tun+ -j ACCEPT iptables -A FORWARD -j ACCEPT iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE 9) Flush the old firewall rules- iptables -F 10) Activate the new rules now- /etc/rc.d/rc.firewall If the planets are aligned, you should now have a working OpenVPN server/router. 176ae7b4314390a2384cd456f311264c4ebde422 User:Arfon 2 288 717 2012-06-09T19:25:49Z Arfon 70 Created page with "Find me on freenode ##Slackware as either arfon or urmom_ or drop me an email: REMOVETHIS arfon REMOVETHIS atsign REMOVETHIS 1337mail REMOVETHIS period REMOVETHIS net" wikitext text/x-wiki Find me on freenode ##Slackware as either arfon or urmom_ or drop me an email: REMOVETHIS arfon REMOVETHIS atsign REMOVETHIS 1337mail REMOVETHIS period REMOVETHIS net 01d799c83fd43cbd45c7fd818f6ce033c1787394 ALSA 0 35 726 495 2012-06-30T21:31:34Z Drhouse 292 wikitext text/x-wiki [[Category:Tutorials]] Sound problems *should* be rare these days, and of the ones that still exist, they are likely related to suspend/resume. Those are driver issues which are largely out of your control, but see the documentation with the pm-utils package for details on handling those issues. : <code>alsaconf</code> used to be needed to set up sound cards in linux, but even that shouldn't be needed in recent linux distributions - everything should be handled automatically. : <code>alsamixer</code> can be used to change the volume. : <code>alsactl store</code> is used to save the volume settings. : <code>alsactl restore</code> is used to restore the volume settings. This is automatically run on boot, so you usually won't need to run this command. There is one tip for the Sound Baster 5.1 cards: sometimes you want to MUTE digital out so you can hear on all the speakers; in alsamixer, you just press M on the <tt>Analog/Digital Output Jack</tt> item. For change boot ordering for your sound cards just create /etc/modprobe.d/sound.conf and put these lines into it: : <code>options snd-hda-intel index=0</code> : <code>options snd-usb-audio index=1</code> Replace 'snd-hda-intel' to your card module 25d1eb4bcb8c5eb5629346d5c6252c968cfb7bfd MySQL Configuration 0 74 728 95 2012-08-06T15:22:36Z Arfon 70 chmod 755 /etc/rc.d/rc.mysql --> chmod 755 /etc/rc.d/rc.mysqld wikitext text/x-wiki [[Category:Tutorials]] ''Have you just installed Slackware and now see a MySQL error at the login prompt?'' This is a VERY quick HowTo and should take maybe 30 seconds to complete at its slowest. The reason I decided to do a write-up is because of the sheer number of people asking how to fix it. == Option 1 == In a shell or xterm, type (you have to be logged in as superuser to use the mysql login): su mysql This logs you into the 'mysql' user account. Next, run: mysql_install_db This will create the needed databases and set their permissions properly. if your not logon as mysql user (root) Don't forget to chown folder /var/lib/mysql <pre> chown -R mysql.mysql /var/lib/mysql chmod 755 /etc/rc.d/rc.mysqld </pre> You're now finished and should not see the typical MySQL errors at the login prompt. /etc/rc.d/rc.mysql start Now you should set a password for MySQL's root password: mysqladmin -u root password 'new-password-here' You can connect to your MySQL server with: mysql -u root -p For security reasons you should delete an empy user for localhost server <pre> mysql> SELECT user, host FROM user; mysql> DELETE FROM user WHERE host='localhost' AND user=''; </pre> *''This tutorial is currently linked at '' * ''http://www.unixfool.com/mysql-slack.shtml'' == Option 2 == 1. log in as <b>root</b> and install the mysql package 2. <code>killall -9 mysqld mysqld_safe</code> to kill any running MySQL processes. 3. copy one of the my-size.cnf files in /etc to my.cnf (picking an apporpriate size):<br> ::<code>cp /etc/my-medium.cnf /etc/my.cnf</code> 4. Install the MySQL database- ::'''Slackware 12.1''' (and later): ::::<code>mysql_install_db --user=mysql</code> ::'''Slackware 12.0''' (and before): ::::<code>su mysql</code> ::::<code>mysql_install_db</code> :::: <code>exit</code> (to get out of the mysql login and back to root). 5. <code>mysqld_safe --skip-grant-tables &</code> 6. <code>mysql -u root mysql</code> 7. <code>UPDATE user SET Password=PASSWORD('<i>new_password</i>') WHERE user='root';</code> 8. <code>FLUSH PRIVILEGES;</code> 9. <code>exit</code> 10. <code>killall -9 mysqld mysqld_safe</code> 11. <code>mysqld_safe &</code> to check the new password, (as root) type:<br> ::<code>mysqladmin -u root -p status</code><br> :::::...and enter the new password. == Option 3 == I'm starting from a [http://www.slackwiki.org/Minimal_System very basic install]. The only additional package needed is '''mysql''' in the '''AP''' group. <pre> # installpkg mysql-5.0.37-i486-1.tgz # su mysql $ mysql_install_db Installing all prepared tables Fill help tables ... $ exit # chmod 755 /etc/rc.d/rc.mysqld # /etc/rc.d/rc.mysqld start Starting mysqld daemon with databases from /var/lib/mysql </pre> MySQL is now installed, but there are no passwords defined yet. <pre> # mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.37 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. </pre> We can now set passwords from within the MySQL console. I know this can be achieved with '''mysqladmin''', but then, several ways lead to Rome. It's a simple matter of habit. <pre> mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | +--------------------+ 3 rows in set (0.01 sec) mysql> use mysql; Database changed mysql> select user, host, password from user where user = 'root'; +------+-----------+----------+ | user | host | password | +------+-----------+----------+ | root | localhost | | | root | slacktest | | +------+-----------+----------+ 2 rows in set (0.00 sec) </pre> As you can see, there are two 'root' users here (and none of them is our system's root user, don't forget): root@localhost... and root@slacktest. We have to set a password for both of them. In theory, these can be different, but why make things more complicated than they already are? ;o) <pre> mysql> set password for root@localhost = password('yatahongaga'); Query OK, 0 rows affected (0.00 sec) </pre> Let's repeat our query above to see the actual changes: <pre> mysql> select user, host, password from user where user = 'root'; +------+-----------+-------------------------------------------+ | user | host | password | +------+-----------+-------------------------------------------+ | root | localhost | *71CDE2704222D8D5A7608C92AF78C53F78DA5EBA | | root | slacktest | | +------+-----------+-------------------------------------------+ 2 rows in set (0.00 sec) </pre> You can see that root@localhost's password is displayed as a shadow password. Now let's set the password for root@slacktest (replace ''slacktest'' by your machine's hostname): <pre> mysql> set password for root@slacktest = password('yatahongaga'); Query OK, 0 rows affected (0.00 sec) </pre> What do we have now? <pre> mysql> select user, host, password from user where user = 'root'; +------+-----------+-------------------------------------------+ | user | host | password | +------+-----------+-------------------------------------------+ | root | localhost | *71CDE2704222D8D5A7608C92AF78C53F78DA5EBA | | root | slacktest | *71CDE2704222D8D5A7608C92AF78C53F78DA5EBA | +------+-----------+-------------------------------------------+ 2 rows in set (0.00 sec) </pre> Now we have some (very) basic security, we can leave the MySQL monitor. <pre> mysql> quit; Bye </pre> To connect to our MySQL database as MySQL's root user (who, remember, is ''not'' the system's root), we can do the following: <pre> # mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.0.37 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> </pre> If we have to do this often, we can create a /root/.my.cnf file and edit it as follows: <pre> [mysql] user = root password = yatahongaga </pre> Just to be on the safe side: <pre> # chmod 0600 /root/.my.cnf </pre> From now on, you can connect directly to the MySQL monitor, without having to type your password every time. d19bf68998e07eac2fd4ce2d1fc6ec10a82ea4ea 729 728 2012-08-06T15:30:58Z Arfon 70 /etc/rc.d/rc.mysql start --> /etc/rc.d/rc.mysqld start AND ADDED: mysql> use mysql wikitext text/x-wiki [[Category:Tutorials]] ''Have you just installed Slackware and now see a MySQL error at the login prompt?'' This is a VERY quick HowTo and should take maybe 30 seconds to complete at its slowest. The reason I decided to do a write-up is because of the sheer number of people asking how to fix it. == Option 1 == In a shell or xterm, type (you have to be logged in as superuser to use the mysql login): su mysql This logs you into the 'mysql' user account. Next, run: mysql_install_db This will create the needed databases and set their permissions properly. if your not logon as mysql user (root) Don't forget to chown folder /var/lib/mysql <pre> chown -R mysql.mysql /var/lib/mysql chmod 755 /etc/rc.d/rc.mysqld </pre> You're now finished and should not see the typical MySQL errors at the login prompt. /etc/rc.d/rc.mysqld start Now you should set a password for MySQL's root password: mysqladmin -u root password 'new-password-here' You can connect to your MySQL server with: mysql -u root -p For security reasons you should delete an empy user for localhost server <pre> mysql> use mysql mysql> SELECT user, host FROM user; mysql> DELETE FROM user WHERE host='localhost' AND user=''; </pre> *''This tutorial is currently linked at '' * ''http://www.unixfool.com/mysql-slack.shtml'' == Option 2 == 1. log in as <b>root</b> and install the mysql package 2. <code>killall -9 mysqld mysqld_safe</code> to kill any running MySQL processes. 3. copy one of the my-size.cnf files in /etc to my.cnf (picking an apporpriate size):<br> ::<code>cp /etc/my-medium.cnf /etc/my.cnf</code> 4. Install the MySQL database- ::'''Slackware 12.1''' (and later): ::::<code>mysql_install_db --user=mysql</code> ::'''Slackware 12.0''' (and before): ::::<code>su mysql</code> ::::<code>mysql_install_db</code> :::: <code>exit</code> (to get out of the mysql login and back to root). 5. <code>mysqld_safe --skip-grant-tables &</code> 6. <code>mysql -u root mysql</code> 7. <code>UPDATE user SET Password=PASSWORD('<i>new_password</i>') WHERE user='root';</code> 8. <code>FLUSH PRIVILEGES;</code> 9. <code>exit</code> 10. <code>killall -9 mysqld mysqld_safe</code> 11. <code>mysqld_safe &</code> to check the new password, (as root) type:<br> ::<code>mysqladmin -u root -p status</code><br> :::::...and enter the new password. == Option 3 == I'm starting from a [http://www.slackwiki.org/Minimal_System very basic install]. The only additional package needed is '''mysql''' in the '''AP''' group. <pre> # installpkg mysql-5.0.37-i486-1.tgz # su mysql $ mysql_install_db Installing all prepared tables Fill help tables ... $ exit # chmod 755 /etc/rc.d/rc.mysqld # /etc/rc.d/rc.mysqld start Starting mysqld daemon with databases from /var/lib/mysql </pre> MySQL is now installed, but there are no passwords defined yet. <pre> # mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.37 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. </pre> We can now set passwords from within the MySQL console. I know this can be achieved with '''mysqladmin''', but then, several ways lead to Rome. It's a simple matter of habit. <pre> mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | +--------------------+ 3 rows in set (0.01 sec) mysql> use mysql; Database changed mysql> select user, host, password from user where user = 'root'; +------+-----------+----------+ | user | host | password | +------+-----------+----------+ | root | localhost | | | root | slacktest | | +------+-----------+----------+ 2 rows in set (0.00 sec) </pre> As you can see, there are two 'root' users here (and none of them is our system's root user, don't forget): root@localhost... and root@slacktest. We have to set a password for both of them. In theory, these can be different, but why make things more complicated than they already are? ;o) <pre> mysql> set password for root@localhost = password('yatahongaga'); Query OK, 0 rows affected (0.00 sec) </pre> Let's repeat our query above to see the actual changes: <pre> mysql> select user, host, password from user where user = 'root'; +------+-----------+-------------------------------------------+ | user | host | password | +------+-----------+-------------------------------------------+ | root | localhost | *71CDE2704222D8D5A7608C92AF78C53F78DA5EBA | | root | slacktest | | +------+-----------+-------------------------------------------+ 2 rows in set (0.00 sec) </pre> You can see that root@localhost's password is displayed as a shadow password. Now let's set the password for root@slacktest (replace ''slacktest'' by your machine's hostname): <pre> mysql> set password for root@slacktest = password('yatahongaga'); Query OK, 0 rows affected (0.00 sec) </pre> What do we have now? <pre> mysql> select user, host, password from user where user = 'root'; +------+-----------+-------------------------------------------+ | user | host | password | +------+-----------+-------------------------------------------+ | root | localhost | *71CDE2704222D8D5A7608C92AF78C53F78DA5EBA | | root | slacktest | *71CDE2704222D8D5A7608C92AF78C53F78DA5EBA | +------+-----------+-------------------------------------------+ 2 rows in set (0.00 sec) </pre> Now we have some (very) basic security, we can leave the MySQL monitor. <pre> mysql> quit; Bye </pre> To connect to our MySQL database as MySQL's root user (who, remember, is ''not'' the system's root), we can do the following: <pre> # mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.0.37 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> </pre> If we have to do this often, we can create a /root/.my.cnf file and edit it as follows: <pre> [mysql] user = root password = yatahongaga </pre> Just to be on the safe side: <pre> # chmod 0600 /root/.my.cnf </pre> From now on, you can connect directly to the MySQL monitor, without having to type your password every time. 5d9d0ee1af771f868c846413bbc8353a451f6d32 Hibernate 0 223 730 525 2012-08-17T21:47:49Z Yenn 297 major rewrite + hibernating from console wikitext text/x-wiki In Slackware, hibernation works out-of-the-box and can be easily done from KDE's menu or XFCE logout dialog. Resuming from hibernation, however, is not set up, so when you turn on your computer again, it starts as normal. That is, if your hardware supports it and if you've set up a swap space larger than your RAM. == Hibernating in lightweight windows managers == In case you aren't using KDE, XFCE or other desktop environments, you can hibernate your system from console. === pm-utils === As root, you can hibernate via <tt>pm-hibernate</tt> command. === As regular user === ==== HAL ==== Since HAL is deprecated and removed from Slackware 14.0, this works for older Slackware releases. $ dbus-send --system --print-reply --dest="org.freedesktop.Hal" \ /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate ==== UPower ==== dbus-send --system --print-reply --dest="org.freedesktop.UPower" \ /org/freedesktop/UPower org.freedesktop.UPower.Hibernate == Booloader configuration == === Non-LVM setup === ==== LILO configuration ==== To tell your kernel where to resume from, you need to write the info to ''lilo.conf'': append=" resume=/dev/sda6" Replace ''/dev/sda6'' with your actual swap space. Swap partitions are perfect, I think swap files should work too. If you don't know where your swap lies, look at ''/proc/swaps''. === LVM setup === LILO doesn't support booting from LVM, therefore you have to create initial ramdisk (initrd). You need one even though your kernel has build-in support for LVM. You don't have to adjust ''lilo.conf'' because you can set everything resume-related in initrd. mkinitrd -c -k <kernel-version> -f <fs_type> -m <fs_type> -r <root_partition> -h /dev/volumegroup/swap -L * -h set your hibernation/swap logical volume * -L activate LVM Afterwards, run lilo. == Further reading == * Hibernate to encrypted swap - [http://slackware.osuosl.org/slackware-13.1/README_CRYPT.TXT REAME_CRYPT.TXT] [[Category:Tutorials]] 7ac83769e82f9ee92172a74dd5b4bcbd2201506f ZFS root 0 290 731 2012-08-18T09:27:49Z Foobarz 298 installing slackware into a ZFS root wikitext text/x-wiki If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages When you need to change boot to cd or disk, add or remove "boot=on", or change "order=dc". Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors side the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: (on install-dvd) cgdisk /dev/sda setup reboot When this simple development guest boots, login as root, and continue: (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS raidz1 or raidz2 virtual device types for reliability against hard drive failures. (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages The install-dvd should boot, and then begin installation steps on the installer command line: (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man The manual pages should be readable: man zpool man zfs After seeing the man pages, we should be fully ready to continue to setup on ZFS. (still on install-dvd) ls -l /dev/sd* Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: cgdisk /dev/sda Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is mostly likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Lets use type 8300 for /boot to be sure nothing is confused: We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: zpool create -m none zfs-root /dev/sda2 A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: zpool status zfs-root zpool export zfs-root zpool status zfs-root Now there is no status. zpool import zfs-root Now it is back. When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactived without need to issue the import command: cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: rm /mnt/README The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: zfs set readonly=on zfs-root zfs set readonly=off zfs-root Slackware expects root to be mounted readonly when /etc/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root mount zfs-root -t zfs /mnt umount /mnt If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options -o ro, -o rw, -o remount,ro, and -o remount,rw can also be used and will override readonly=on|off property without altering the property value. This can be confusing until you are familiar with how to the methods of mounting interact. Now, let's continue some, and mount to /mnt using the current readonly=off setting (rw mount): zfs set mountpoint=/mnt zfs-root This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. cat /etc/mtab >> /etc/fstab Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: zfs set mountpoint=none zfs-root Mount again, now using all options from /etc/fstab: mount zfs-root It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: mount -i zfs-root mount -i zfs-root -t zfs /mnt but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. Setup the /boot device: mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: umount /dev/sr0 setup In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process it normal. umount /dev/sr0 At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). cp /etc/fstab /mnt/etc/fstab.initrd The fstab.initrd will look like: proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab Using vi started above, edit /mnt/etc/fstab and make it have lines such as: zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 These two lines in /mnt/etc/fstab are how the mounts should be looking when root is booted. Mount some special mounts before chroot: mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys Make sure /boot is mounted: mount /dev/sda1 /mnt/boot If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: chroot /mnt At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz We install spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz initrd = /boot/initrd.gz root = /dev/sda1 label = vmlinuz read-only The line, root = /dev/sda1, is not really a true statement but lilo needs a device there that it at least understands. This root = line is a kernel parameter, but since the initrd is what is actually the root, initially, then the root = line is probably useless here. It might even be okay to just delete the root line. Setup mkinitrd: cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf Edit it to look like this (other defaults should be ok): MODULE_LIST="sym53c8xx:ext4:8139cp:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" Module sym53c8xx is the driver for qemu's if=scsi drive device. Module ext4 for /boot. Module 8139cp for eth0 net device. Module zfs for ZFSonLinux. Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. These 9p could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: modprobe --show-depends zfs All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. mkinitrd Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). touch /boot/initrd-tree/etc/mtab Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: # mount -o ro -t $ROOTFS $ROOTDEV /mnt We have already mounted, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using zpool import and export and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out zpool import/export lines. As mentioned, the import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, root will not be mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "import -f" then "mount zfs-root" and then "exit" to continue on to booting the root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip found assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). That is ip-based hostid value, a 32bit hexadecimal number. This has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set and while it is not mounted: (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could be come invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and exit. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as a readonly property changes In /etc/rc.d/rc.S: comment out the line # /sbin/mount -w -v -n -o remount / add the line /sbin/zfs set readonly=off zfs-root In /etc/rc.d/rc.6 comment out the line # /bin/mount -v -n -o remount,ro / add the line /sbin/zfs set readonly=on zfs-root In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem checks. The rc.S script will complain a lot in many places about not being about to run fsck on the zfs-root. To disable all attempts of run fsck, we can simple create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: touch /etc/fastboot This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: mkinitrd -F lilo We finished! All that's left to do is clean up. Exit the chroot. exit Try to mount everything: umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. Remove the DVD. reboot When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrat! If this seem to go badly, and this might happen if the import fails as explain some before, then you will be on the initrd's rescue command line just before the part in it's init where it wants to mount and switch_root to boot your root. Instead, you typically got commands like this to do: If you get dumped to rescue because import will not work and requires -f (force), then: zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zfs import etc, use the lilo prompt (or, boot the install-dvd): boot: vmlinuz rescue In the rescue mode of the initrd, after you have mounted your root as readonly=on to /mnt, then exit to continue. In other emergency modes, you might need to run the lines at end of init starting from: udevadm info --cleanup-db; udevadm control --exit If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line is run is: exec switch_root /mnt /sbin/init 1 Warning... this switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. Also, in rescue or anytime you have finished making changes and are about to reboot in some abnormal mode, first run: zfs set readonly=on zfs-root A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. Upgrading. From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuilt and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. slackpkg upgrade-all Assume slackpkg just upgraded your kernel, kernel-modules, and kernel-headers. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SQL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname r) now reboot After reboot you can remove any old /lib/modules/<old kernel version> directory. More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: ################################################ /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } ################################################ b317829dee4456df976db638e9f95e3778dae63e 732 731 2012-08-18T18:36:51Z Foobarz 298 wikitext text/x-wiki If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, add or remove "boot=on", or change "order=dc". Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors side the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS raidz1 or raidz2 virtual device types for reliability against hard drive failures. <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: </pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is mostly likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Lets use type 8300 for /boot to be sure nothing is confused: </pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactived without need to issue the import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how to the methods of mounting interact. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process it normal. <pre> umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We install spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz initrd = /boot/initrd.gz root = /dev/sda1 label = vmlinuz read-only </pre> The line, root = /dev/sda1, is not really a true statement but lilo needs a device there that it at least understands. This root = line is a kernel parameter, but since the initrd is what is actually the root, initially, then the root = line is probably useless here. It might even be okay to just delete the root line. Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:8139cp:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module 8139cp for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using zpool import and export and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out zpool import/export lines. As mentioned, the import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, root will not be mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "import -f" then "mount zfs-root" and then "exit" to continue on to booting the root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip found assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). That is ip-based hostid value, a 32bit hexadecimal number. This has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could be come invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and exit. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as a readonly property changes In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem checks. The rc.S script will complain a lot in many places about not being about to run fsck on the zfs-root. To disable all attempts of run fsck, we can simple create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to mount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrat! If this seem to go badly, and this might happen if the import fails as explain some before, then you will be on the initrd's rescue command line just before the part in it's init where it wants to mount and switch_root to boot your root. Instead, you typically got commands like this to do: If you get dumped to rescue because import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zfs import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your root as readonly=on to /mnt, then exit to continue. In other emergency modes, you might need to run the lines at end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line is run is: <code>exec switch_root /mnt /sbin/init 1</code> Warning... this switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. Also, in rescue or anytime you have finished making changes and are about to reboot in some abnormal mode, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. Upgrading. From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuilt and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, and kernel-headers. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SQL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> ################################################ /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } ################################################ </pre> 69811bd6f28ec00ea429254fdce1eeff382ec644 ZFS root 0 290 733 732 2012-08-18T18:44:38Z Foobarz 298 wikitext text/x-wiki If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, add or remove "boot=on", or change "order=dc". Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors side the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS raidz1 or raidz2 virtual device types for reliability against hard drive failures. <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: </pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is mostly likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Lets use type 8300 for /boot to be sure nothing is confused: </pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactived without need to issue the import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how to the methods of mounting interact. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process it normal. <pre> umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We install spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz initrd = /boot/initrd.gz root = /dev/sda1 label = vmlinuz read-only </pre> The line, root = /dev/sda1, is not really a true statement but lilo needs a device there that it at least understands. This root = line is a kernel parameter, but since the initrd is what is actually the root, initially, then the root = line is probably useless here. It might even be okay to just delete the root line. Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:8139cp:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module 8139cp for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using zpool import and export and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out zpool import/export lines. As mentioned, the import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, root will not be mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "import -f" then "mount zfs-root" and then "exit" to continue on to booting the root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip found assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). That is ip-based hostid value, a 32bit hexadecimal number. This has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could be come invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and exit. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as a readonly property changes In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem checks. The rc.S script will complain a lot in many places about not being about to run fsck on the zfs-root. To disable all attempts of run fsck, we can simple create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to mount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrat! If this seem to go badly, and this might happen if the import fails as explain some before, then you will be on the initrd's rescue command line just before the part in it's init where it wants to mount and switch_root to boot your root. Instead, you typically got commands like this to do: If you get dumped to rescue because import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zfs import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your root as readonly=on to /mnt, then exit to continue. In other emergency modes, you might need to run the lines at end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line is run is: <code>exec switch_root /mnt /sbin/init 1</code> Warning... this switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. Also, in rescue or anytime you have finished making changes and are about to reboot in some abnormal mode, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. Upgrading. From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuilt and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, and kernel-headers. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SQL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> 21d4a5e2fe6f4f1f05801c7372c7d1454fad9e7c 734 733 2012-08-18T19:00:07Z Foobarz 298 wikitext text/x-wiki If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, add or remove "boot=on", or change "order=dc". Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors side the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS raidz1 or raidz2 virtual device types for reliability against hard drive failures. <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is mostly likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Lets use type 8300 for /boot to be sure nothing is confused: </pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactived without need to issue the import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how to the methods of mounting interact. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process it normal. <pre> umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We install spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz initrd = /boot/initrd.gz root = /dev/sda1 label = vmlinuz read-only </pre> The line, root = /dev/sda1, is not really a true statement but lilo needs a device there that it at least understands. This root = line is a kernel parameter, but since the initrd is what is actually the root, initially, then the root = line is probably useless here. It might even be okay to just delete the root line. Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:8139cp:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module 8139cp for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using zpool import and export and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out zpool import/export lines. As mentioned, the import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, root will not be mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "import -f" then "mount zfs-root" and then "exit" to continue on to booting the root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip found assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). That is ip-based hostid value, a 32bit hexadecimal number. This has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could be come invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and exit. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as a readonly property changes In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem checks. The rc.S script will complain a lot in many places about not being about to run fsck on the zfs-root. To disable all attempts of run fsck, we can simple create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to mount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrat! If this seem to go badly, and this might happen if the import fails as explain some before, then you will be on the initrd's rescue command line just before the part in it's init where it wants to mount and switch_root to boot your root. Instead, you typically got commands like this to do: If you get dumped to rescue because import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zfs import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your root as readonly=on to /mnt, then exit to continue. In other emergency modes, you might need to run the lines at end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line is run is: <code>exec switch_root /mnt /sbin/init 1</code> Warning... this switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. Also, in rescue or anytime you have finished making changes and are about to reboot in some abnormal mode, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. Upgrading. From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuilt and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, and kernel-headers. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SQL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> 018c8195294e31c63d7ffc45f6e809bb0bba570f 735 734 2012-08-18T19:02:24Z Foobarz 298 wikitext text/x-wiki If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, add or remove "boot=on", or change "order=dc". Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors side the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS raidz1 or raidz2 virtual device types for reliability against hard drive failures. <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is mostly likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Lets use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactived without need to issue the import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how to the methods of mounting interact. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process it normal. <pre> umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We install spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz initrd = /boot/initrd.gz root = /dev/sda1 label = vmlinuz read-only </pre> The line, root = /dev/sda1, is not really a true statement but lilo needs a device there that it at least understands. This root = line is a kernel parameter, but since the initrd is what is actually the root, initially, then the root = line is probably useless here. It might even be okay to just delete the root line. Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:8139cp:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module 8139cp for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using zpool import and export and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out zpool import/export lines. As mentioned, the import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, root will not be mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "import -f" then "mount zfs-root" and then "exit" to continue on to booting the root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip found assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). That is ip-based hostid value, a 32bit hexadecimal number. This has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could be come invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and exit. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as a readonly property changes In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem checks. The rc.S script will complain a lot in many places about not being about to run fsck on the zfs-root. To disable all attempts of run fsck, we can simple create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to mount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrat! If this seem to go badly, and this might happen if the import fails as explain some before, then you will be on the initrd's rescue command line just before the part in it's init where it wants to mount and switch_root to boot your root. Instead, you typically got commands like this to do: If you get dumped to rescue because import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zfs import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your root as readonly=on to /mnt, then exit to continue. In other emergency modes, you might need to run the lines at end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line is run is: <code>exec switch_root /mnt /sbin/init 1</code> Warning... this switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. Also, in rescue or anytime you have finished making changes and are about to reboot in some abnormal mode, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. Upgrading. From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuilt and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, and kernel-headers. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SQL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> d11fdb90c7825e8207421651bfeeb201d36f6886 736 735 2012-08-18T19:07:24Z Foobarz 298 wikitext text/x-wiki If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, add or remove "boot=on", or change "order=dc". Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors side the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS raidz1 or raidz2 virtual device types for reliability against hard drive failures. <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is mostly likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Lets use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactived without need to issue the import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how to the methods of mounting interact. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process it normal. <pre> umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We install spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz initrd = /boot/initrd.gz root = /dev/sda1 label = vmlinuz read-only </pre> The line, root = /dev/sda1, is not really a true statement but lilo needs a device there that it at least understands. This root = line is a kernel parameter, but since the initrd is what is actually the root, initially, then the root = line is probably useless here. It might even be okay to just delete the root line. Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:8139cp:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module 8139cp for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using zpool import and export and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out zpool import/export lines. As mentioned, the import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, root will not be mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "import -f" then "mount zfs-root" and then "exit" to continue on to booting the root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip found assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). That is ip-based hostid value, a 32bit hexadecimal number. This has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could be come invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and exit. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as a readonly property changes In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem checks. The rc.S script will complain a lot in many places about not being about to run fsck on the zfs-root. To disable all attempts of run fsck, we can simple create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to mount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrat! If this seem to go badly, and this might happen if the import fails as explain some before, then you will be on the initrd's rescue command line just before the part in it's init where it wants to mount and switch_root to boot your root. Instead, you typically got commands like this to do: If you get dumped to rescue because import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zfs import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your root as readonly=on to /mnt, then exit to continue. In other emergency modes, you might need to run the lines at end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line is run is: <code>exec switch_root /mnt /sbin/init 1</code> Warning... this switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. Also, in rescue or anytime you have finished making changes and are about to reboot in some abnormal mode, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. Upgrading. From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuilt and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, and kernel-headers. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SQL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> 50bc1fd4237c0aee65eb062cd707105eacd491a5 737 736 2012-08-18T19:38:56Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, add or remove "boot=on", or change "order=dc". Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors side the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS raidz1 or raidz2 virtual device types for reliability against hard drive failures. <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is mostly likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Lets use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactived without need to issue the import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how to the methods of mounting interact. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process it normal. <pre> umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We install spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz initrd = /boot/initrd.gz root = /dev/sda1 label = vmlinuz read-only </pre> The line, root = /dev/sda1, is not really a true statement but lilo needs a device there that it at least understands. This root = line is a kernel parameter, but since the initrd is what is actually the root, initially, then the root = line is probably useless here. It might even be okay to just delete the root line. Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:8139cp:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module 8139cp for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using zpool import and export and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out zpool import/export lines. As mentioned, the import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, root will not be mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "import -f" then "mount zfs-root" and then "exit" to continue on to booting the root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip found assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). That is ip-based hostid value, a 32bit hexadecimal number. This has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could be come invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and exit. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as a readonly property changes In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem checks. The rc.S script will complain a lot in many places about not being about to run fsck on the zfs-root. To disable all attempts of run fsck, we can simple create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to mount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrat! If this seem to go badly, and this might happen if the import fails as explain some before, then you will be on the initrd's rescue command line just before the part in it's init where it wants to mount and switch_root to boot your root. Instead, you typically got commands like this to do: If you get dumped to rescue because import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zfs import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your root as readonly=on to /mnt, then exit to continue. In other emergency modes, you might need to run the lines at end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line is run is: <code>exec switch_root /mnt /sbin/init 1</code> Warning... this switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. Also, in rescue or anytime you have finished making changes and are about to reboot in some abnormal mode, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. Upgrading. From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuilt and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, and kernel-headers. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SQL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> 37f53e6dc57388109c6948f1519f940817c09174 738 737 2012-08-19T01:51:42Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, add or remove "boot=on", or change "order=dc". Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors side the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS raidz1 or raidz2 virtual device types for reliability against hard drive failures. <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is mostly likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Lets use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactived without need to issue the import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how to the methods of mounting interact. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process it normal. <pre> umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We install spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz label = vmlinuz initrd = /boot/initrd.gz root = /dev/ram0 read-write # alternatively, the root and read-write lines # can be this one line of kernel parameters: # addappend = " root=/dev/ram0 rw " </pre> Note: when using a initrd (see /usr/src/linux/Documentation/initrd.txt), the initial root device is normally set to root=/dev/ram0 (a ramfs block device) and allowed read-write. The kernel refers to devices in terms of "major" and "minor" numbers, and the ram0 device is assigned the block device major 1 and minor 0 (see /usr/src/linux/Documentation/devices.txt). This ram0 major/minor is written in hexadecimal as 0x0100 (256 in decimal). This hexademical number makes an appearance in /boot/initrd-tree/int where it runs: "echo 0x0100 > /proc/sys/kernel/real-root-dev". Echoing a device code to real-root-dev is part of a deprecated initrd mechanism, but is probably harmless to leave alone as slackware has it unless you know otherwise. Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:8139cp:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module 8139cp for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using zpool import and export and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out zpool import/export lines. As mentioned, the import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, root will not be mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "import -f" then "mount zfs-root" and then "exit" to continue on to booting the root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip found assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). That is ip-based hostid value, a 32bit hexadecimal number. This has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could be come invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and exit. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as a readonly property changes In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem checks. The rc.S script will complain a lot in many places about not being about to run fsck on the zfs-root. To disable all attempts of run fsck, we can simple create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to mount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrat! If this seem to go badly, and this might happen if the import fails as explain some before, then you will be on the initrd's rescue command line just before the part in it's init where it wants to mount and switch_root to boot your root. Instead, you typically got commands like this to do: If you get dumped to rescue because import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zfs import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your root as readonly=on to /mnt, then exit to continue. In other emergency modes, you might need to run the lines at end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line is run is: <code>exec switch_root /mnt /sbin/init 1</code> Warning... this switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. Also, in rescue or anytime you have finished making changes and are about to reboot in some abnormal mode, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. Upgrading. From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuilt and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, and kernel-headers. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SQL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> 14d51103df02bf07b300fe5a5adf7f196574aee9 739 738 2012-08-20T02:22:17Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, add or remove "boot=on", or change "order=dc". Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors side the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS raidz1 or raidz2 virtual device types for reliability against hard drive failures. <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is mostly likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Lets use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactived without need to issue the import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how to the methods of mounting interact. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process it normal. <pre> umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We install spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz label = vmlinuz initrd = /boot/initrd.gz root = /dev/ram0 read-write # alternatively, the root and read-write lines # can be this one line of kernel parameters: # addappend = " root=/dev/ram0 rw " </pre> A note about initrd: The /boot/initrd.gz is a gzipped cpio archive containing a minimal BusyBox-based slackware root system that is sourced from /boot/initrd-tree. The commands "mkinitrd" and "mkinitrd -F" generates /boot/initrd-tree and /boot/initrd.gz. When using a initrd, the initial root device is normally set to root=/dev/ram0 (a ramfs block device) and allowed read-write. The kernel refers to devices in terms of "major" and "minor" numbers, and the ram0 device is assigned the block device major 1 and minor 0. This ram0 major/minor is written in hexadecimal as 0x0100 (256 in decimal). This hexademical number makes an appearance in /boot/initrd-tree/int where it runs: "echo 0x0100 > /proc/sys/kernel/real-root-dev". Echoing a device code to real-root-dev is part of a deprecated initrd mechanism, but is probably harmless to leave alone as slackware has it unless you know otherwise. More information about how initrd works can be found in: <pre> /usr/src/linux/Documentation/devices.txt (info about major:minor device numbers) /usr/src/linux/Documentation/initrd.txt (mostly obsolete info on old initrd) /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt (current info on new initrd, called initramfs) </pre> Advanced note about initrd: Slackware's mkinitrd package does not use the "pivot_root" command as documented in "initrd.txt", but instead uses "switch_root" provided by a project called BusyBox. The switch_root changes the effective root filesystem from the initrd (unpacked in rootfs at /) to new root filesystem (zfs-root mounted at /mnt); it overmounts rootfs / with zfs-root /mnt. The switch_root works as follows: delete everything in rootfs / (one filesystem only) that held initrd to free up ram memory, then use mount, chroot, and chdir to make the effective root change. In concept (as a shell script), the command "exec switch_root /mnt $INIT $RUNLEVEL" is performed as follows: <pre> find / -xdev | xargs rm -rf cd "$1" shift mount --move . / exec chroot . "$@" </pre> Here, typically INIT=/sbin/init RUNLEVEL=3. The 'exec' causes switch_root to take the place of the parent process having PID=1. In system calls, the switch_root looks similar to this: <pre> chdir("/mnt"); /* <insert code to unlink/rmdir all initrd files/directories * installed in rootfs / without crossing filesystems > */ mount(".", "/", NULL, MS_MOVE, NULL); chroot("."); chdir("/"); execl("/sbin/init", "3"); </pre> The kernel startup rootfs / that contained initrd is never actually unmounted (it can't be) because it is built into the kernel and always exists as at least a tiny ramfs or tmpfs, so you can continue to see it in /proc/mounts. When you give lilo root=/dev/ram0 (a ramfs device), the kernel will actually use the internal rootfs, which is an instance of a tmpfs (if your kernel config includes tmpfs) or else an instance of a ramfs. The rootfs that is a tmpfs can by default use up to half of system ram. If rootfs is a ramfs, it can use up to almost all of system ram until the system panics. Typically, tmpfs is built into the kernel, and so depending on how much ram your computer has, the initrd-tree can probably be up to about half that size. Quite a lot of notes... now to continue on: Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:8139cp:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module 8139cp for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using zpool import and export and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out zpool import/export lines. As mentioned, the import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, root will not be mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "import -f" then "mount zfs-root" and then "exit" to continue on to booting the root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip found assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). That is ip-based hostid value, a 32bit hexadecimal number. This has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could be come invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and exit. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as a readonly property changes In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem checks. The rc.S script will complain a lot in many places about not being about to run fsck on the zfs-root. To disable all attempts of run fsck, we can simple create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to mount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrat! If this seem to go badly, and this might happen if the import fails as explain some before, then you will be on the initrd's rescue command line just before the part in it's init where it wants to mount and switch_root to boot your root. Instead, you typically got commands like this to do: If you get dumped to rescue because import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zfs import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your root as readonly=on to /mnt, then exit to continue. In other emergency modes, you might need to run the lines at end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line is run is: <code>exec switch_root /mnt /sbin/init 1</code> Warning... this switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. Also, in rescue or anytime you have finished making changes and are about to reboot in some abnormal mode, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. Upgrading. From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuilt and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, and kernel-headers. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SQL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> 2d69b9c8e33f3f6d9e0018f9ae106e25469c8c57 780 739 2012-09-03T19:18:14Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, add or remove "boot=on", or change "order=dc". Note: If you are using a newer version of qemu-kvm, the support for if=scsi might be missing the needed option-rom. You might need to download http://www.lsi.com/downloads/Public/Host Bus Adapters/Host Bus Adapters Common Files/lsi_bios.zip. Unzip it, and then: <pre> cp 8xx_64.rom /usr/share/qemu # then run qemu-kvm with additional command line option: -option-rom 8xx_64.rom,bootindex=1 </pre> Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors side the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS raidz1 or raidz2 virtual device types for reliability against hard drive failures. <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-system-x86_64 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=rtl8139 -net user \ -cdrom dvd.iso \ -drive boot=on,format=raw,media=disk,cache=none,aio=native,if=scsi,bus=0,unit=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is mostly likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Lets use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactived without need to issue the import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how to the methods of mounting interact. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process it normal. <pre> umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We install spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz label = vmlinuz initrd = /boot/initrd.gz root = /dev/ram0 read-write # alternatively, the root and read-write lines # can be this one line of kernel parameters: # addappend = " root=/dev/ram0 rw " </pre> A note about initrd: The /boot/initrd.gz is a gzipped cpio archive containing a minimal BusyBox-based slackware root system that is sourced from /boot/initrd-tree. The commands "mkinitrd" and "mkinitrd -F" generates /boot/initrd-tree and /boot/initrd.gz. When using a initrd, the initial root device is normally set to root=/dev/ram0 (a ramfs block device) and allowed read-write. The kernel refers to devices in terms of "major" and "minor" numbers, and the ram0 device is assigned the block device major 1 and minor 0. This ram0 major/minor is written in hexadecimal as 0x0100 (256 in decimal). This hexademical number makes an appearance in /boot/initrd-tree/int where it runs: "echo 0x0100 > /proc/sys/kernel/real-root-dev". Echoing a device code to real-root-dev is part of a deprecated initrd mechanism, but is probably harmless to leave alone as slackware has it unless you know otherwise. More information about how initrd works can be found in: <pre> /usr/src/linux/Documentation/devices.txt (info about major:minor device numbers) /usr/src/linux/Documentation/initrd.txt (mostly obsolete info on old initrd) /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt (current info on new initrd, called initramfs) </pre> Advanced note about initrd: Slackware's mkinitrd package does not use the "pivot_root" command as documented in "initrd.txt", but instead uses "switch_root" provided by a project called BusyBox. The switch_root changes the effective root filesystem from the initrd (unpacked in rootfs at /) to new root filesystem (zfs-root mounted at /mnt); it overmounts rootfs / with zfs-root /mnt. The switch_root works as follows: delete everything in rootfs / (one filesystem only) that held initrd to free up ram memory, then use mount, chroot, and chdir to make the effective root change. In concept (as a shell script), the command "exec switch_root /mnt $INIT $RUNLEVEL" is performed as follows: <pre> find / -xdev | xargs rm -rf cd "$1" shift mount --move . / exec chroot . "$@" </pre> Here, typically INIT=/sbin/init RUNLEVEL=3. The 'exec' causes switch_root to take the place of the parent process having PID=1. In system calls, the switch_root looks similar to this: <pre> chdir("/mnt"); /* <insert code to unlink/rmdir all initrd files/directories * installed in rootfs / without crossing filesystems > */ mount(".", "/", NULL, MS_MOVE, NULL); chroot("."); chdir("/"); execl("/sbin/init", "3"); </pre> The kernel startup rootfs / that contained initrd is never actually unmounted (it can't be) because it is built into the kernel and always exists as at least a tiny ramfs or tmpfs, so you can continue to see it in /proc/mounts. When you give lilo root=/dev/ram0 (a ramfs device), the kernel will actually use the internal rootfs, which is an instance of a tmpfs (if your kernel config includes tmpfs) or else an instance of a ramfs. The rootfs that is a tmpfs can by default use up to half of system ram. If rootfs is a ramfs, it can use up to almost all of system ram until the system panics. Typically, tmpfs is built into the kernel, and so depending on how much ram your computer has, the initrd-tree can probably be up to about half that size. Quite a lot of notes... now to continue on: Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:8139cp:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module 8139cp for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using zpool import and export and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out zpool import/export lines. As mentioned, the import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, root will not be mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "import -f" then "mount zfs-root" and then "exit" to continue on to booting the root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip found assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). That is ip-based hostid value, a 32bit hexadecimal number. This has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could be come invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and exit. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as a readonly property changes In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem checks. The rc.S script will complain a lot in many places about not being about to run fsck on the zfs-root. To disable all attempts of run fsck, we can simple create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to mount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrat! If this seem to go badly, and this might happen if the import fails as explain some before, then you will be on the initrd's rescue command line just before the part in it's init where it wants to mount and switch_root to boot your root. Instead, you typically got commands like this to do: If you get dumped to rescue because import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zfs import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your root as readonly=on to /mnt, then exit to continue. In other emergency modes, you might need to run the lines at end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line is run is: <code>exec switch_root /mnt /sbin/init 1</code> Warning... this switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. Also, in rescue or anytime you have finished making changes and are about to reboot in some abnormal mode, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. Upgrading. From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuilt and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, and kernel-headers. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SQL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> Now available! "ZFS root (builtin)" wiki (aka "ZFS root, part II"): http://slackwiki.com/ZFS_root_(builtin) It is now possible to build the modules and a small initramfs into your kernel to have a fully-contained and bootable ZFS root kernel from a simple lilo entry. Good luck! 019e50e0645b5fd1a71b8f485d65fe3411a4b5c6 781 780 2012-09-04T17:40:07Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, try changing "order=dc" or hitting F12 at boot prompt and select the CD/DVD boot option. Note: The support for booting drives using if=scsi is not included with current versions of qemu. Booting scsi requires the 8xx_64.rom option-rom, which can be downloaded at http://www.lsi.com/downloads/Public/Host Bus Adapters/Host Bus Adapters Common Files/lsi_bios.zip. Unzip it, and then: <pre> cp 8xx_64.rom /usr/share/qemu # then run qemu-kvm with additional command line option: -option-rom 8xx_64.rom,bootindex=1 </pre> Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors inside the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS raidz1 or raidz2 virtual device types for reliability against hard drive failures. <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is most likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Let's use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export zpool commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactivated without need to issue the zpool import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override the <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how the two methods of mounting interact. When <code>mountpoint=legacy</code> is set, zfs expects the regular mount and umount commands to be used to mount and unmount the dataset with the assistance of the mount.zfs helper. For now, we will continue with <code>mountpoint=none</code>, but using legacy is also a good option. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. You can use <code>mountpoint=legacy"</code> to avoid this small problem if you are preferring to use the regular mount and umount commands on your zfs-root. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process is normal. <pre> # Finish installation and exit setup, but do NOT reboot! # There is still a lot to do before rebooting. umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We installed spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz label = vmlinuz initrd = /boot/initrd.gz root = /dev/ram0 read-write # alternatively, the root and read-write lines # can be this one line of kernel parameters: # addappend = " root=/dev/ram0 rw " </pre> A note about initrd: The /boot/initrd.gz is a gzipped cpio archive containing a minimal BusyBox-based slackware root system that is sourced from /boot/initrd-tree. The commands "mkinitrd" and "mkinitrd -F" generates /boot/initrd-tree and /boot/initrd.gz. When using a initrd, the initial root device is normally set to root=/dev/ram0 (a ramfs block device) and allowed read-write. The kernel refers to devices in terms of "major" and "minor" numbers, and the ram0 device is assigned the block device major 1 and minor 0. This ram0 major/minor is written in hexadecimal as 0x0100 (256 in decimal). This hexademical number makes an appearance in /boot/initrd-tree/int where it runs: "echo 0x0100 > /proc/sys/kernel/real-root-dev". Echoing a device code to real-root-dev is part of a deprecated initrd mechanism, but is probably harmless to leave alone as slackware has it unless you know otherwise. More information about how initrd works can be found in: <pre> /usr/src/linux/Documentation/devices.txt (info about major:minor device numbers) /usr/src/linux/Documentation/initrd.txt (mostly obsolete info on old initrd) /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt (current info on new initrd, called initramfs) </pre> Advanced note about initrd: Slackware's mkinitrd package does not use the "pivot_root" command as documented in "initrd.txt", but instead uses "switch_root" provided by a project called BusyBox. The switch_root command changes the effective root filesystem from the initrd (unpacked in rootfs at /) to the new root filesystem (zfs-root mounted at /mnt); it overmounts rootfs / with zfs-root /mnt. The switch_root works as follows: delete everything in rootfs / (one filesystem only) that held initrd to free up ram memory, then use mount, chroot, and chdir to make the effective root change. In concept (as a shell script), the command "exec switch_root /mnt $INIT $RUNLEVEL" is performed as follows: <pre> find / -xdev | xargs rm -rf cd "$1" shift mount --move . / exec chroot . "$@" </pre> Here, typically INIT=/sbin/init RUNLEVEL=3. The 'exec' causes switch_root to take the place of the parent process having PID=1. In system calls, the switch_root looks similar to this: <pre> chdir("/mnt"); /* <insert code to unlink/rmdir all initrd files/directories * installed in rootfs / without crossing filesystems > */ mount(".", "/", NULL, MS_MOVE, NULL); chroot("."); chdir("/"); execl("/sbin/init", "3", (char*) NULL ); </pre> The kernel's rootfs / that contained initrd is never actually unmounted (it can't be) because it is built into the kernel and always exists as at least a tiny ramfs or tmpfs, so you can continue to see it in /proc/mounts. When you give lilo root=/dev/ram0 (a ramfs device), the kernel will actually use the internal rootfs, which is an instance of a tmpfs (if your kernel config includes tmpfs) or ramfs. The rootfs that is a tmpfs can by default use up to half of system ram. If rootfs is a ramfs, it can use up to almost all of system ram until the system panics. Typically, tmpfs is built into the kernel, and so depending on how much ram your computer has, the initrd-tree can probably be up to about half that size. Quite a lot of notes... now to continue on: Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:e1000:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module e1000 for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p modules could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted zfs-root, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for the zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using "zpool import" and "zpool export" commands and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out the zpool import/export lines. As mentioned, the zpool import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, zfs-root will not get mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "zpool import -f zfs-root", "mount zfs-root", and then "exit" to continue booting onto zfs-root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). This is a ip-based hostid value, a 32bit hexadecimal number. The hostid has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set, and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could become invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and quit vi. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as readonly property changes. Note: if you use mountpoint=legacy, then you do not need to make the following changes: In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem check. The rc.S script will complain a lot in many places about not being able to run fsck on the zfs-root. To disable all attempts of run fsck, we can simply create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to umount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrats! If this seems to go badly, and this might happen if the import fails as explained some before, then you will be on the initrd's rescue command line just before the part in init where it wants to mount zfs-root and switch_root to boot up. In this case, you typically got commands like these to do: If you get dumped to rescue because zpool import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zpool import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your zfs-root as readonly=on to /mnt, then "exit" to continue booting. In other emergency command lines, you might need to run the lines at the end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line in init is run like: <code>exec switch_root /mnt /sbin/init 1</code> Warning: the switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. However, the deletes should not cross filesystems, but only delete the contents of initramfs. Also, in rescue command line or anytime you have finished making changes and are about to reboot in some abnormal situation, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. ---- Upgrading: From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuild and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, kernel-headers, and kernel-source. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SPL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname -r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. ---- More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> ---- Now available! "ZFS root (builtin)" wiki (aka "ZFS root, part II"): http://slackwiki.com/ZFS_root_(builtin) It is now possible to build the modules and a small initramfs into your kernel to have a fully-contained and bootable ZFS root kernel from a simple lilo entry. Good luck! 329cec425a96995e2d0a076120fae625921eda20 782 781 2012-09-04T17:54:28Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, try changing "order=dc" or hitting F12 at boot prompt and select the CD/DVD boot option. Note: The support for booting drives using if=scsi is not included with current versions of qemu. Booting scsi requires the 8xx_64.rom option-rom, which can be downloaded at [http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip LSI.com]. Unzip it, and then: <pre> cp 8xx_64.rom /usr/share/qemu # then run qemu-kvm with additional command line option: -option-rom 8xx_64.rom,bootindex=1 </pre> Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors inside the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS raidz1 or raidz2 virtual device types for reliability against hard drive failures. <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is most likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Let's use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export zpool commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactivated without need to issue the zpool import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override the <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how the two methods of mounting interact. When <code>mountpoint=legacy</code> is set, zfs expects the regular mount and umount commands to be used to mount and unmount the dataset with the assistance of the mount.zfs helper. For now, we will continue with <code>mountpoint=none</code>, but using legacy is also a good option. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. You can use <code>mountpoint=legacy"</code> to avoid this small problem if you are preferring to use the regular mount and umount commands on your zfs-root. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process is normal. <pre> # Finish installation and exit setup, but do NOT reboot! # There is still a lot to do before rebooting. umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We installed spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz label = vmlinuz initrd = /boot/initrd.gz root = /dev/ram0 read-write # alternatively, the root and read-write lines # can be this one line of kernel parameters: # addappend = " root=/dev/ram0 rw " </pre> A note about initrd: The /boot/initrd.gz is a gzipped cpio archive containing a minimal BusyBox-based slackware root system that is sourced from /boot/initrd-tree. The commands "mkinitrd" and "mkinitrd -F" generates /boot/initrd-tree and /boot/initrd.gz. When using a initrd, the initial root device is normally set to root=/dev/ram0 (a ramfs block device) and allowed read-write. The kernel refers to devices in terms of "major" and "minor" numbers, and the ram0 device is assigned the block device major 1 and minor 0. This ram0 major/minor is written in hexadecimal as 0x0100 (256 in decimal). This hexademical number makes an appearance in /boot/initrd-tree/int where it runs: "echo 0x0100 > /proc/sys/kernel/real-root-dev". Echoing a device code to real-root-dev is part of a deprecated initrd mechanism, but is probably harmless to leave alone as slackware has it unless you know otherwise. More information about how initrd works can be found in: <pre> /usr/src/linux/Documentation/devices.txt (info about major:minor device numbers) /usr/src/linux/Documentation/initrd.txt (mostly obsolete info on old initrd) /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt (current info on new initrd, called initramfs) </pre> Advanced note about initrd: Slackware's mkinitrd package does not use the "pivot_root" command as documented in "initrd.txt", but instead uses "switch_root" provided by a project called BusyBox. The switch_root command changes the effective root filesystem from the initrd (unpacked in rootfs at /) to the new root filesystem (zfs-root mounted at /mnt); it overmounts rootfs / with zfs-root /mnt. The switch_root works as follows: delete everything in rootfs / (one filesystem only) that held initrd to free up ram memory, then use mount, chroot, and chdir to make the effective root change. In concept (as a shell script), the command "exec switch_root /mnt $INIT $RUNLEVEL" is performed as follows: <pre> find / -xdev | xargs rm -rf cd "$1" shift mount --move . / exec chroot . "$@" </pre> Here, typically INIT=/sbin/init RUNLEVEL=3. The 'exec' causes switch_root to take the place of the parent process having PID=1. In system calls, the switch_root looks similar to this: <pre> chdir("/mnt"); /* <insert code to unlink/rmdir all initrd files/directories * installed in rootfs / without crossing filesystems > */ mount(".", "/", NULL, MS_MOVE, NULL); chroot("."); chdir("/"); execl("/sbin/init", "3", (char*) NULL ); </pre> The kernel's rootfs / that contained initrd is never actually unmounted (it can't be) because it is built into the kernel and always exists as at least a tiny ramfs or tmpfs, so you can continue to see it in /proc/mounts. When you give lilo root=/dev/ram0 (a ramfs device), the kernel will actually use the internal rootfs, which is an instance of a tmpfs (if your kernel config includes tmpfs) or ramfs. The rootfs that is a tmpfs can by default use up to half of system ram. If rootfs is a ramfs, it can use up to almost all of system ram until the system panics. Typically, tmpfs is built into the kernel, and so depending on how much ram your computer has, the initrd-tree can probably be up to about half that size. Quite a lot of notes... now to continue on: Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:e1000:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module e1000 for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p modules could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted zfs-root, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for the zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using "zpool import" and "zpool export" commands and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out the zpool import/export lines. As mentioned, the zpool import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, zfs-root will not get mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "zpool import -f zfs-root", "mount zfs-root", and then "exit" to continue booting onto zfs-root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). This is a ip-based hostid value, a 32bit hexadecimal number. The hostid has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set, and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could become invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and quit vi. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as readonly property changes. Note: if you use mountpoint=legacy, then you do not need to make the following changes: In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem check. The rc.S script will complain a lot in many places about not being able to run fsck on the zfs-root. To disable all attempts of run fsck, we can simply create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to umount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrats! If this seems to go badly, and this might happen if the import fails as explained some before, then you will be on the initrd's rescue command line just before the part in init where it wants to mount zfs-root and switch_root to boot up. In this case, you typically got commands like these to do: If you get dumped to rescue because zpool import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zpool import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your zfs-root as readonly=on to /mnt, then "exit" to continue booting. In other emergency command lines, you might need to run the lines at the end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line in init is run like: <code>exec switch_root /mnt /sbin/init 1</code> Warning: the switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. However, the deletes should not cross filesystems, but only delete the contents of initramfs. Also, in rescue command line or anytime you have finished making changes and are about to reboot in some abnormal situation, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. ---- Upgrading: From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuild and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, kernel-headers, and kernel-source. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SPL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname -r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. ---- More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> ---- Now available! "ZFS root (builtin)" wiki (aka "ZFS root, part II"): http://slackwiki.com/ZFS_root_(builtin) It is now possible to build the modules and a small initramfs into your kernel to have a fully-contained and bootable ZFS root kernel from a simple lilo entry. Good luck! 8c0febdd32b35b8af24e60457f4fc510f214c43c ZFS root (builtin) 0 291 740 2012-08-21T18:28:52Z Foobarz 298 how to run ZFS root with builtin modules and minimal initramfs wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate installation from the fully modular and working system. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz cd spl-0.6.0-rc10 mkdir install ./configure --prefix=/ --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share --enable-linux-builtin=yes --with-linux=/usr/src/linux-3.2.27b --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz cd spl-0.6.0-rc10 mkdir install ./configure --prefix=/ --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share --enable-linux-builtin=yes --with-linux=/usr/src/linux-3.2.27b --with-linux-obj=/usr/src/linux-3.2.27b --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS cd /boot/initramfs-source mkdir -p etc/zfs dev mnt touch etc/mtab cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache ### make the rootfs /init program cat > init.c <<"EOF" #define _BSD_SOURCE #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> int main(int argc, char* argv[]) { FILE* kmsg = NULL; char* fnkmsg = "/dev/kmsg"; mknod(fnkmsg, S_IFCHR , makedev(1,11) ); kmsg = fopen(fnkmsg, "w"); fprintf(kmsg, "foobarz-zinit starting.\n"); fprintf(kmsg, "Attempting mount devtmpfs to /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount devtmpfs successful.\n"); } if( access("/dev/zfs", F_OK) != 0 ) { fprintf(kmsg, "File /dev/zfs does not exist; making nod.\n"); mknod("/dev/zfs", S_IFCHR , makedev(10,58) ); } else { fprintf(kmsg, "File /dev/zfs already exists. Good.\n"); } if( access("/dev/sda1", F_OK) != 0 ) { fprintf(kmsg, "Files /dev/sd{a,a1} do not exist; making nods.\n"); mknod("/dev/sda", S_IFBLK , makedev(8,0) ); mknod("/dev/sda1", S_IFBLK , makedev(8,1) ); } else { fprintf(kmsg, "Files /dev/sd{a,a1} already exist. Good.\n"); } fprintf(kmsg, "Attempting mount-ro newroot to /mnt\n"); if( mount("zfs-root", "/mnt", "zfs", MS_RDONLY, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move /dev to /mnt/dev\n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Beginning switch root procedure.\n"); fprintf(kmsg, "Attempting chdir from / to /mnt\n"); if( chdir("/mnt") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move . to /\n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chroot to .\n"); if( chroot(".") != 0 ) { fprintf(kmsg, "time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chdir to /\n"); if( chdir("/") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Completed switch root procedure.\n"); fprintf(kmsg, "Execing root system /sbin/init.\n"); if( execl("/sbin/init", "3", (char *) NULL ) != 0 ) { fprintf(kmsg, "time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root ro rootfstype=zfs rootwait " lilo reboot # note: root=, rootfstype, ro, rootwait are "legacy" kernel boot options and are not really being used here # so, they probably can be removed but are not hurting # if you have errors using zfs and zpool commands on booted system with builtin modules, then # upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries # renamed like zpoolb, zfsb etc for builtin # if you have boot problem, you might want to run in qemu's -nographic console mode: qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 # wait for the lilo prompt, it takes time to show up boot: vm3.2.27b console=ttyS0 # ctrl-a h for help # ctrl-a c for (QEMU) console # BECAREFUL not to start qemu twice on the same ZFS guest # two simultaneous running qemu on the same ZFS will corrupt the pool # then it will NOT recover... you lose your whole installation! # BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! # only use -nographic to see kernel problems then quit it # Doing this is only useful until the kernel panics because additional console switching needs # to be done still. If it does boot, then ctrl-a c, and quit (sorry) and reboot normal # The console switching part missing in init would look similar to this: # #if (console) { # close(0); # xopen(console, O_RDWR); # xdup2(0, 1); # xdup2(0, 2); # } # to use if=scsi, linux module sym53c8xx, may need to use the qemu option: # -option-rom 8xx_64.rom,bootindex=1 # download it here: # http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip # extract 8xx_64.rom to /usr/share/qemu/ Then, at the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0) There is a delay before you see LILO so be patient. You should see full messages of kernel. The purpose of sgabios is that it is the "serial graphics adapter" video BIOS that sends all its text mode I/O over ttyS0. The -nographic option redirects the guest's ttyS0 to your console. The purpose of 8xx_64.rom is the SCSI interface firmware, and it boots after the SGABIOS so that everything will be visible. For QEMU help, press ctrl-a then hit h. </pre> Good luck! 557be652f03d56c92abdd034a19e196a00c85bc0 741 740 2012-08-21T18:35:03Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate installation from the fully modular and working system. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz cd spl-0.6.0-rc10 mkdir install ./configure --prefix=/ --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share --enable-linux-builtin=yes --with-linux=/usr/src/linux-3.2.27b --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz cd spl-0.6.0-rc10 mkdir install ./configure --prefix=/ --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share --enable-linux-builtin=yes --with-linux=/usr/src/linux-3.2.27b --with-linux-obj=/usr/src/linux-3.2.27b --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS cd /boot/initramfs-source mkdir -p etc/zfs dev mnt touch etc/mtab cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache ### make the rootfs /init program cat > init.c <<"EOF" #define _BSD_SOURCE #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> int main(int argc, char* argv[]) { FILE* kmsg = NULL; char* fnkmsg = "/dev/kmsg"; mknod(fnkmsg, S_IFCHR , makedev(1,11) ); kmsg = fopen(fnkmsg, "w"); fprintf(kmsg, "foobarz-zinit starting.\n"); fprintf(kmsg, "Attempting mount devtmpfs to /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount devtmpfs successful.\n"); } if( access("/dev/zfs", F_OK) != 0 ) { fprintf(kmsg, "File /dev/zfs does not exist; making nod.\n"); mknod("/dev/zfs", S_IFCHR , makedev(10,58) ); } else { fprintf(kmsg, "File /dev/zfs already exists. Good.\n"); } if( access("/dev/sda1", F_OK) != 0 ) { fprintf(kmsg, "Files /dev/sd{a,a1} do not exist; making nods.\n"); mknod("/dev/sda", S_IFBLK , makedev(8,0) ); mknod("/dev/sda1", S_IFBLK , makedev(8,1) ); } else { fprintf(kmsg, "Files /dev/sd{a,a1} already exist. Good.\n"); } fprintf(kmsg, "Attempting mount-ro newroot to /mnt\n"); if( mount("zfs-root", "/mnt", "zfs", MS_RDONLY, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move /dev to /mnt/dev\n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Beginning switch root procedure.\n"); fprintf(kmsg, "Attempting chdir from / to /mnt\n"); if( chdir("/mnt") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move . to /\n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chroot to .\n"); if( chroot(".") != 0 ) { fprintf(kmsg, "time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chdir to /\n"); if( chdir("/") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Completed switch root procedure.\n"); fprintf(kmsg, "Execing root system /sbin/init.\n"); if( execl("/sbin/init", "3", (char *) NULL ) != 0 ) { fprintf(kmsg, "time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root ro rootfstype=zfs rootwait " lilo reboot # note: root=, rootfstype, ro, rootwait are "legacy" kernel boot options and are not really being used here # so, they probably can be removed but are not hurting # if you have errors using zfs and zpool commands on booted system with builtin modules, then # upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries # renamed like zpoolb, zfsb etc for builtin # if you have boot problem, you might want to run in qemu's -nographic console mode: qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 # wait for the lilo prompt, it takes time to show up boot: vm3.2.27b console=ttyS0 # ctrl-a h for help # ctrl-a c for (QEMU) console # BECAREFUL not to start qemu twice on the same ZFS guest # two simultaneous running qemu on the same ZFS will corrupt the pool # then it will NOT recover... you lose your whole installation! # BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! # only use -nographic to see kernel problems then quit it # Doing this is only useful until the kernel panics because additional console switching needs # to be done still. If it does boot, then ctrl-a c, and quit (sorry) and reboot normal # The console switching part missing in init would look similar to this: # #if (console) { # close(0); # xopen(console, O_RDWR); # xdup2(0, 1); # xdup2(0, 2); # } # to use if=scsi, linux module sym53c8xx, may need to use the qemu option: # -option-rom 8xx_64.rom,bootindex=1 # download it here: # http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip # extract 8xx_64.rom to /usr/share/qemu/ Then, at the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0) There is a delay before you see LILO so be patient. You should see full messages of kernel. The purpose of sgabios is that it is the "serial graphics adapter" video BIOS that sends all its text mode I/O over ttyS0. The -nographic option redirects the guest's ttyS0 to your console. The purpose of 8xx_64.rom is the SCSI interface firmware, and it boots after the SGABIOS so that everything will be visible. For QEMU help, press ctrl-a then hit h. </pre> Good luck! f34aa97a412e10d7136bbfe00f3d9669ef662351 742 741 2012-08-21T18:36:20Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate installation from the fully modular and working system. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure --prefix=/ --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share --enable-linux-builtin=yes --with-linux=/usr/src/linux-3.2.27b --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure --prefix=/ --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share --enable-linux-builtin=yes --with-linux=/usr/src/linux-3.2.27b --with-linux-obj=/usr/src/linux-3.2.27b --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS cd /boot/initramfs-source mkdir -p etc/zfs dev mnt touch etc/mtab cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache ### make the rootfs /init program cat > init.c <<"EOF" #define _BSD_SOURCE #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> int main(int argc, char* argv[]) { FILE* kmsg = NULL; char* fnkmsg = "/dev/kmsg"; mknod(fnkmsg, S_IFCHR , makedev(1,11) ); kmsg = fopen(fnkmsg, "w"); fprintf(kmsg, "foobarz-zinit starting.\n"); fprintf(kmsg, "Attempting mount devtmpfs to /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount devtmpfs successful.\n"); } if( access("/dev/zfs", F_OK) != 0 ) { fprintf(kmsg, "File /dev/zfs does not exist; making nod.\n"); mknod("/dev/zfs", S_IFCHR , makedev(10,58) ); } else { fprintf(kmsg, "File /dev/zfs already exists. Good.\n"); } if( access("/dev/sda1", F_OK) != 0 ) { fprintf(kmsg, "Files /dev/sd{a,a1} do not exist; making nods.\n"); mknod("/dev/sda", S_IFBLK , makedev(8,0) ); mknod("/dev/sda1", S_IFBLK , makedev(8,1) ); } else { fprintf(kmsg, "Files /dev/sd{a,a1} already exist. Good.\n"); } fprintf(kmsg, "Attempting mount-ro newroot to /mnt\n"); if( mount("zfs-root", "/mnt", "zfs", MS_RDONLY, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move /dev to /mnt/dev\n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Beginning switch root procedure.\n"); fprintf(kmsg, "Attempting chdir from / to /mnt\n"); if( chdir("/mnt") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move . to /\n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chroot to .\n"); if( chroot(".") != 0 ) { fprintf(kmsg, "time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chdir to /\n"); if( chdir("/") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Completed switch root procedure.\n"); fprintf(kmsg, "Execing root system /sbin/init.\n"); if( execl("/sbin/init", "3", (char *) NULL ) != 0 ) { fprintf(kmsg, "time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root ro rootfstype=zfs rootwait " lilo reboot # note: root=, rootfstype, ro, rootwait are "legacy" kernel boot options and are not really being used here # so, they probably can be removed but are not hurting # if you have errors using zfs and zpool commands on booted system with builtin modules, then # upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries # renamed like zpoolb, zfsb etc for builtin # if you have boot problem, you might want to run in qemu's -nographic console mode: qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 # wait for the lilo prompt, it takes time to show up boot: vm3.2.27b console=ttyS0 # ctrl-a h for help # ctrl-a c for (QEMU) console # BECAREFUL not to start qemu twice on the same ZFS guest # two simultaneous running qemu on the same ZFS will corrupt the pool # then it will NOT recover... you lose your whole installation! # BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! # only use -nographic to see kernel problems then quit it # Doing this is only useful until the kernel panics because additional console switching needs # to be done still. If it does boot, then ctrl-a c, and quit (sorry) and reboot normal # The console switching part missing in init would look similar to this: # #if (console) { # close(0); # xopen(console, O_RDWR); # xdup2(0, 1); # xdup2(0, 2); # } # to use if=scsi, linux module sym53c8xx, may need to use the qemu option: # -option-rom 8xx_64.rom,bootindex=1 # download it here: # http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip # extract 8xx_64.rom to /usr/share/qemu/ Then, at the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0) There is a delay before you see LILO so be patient. You should see full messages of kernel. The purpose of sgabios is that it is the "serial graphics adapter" video BIOS that sends all its text mode I/O over ttyS0. The -nographic option redirects the guest's ttyS0 to your console. The purpose of 8xx_64.rom is the SCSI interface firmware, and it boots after the SGABIOS so that everything will be visible. For QEMU help, press ctrl-a then hit h. </pre> Good luck! 32108e7329cd1ea2224a5f7294deab04666eecd0 743 742 2012-08-23T10:15:14Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate installation from the fully modular and working system. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS ### prepare contents of initramfs cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 # this should be enough device nodes initially # once devtmpfs mounts over /dev, a lot more is available in it by default cat > /init <<"EOF" <some initial program PID=1 for the system to start on> EOF # an initramfs-source/init program is required to mount and boot a root linux system # the common way to make /init is using busybox with files like this: # /bin/busybox # /bin/ash -> busybox # /bin/sh -> busybox # # run busybox to see what other "applets" can be symlinked to it # # when busybox is run as a different symlinked applet name, it runs the applet # /init # # init is ash script, see slackware's /boot/initrd-tree/init for example # Inside this script: # 1) parse kernel parameters passed into it and set variables based on them # 2) start udevd and trigger rules for block devices to setup initial /dev devices # 3) load kernel modules and keyboard map # 4) run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices # (any udev rules for them should do more /dev setup in the background) # 5) mount the root filesystem read-only at /mnt # 6) stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh # 7) shutdown udevd so it can be restarted by root system when booted # 8) mount --move {proc,sys,run,dev} to under /mnt # 9) run: exec switch_root /mnt /sbin/init $RUNLEVEL # The slackware mkinitrd package is fully configured busybox installation # for an extern file initramfs initrd.gz image outside the kernel. # It could be changed to be inside the kernel easily by just using initrd-tree # as target of INITRAMFS_SOURCE in the kernel config and removing initrd in lilo. # Because the zfs modules are builtin, we really don't need busybox and the whole # mkinitrd package. All we need to do is mount the zfs that is already imported # because the zpool.cache is present in rootfs when the zfs module initializes, and # then we do the switch root procedure to boot up on the mounted system. # udevd rules will still be run when the root system starts udevd. # So, let's make a simple /init c program that will be all that we really need: cat > init.c <<"EOF" /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_INIT_VERSION "1.0.0" #define _BSD_SOURCE #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* Your initramfs-source should contain the following * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 */ int main(int argc, char* argv[]) { /***** variables * */ int i; FILE* kmsg = NULL; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; int usage = EX_OK; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; }; struct nv param[] = { { "root=", NULL, NULL, 1 }, /* required; root device to boot */ { "rootfs=", NULL, NULL, 1 }, /* required; root filesystem type */ { "mountopt=", NULL, NULL, 0 }, /* optional; mount option ro or rw; default ro */ { "init=", NULL, NULL, 0 }, /* optional; alt. init prgm; default /sbin/init */ { "runlevel=", NULL, NULL, 0 }, /* optional; runlevel 0123456Ss; default 3 multiuser */ { "console=", NULL, NULL, 0 } /* optional; alt. console; e.g. ttyS0 */ }; enum { iroot, irootfs, imountopt, iinit, irunlevel, iconsole, ilastparam }; /***** program * */ kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { fprintf(kmsg, "Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc before dev since some devices * symlink into proc */ fprintf(kmsg, "Attempting mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount proc successful.\n"); } /* mount devtmpfs as expected by an init program * and maybe required to mount zfs */ fprintf(kmsg, "Attempting mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount devtmpfs successful.\n"); } /* it is assumed that all required devices are in devtmpfs * and if not, there will be boot problems * * if you need a more complex device setup, then you might need * udevd and run it with a larger full initrd package from your distro */ /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { fprintf(kmsg, "Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } fprintf(kmsg, "Kernel cmdline size: %i\n", cmdline_size); fprintf(kmsg, "Kernel cmdline: \"%s\"\n", cmdline); for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { fprintf(kmsg, "Kernel parameter %s: value missing.\n", param[i].n); } else param[i].v_end = temp_end; } } /* set defaults on non-required params, except for console */ if( param[imountopt].v == NULL ) param[imountopt].v = "ro"; if( param[iinit].v == NULL ) param[iinit].v = "/sbin/init"; if( param[irunlevel].v == NULL ) param[irunlevel].v = "3"; for( i=iroot; i<ilastparam; i++ ) { if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; fprintf(kmsg, "Using %s \"%s\"\n", param[i].n, param[i].v); } for( i=iroot; i<ilastparam; i++ ) { if( (param[i].req == 1) && (param[i].v == NULL) ) { printf("Error: missing required kernel parameter: %s\n", param[i].n); usage = EX_USAGE; } } if( usage != EX_OK ) { printf("Aborting boot process. Missing required kernel parameter(s).\n"); return usage; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[iroot]: nothing to do, if user put bad device in then we fail */ /* param[irootfs]: can be checked against /proc/filesystems: */ /* required, so should have value */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { fprintf(kmsg, "Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfs].v) == NULL ) { fprintf(kmsg, "%s \"%s\": filesystem type not available.\n", param[irootfs].n, param[irootfs].v); return EX_UNAVAILABLE; } if( strcmp(param[irootfs].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfs].v); else fprintf(kmsg, "%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfs].v); if( access("/etc/hostid", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/hostid is present in initramfs.\n", param[irootfs].v); else fprintf(kmsg, "%s: /etc/hostid not present in initramfs.\n", param[irootfs].v); } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { fprintf(kmsg, "% \"%\": invalid parameter value;\n" " use \"ro\" or \"rw\" (no quotes or spaces);\n" " defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v ); mountflags = MS_RDONLY; } fprintf(kmsg, "Attempting %s %s mount %s /mnt.\n", param[irootfs].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfs].v, mountflags, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "%s mounted successfully.\n", param[iroot].v); fprintf(kmsg, "Attempting mount --move /dev /mnt/dev\n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount --move /proc /mnt/proc\n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Beginning switch root procedure.\n"); fprintf(kmsg, "Attempting chdir from / to /mnt\n"); if( chdir("/mnt") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move . to /\n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chroot to .\n"); if( chroot(".") != 0 ) { fprintf(kmsg, "time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chdir to /\n"); if( chdir("/") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].v != NULL ) { fprintf(kmsg, "Console redirection to device %s requested.\n", param[iconsole].v); fprintf(kmsg, "Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); /* expect only basename of device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); chdir("/"); } fprintf(kmsg, "Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ fclose(kmsg); free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "time to panic: execl: %s\n", strerror(errno)); fclose(kmsg); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root ro rootfstype=zfs rootwait " lilo reboot # note: root=, rootfstype, ro, rootwait are "legacy" kernel boot options and are not really being used here # so, they probably can be removed but are not hurting # if you have errors using zfs and zpool commands on booted system with builtin modules, then # upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries # renamed like zpoolb, zfsb etc for builtin # if you have boot problem, you might want to run in qemu's -nographic console mode: qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 # wait for the lilo prompt, it takes time to show up boot: vm3.2.27b console=ttyS0 # ctrl-a h for help # ctrl-a c for (QEMU) console # BECAREFUL not to start qemu twice on the same ZFS guest # two simultaneous running qemu on the same ZFS will corrupt the pool # then it will NOT recover... you lose your whole installation! # BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! # only use -nographic to see kernel problems then quit it # Doing this is only useful until the kernel panics because additional console switching needs # to be done still. If it does boot, then ctrl-a c, and quit (sorry) and reboot normal # The console switching part missing in init would look similar to this: # #if (console) { # close(0); # xopen(console, O_RDWR); # xdup2(0, 1); # xdup2(0, 2); # } # to use if=scsi, linux module sym53c8xx, may need to use the qemu option: # -option-rom 8xx_64.rom,bootindex=1 # download it here: # http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip # extract 8xx_64.rom to /usr/share/qemu/ Then, at the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0) There is a delay before you see LILO so be patient. You should see full messages of kernel. The purpose of sgabios is that it is the "serial graphics adapter" video BIOS that sends all its text mode I/O over ttyS0. The -nographic option redirects the guest's ttyS0 to your console. The purpose of 8xx_64.rom is the SCSI interface firmware, and it boots after the SGABIOS so that everything will be visible. For QEMU help, press ctrl-a then hit h. </pre> Good luck! 74d722e56cd1017b70840e4078cd05372b4113f3 744 743 2012-08-23T10:17:30Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate installation from the fully modular and working system. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS ### prepare contents of initramfs cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 # this should be enough device nodes initially # once devtmpfs mounts over /dev, a lot more is available in it by default cat > /init <<"EOF" <some initial program PID=1 for the system to start on> EOF # an initramfs-source/init program is required to mount and boot a root linux system # the common way to make /init is using busybox with files like this: # /bin/busybox # /bin/ash -> busybox # /bin/sh -> busybox # # run busybox to see what other "applets" can be symlinked to it # # when busybox is run as a different symlinked applet name, it runs the applet # /init # # init is ash script, see slackware's /boot/initrd-tree/init for example # Inside this script: # 1) parse kernel parameters passed into it and set variables based on them # 2) start udevd and trigger rules for block devices to setup initial /dev devices # 3) load kernel modules and keyboard map # 4) run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices # (any udev rules for them should do more /dev setup in the background) # 5) mount the root filesystem read-only at /mnt # 6) stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh # 7) shutdown udevd so it can be restarted by root system when booted # 8) mount --move {proc,sys,run,dev} to under /mnt # 9) run: exec switch_root /mnt /sbin/init $RUNLEVEL # The slackware mkinitrd package is fully configured busybox installation # for an extern file initramfs initrd.gz image outside the kernel. # It could be changed to be inside the kernel easily by just using initrd-tree # as target of INITRAMFS_SOURCE in the kernel config and removing initrd in lilo. # Because the zfs modules are builtin, we really don't need busybox and the whole # mkinitrd package. All we need to do is mount the zfs that is already imported # because the zpool.cache is present in rootfs when the zfs module initializes, and # then we do the switch root procedure to boot up on the mounted system. # udevd rules will still be run when the root system starts udevd. # So, let's make a simple /init c program that will be all that we really need: cat > init.c <<"EOF" /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_INIT_VERSION "1.0.0" #define _BSD_SOURCE #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* Your initramfs-source should contain the following * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 */ int main(int argc, char* argv[]) { /***** variables * */ int i; FILE* kmsg = NULL; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; int usage = EX_OK; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; }; struct nv param[] = { { "root=", NULL, NULL, 1 }, /* required; root device to boot */ { "rootfs=", NULL, NULL, 1 }, /* required; root filesystem type */ { "mountopt=", NULL, NULL, 0 }, /* optional; mount option ro or rw; default ro */ { "init=", NULL, NULL, 0 }, /* optional; alt. init prgm; default /sbin/init */ { "runlevel=", NULL, NULL, 0 }, /* optional; runlevel 0123456Ss; default 3 multiuser */ { "console=", NULL, NULL, 0 } /* optional; alt. console; e.g. ttyS0 */ }; enum { iroot, irootfs, imountopt, iinit, irunlevel, iconsole, ilastparam }; /***** program * */ kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { fprintf(kmsg, "Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc before dev since some devices * symlink into proc */ fprintf(kmsg, "Attempting mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount proc successful.\n"); } /* mount devtmpfs as expected by an init program * and maybe required to mount zfs */ fprintf(kmsg, "Attempting mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount devtmpfs successful.\n"); } /* it is assumed that all required devices are in devtmpfs * and if not, there will be boot problems * * if you need a more complex device setup, then you might need * udevd and run it with a larger full initrd package from your distro */ /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { fprintf(kmsg, "Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } fprintf(kmsg, "Kernel cmdline size: %i\n", cmdline_size); fprintf(kmsg, "Kernel cmdline: \"%s\"\n", cmdline); for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { fprintf(kmsg, "Kernel parameter %s: value missing.\n", param[i].n); } else param[i].v_end = temp_end; } } /* set defaults on non-required params, except for console */ if( param[imountopt].v == NULL ) param[imountopt].v = "ro"; if( param[iinit].v == NULL ) param[iinit].v = "/sbin/init"; if( param[irunlevel].v == NULL ) param[irunlevel].v = "3"; for( i=iroot; i<ilastparam; i++ ) { if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; fprintf(kmsg, "Using %s \"%s\"\n", param[i].n, param[i].v); } for( i=iroot; i<ilastparam; i++ ) { if( (param[i].req == 1) && (param[i].v == NULL) ) { printf("Error: missing required kernel parameter: %s\n", param[i].n); usage = EX_USAGE; } } if( usage != EX_OK ) { printf("Aborting boot process. Missing required kernel parameter(s).\n"); return usage; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[iroot]: nothing to do, if user put bad device in then we fail */ /* param[irootfs]: can be checked against /proc/filesystems: */ /* required, so should have value */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { fprintf(kmsg, "Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfs].v) == NULL ) { fprintf(kmsg, "%s \"%s\": filesystem type not available.\n", param[irootfs].n, param[irootfs].v); return EX_UNAVAILABLE; } if( strcmp(param[irootfs].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfs].v); else fprintf(kmsg, "%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfs].v); if( access("/etc/hostid", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/hostid is present in initramfs.\n", param[irootfs].v); else fprintf(kmsg, "%s: /etc/hostid not present in initramfs.\n", param[irootfs].v); } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { fprintf(kmsg, "% \"%\": invalid parameter value;\n" " use \"ro\" or \"rw\" (no quotes or spaces);\n" " defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v ); mountflags = MS_RDONLY; } fprintf(kmsg, "Attempting %s %s mount %s /mnt.\n", param[irootfs].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfs].v, mountflags, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "%s mounted successfully.\n", param[iroot].v); fprintf(kmsg, "Attempting mount --move /dev /mnt/dev\n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount --move /proc /mnt/proc\n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Beginning switch root procedure.\n"); fprintf(kmsg, "Attempting chdir from / to /mnt\n"); if( chdir("/mnt") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move . to /\n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chroot to .\n"); if( chroot(".") != 0 ) { fprintf(kmsg, "time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chdir to /\n"); if( chdir("/") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].v != NULL ) { fprintf(kmsg, "Console redirection to device %s requested.\n", param[iconsole].v); fprintf(kmsg, "Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); /* expect only basename of device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); chdir("/"); } fprintf(kmsg, "Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ fclose(kmsg); free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "time to panic: execl: %s\n", strerror(errno)); fclose(kmsg); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root ro rootfstype=zfs rootwait " lilo reboot # note: root=, rootfstype, ro, rootwait are "legacy" kernel boot options and are not really being used here # so, they probably can be removed but are not hurting # if you have errors using zfs and zpool commands on booted system with builtin modules, then # upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries # renamed like zpoolb, zfsb etc for builtin # if you have boot problem, you might want to run in qemu's -nographic console mode: qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 # wait for the lilo prompt, it takes time to show up boot: vm3.2.27b console=ttyS0 # ctrl-a h for help # ctrl-a c for (QEMU) console # BECAREFUL not to start qemu twice on the same ZFS guest # two simultaneous running qemu on the same ZFS will corrupt the pool # then it will NOT recover... you lose your whole installation! # BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! # only use -nographic to see kernel problems then quit it... # qemu or slackware is buggy with this it gets stuck right before you get the tty1 prompt. # to use if=scsi, linux module sym53c8xx, may need to use the qemu option: # -option-rom 8xx_64.rom,bootindex=1 # download it here: # http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip # extract 8xx_64.rom to /usr/share/qemu/ Then, at the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0) There is a delay before you see LILO so be patient. You should see full messages of kernel. The purpose of sgabios is that it is the "serial graphics adapter" video BIOS that sends all its text mode I/O over ttyS0. The -nographic option redirects the guest's ttyS0 to your console. The purpose of 8xx_64.rom is the SCSI interface firmware, and it boots after the SGABIOS so that everything will be visible. For QEMU help, press ctrl-a then hit h. </pre> Good luck! 50b17557c138926457ef558417d3ff344d1ce600 745 744 2012-08-23T10:35:58Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate installation from the fully modular and working system. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS ### prepare contents of initramfs cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 # this should be enough device nodes initially # once devtmpfs mounts over /dev, a lot more is available in it by default cat > /init <<"EOF" <some initial program PID=1 for the system to start on> EOF # an initramfs-source/init program is required to mount and boot a root linux system # the common way to make /init is using busybox with files like this: # /bin/busybox # /bin/ash -> busybox # /bin/sh -> busybox # # run busybox to see what other "applets" can be symlinked to it # # when busybox is run as a different symlinked applet name, it runs the applet # /init # # init is ash script, see slackware's /boot/initrd-tree/init for example # Inside this script: # 1) parse kernel parameters passed into it and set variables based on them # 2) start udevd and trigger rules for block devices to setup initial /dev devices # 3) load kernel modules and keyboard map # 4) run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices # (any udev rules for them should do more /dev setup in the background) # 5) mount the root filesystem read-only at /mnt # 6) stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh # 7) shutdown udevd so it can be restarted by root system when booted # 8) mount --move {proc,sys,run,dev} to under /mnt # 9) run: exec switch_root /mnt /sbin/init $RUNLEVEL # The slackware mkinitrd package is fully configured busybox installation # for an extern file initramfs initrd.gz image outside the kernel. # It could be changed to be inside the kernel easily by just using initrd-tree # as target of INITRAMFS_SOURCE in the kernel config and removing initrd in lilo. # Because the zfs modules are builtin, we really don't need busybox and the whole # mkinitrd package. All we need to do is mount the zfs that is already imported # because the zpool.cache is present in rootfs when the zfs module initializes, and # then we do the switch root procedure to boot up on the mounted system. # udevd rules will still be run when the root system starts udevd. # So, let's make a simple /init c program that will be all that we really need: cat > init.c <<"EOF" /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_INIT_VERSION "1.0.1" #define _BSD_SOURCE #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* Your initramfs-source should contain the following * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 */ int main(int argc, char* argv[]) { /***** variables * */ int i; FILE* kmsg = NULL; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; int usage = EX_OK; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; }; struct nv param[] = { { "root=", NULL, NULL, 1 }, /* required; root device to boot */ { "rootfstype=", NULL, NULL, 1 }, /* required; root filesystem type */ { "mountopt=", NULL, NULL, 0 }, /* optional; mount option ro or rw; default ro */ { "init=", NULL, NULL, 0 }, /* optional; alt. init prgm; default /sbin/init */ { "runlevel=", NULL, NULL, 0 }, /* optional; runlevel 0123456Ss; default 3 multiuser */ { "console=", NULL, NULL, 0 } /* optional; alt. console; e.g. ttyS0 */ }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, ilastparam }; /***** program * */ kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { fprintf(kmsg, "Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc before dev since some devices * symlink into proc */ fprintf(kmsg, "Attempting mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount proc successful.\n"); } /* mount devtmpfs as expected by an init program * and maybe required to mount zfs */ fprintf(kmsg, "Attempting mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount devtmpfs successful.\n"); } /* it is assumed that all required devices are in devtmpfs * and if not, there will be boot problems * * if you need a more complex device setup, then you might need * udevd and run it with a larger full initrd package from your distro */ /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { fprintf(kmsg, "Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } fprintf(kmsg, "Kernel cmdline size: %i\n", cmdline_size); fprintf(kmsg, "Kernel cmdline: \"%s\"\n", cmdline); for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { fprintf(kmsg, "Kernel parameter %s: value missing.\n", param[i].n); } else param[i].v_end = temp_end; } } /* set defaults on non-required params, except for console */ if( param[imountopt].v == NULL ) param[imountopt].v = "ro"; if( param[iinit].v == NULL ) param[iinit].v = "/sbin/init"; if( param[irunlevel].v == NULL ) param[irunlevel].v = "3"; for( i=iroot; i<ilastparam; i++ ) { if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; fprintf(kmsg, "Using %s \"%s\"\n", param[i].n, param[i].v); } for( i=iroot; i<ilastparam; i++ ) { if( (param[i].req == 1) && (param[i].v == NULL) ) { printf("Error: missing required kernel parameter: %s\n", param[i].n); usage = EX_USAGE; } } if( usage != EX_OK ) { printf("Aborting boot process. Missing required kernel parameter(s).\n"); return usage; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[iroot]: nothing to do, if user put bad device in then we fail */ /* param[irootfstype]: can be checked against /proc/filesystems: */ /* required, so should have value */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { fprintf(kmsg, "Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { fprintf(kmsg, "%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else fprintf(kmsg, "%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else fprintf(kmsg, "%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { fprintf(kmsg, "% \"%\": invalid parameter value;\n" " use \"ro\" or \"rw\" (no quotes or spaces);\n" " defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v ); mountflags = MS_RDONLY; } fprintf(kmsg, "Attempting %s %s mount %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "%s mounted successfully.\n", param[iroot].v); fprintf(kmsg, "Attempting mount --move /dev /mnt/dev\n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount --move /proc /mnt/proc\n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Beginning switch root procedure.\n"); fprintf(kmsg, "Attempting chdir from / to /mnt\n"); if( chdir("/mnt") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move . to /\n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chroot to .\n"); if( chroot(".") != 0 ) { fprintf(kmsg, "time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chdir to /\n"); if( chdir("/") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].v != NULL ) { fprintf(kmsg, "Console redirection to device %s requested.\n", param[iconsole].v); fprintf(kmsg, "Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); /* expect only basename of device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); chdir("/"); } fprintf(kmsg, "Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ fclose(kmsg); free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "time to panic: execl: %s\n", strerror(errno)); fclose(kmsg); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root ro rootfstype=zfs rootwait " lilo reboot # note: root=, rootfstype, ro, rootwait are "legacy" kernel boot options and are not really being used here # so, they probably can be removed but are not hurting # if you have errors using zfs and zpool commands on booted system with builtin modules, then # upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries # renamed like zpoolb, zfsb etc for builtin # if you have boot problem, you might want to run in qemu's -nographic console mode: qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 # wait for the lilo prompt, it takes time to show up boot: vm3.2.27b console=ttyS0 # ctrl-a h for help # ctrl-a c for (QEMU) console # BECAREFUL not to start qemu twice on the same ZFS guest # two simultaneous running qemu on the same ZFS will corrupt the pool # then it will NOT recover... you lose your whole installation! # BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! # only use -nographic to see kernel problems then quit it... # qemu or slackware is buggy with this it gets stuck right before you get the tty1 prompt. # to use if=scsi, linux module sym53c8xx, may need to use the qemu option: # -option-rom 8xx_64.rom,bootindex=1 # download it here: # http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip # extract 8xx_64.rom to /usr/share/qemu/ Then, at the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0) There is a delay before you see LILO so be patient. You should see full messages of kernel. The purpose of sgabios is that it is the "serial graphics adapter" video BIOS that sends all its text mode I/O over ttyS0. The -nographic option redirects the guest's ttyS0 to your console. The purpose of 8xx_64.rom is the SCSI interface firmware, and it boots after the SGABIOS so that everything will be visible. For QEMU help, press ctrl-a then hit h. </pre> Good luck! cda3945d8789bf2e09dfc85cde91233848de233b 746 745 2012-08-24T02:44:35Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate installation from the fully modular and working system. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS ### prepare contents of initramfs cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 # this should be enough device nodes initially # once devtmpfs mounts over /dev, a lot more is available in it by default cat > /init <<"EOF" <some initial program PID=1 for the system to start on> EOF # an initramfs-source/init program is required to mount and boot a root linux system # the common way to make /init is using busybox with files like this: # /bin/busybox # /bin/ash -> busybox # /bin/sh -> busybox # # run busybox to see what other "applets" can be symlinked to it # # when busybox is run as a different symlinked applet name, it runs the applet # /init # # init is ash script, see slackware's /boot/initrd-tree/init for example # Inside this script: # 1) parse kernel parameters passed into it and set variables based on them # 2) start udevd and trigger rules for block devices to setup initial /dev devices # 3) load kernel modules and keyboard map # 4) run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices # (any udev rules for them should do more /dev setup in the background) # 5) mount the root filesystem read-only at /mnt # 6) stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh # 7) shutdown udevd so it can be restarted by root system when booted # 8) mount --move {proc,sys,run,dev} to under /mnt # 9) run: exec switch_root /mnt /sbin/init $RUNLEVEL # The slackware mkinitrd package is fully configured busybox installation # for an extern file initramfs initrd.gz image outside the kernel. # It could be changed to be inside the kernel easily by just using initrd-tree # as target of INITRAMFS_SOURCE in the kernel config and removing initrd in lilo. # Because the zfs modules are builtin, we really don't need busybox and the whole # mkinitrd package. All we need to do is mount the zfs that is already imported # because the zpool.cache is present in rootfs when the zfs module initializes, and # then we do the switch root procedure to boot up on the mounted system. # udevd rules will still be run when the root system starts udevd. # So, let's make a simple /init c program that will be all that we really need: cat > init.c <<"EOF" /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_INIT_VERSION "1.0.1" #define _BSD_SOURCE #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* Your initramfs-source should contain the following * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 */ int main(int argc, char* argv[]) { /***** variables * */ int i; FILE* kmsg = NULL; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; int usage = EX_OK; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; }; struct nv param[] = { { "root=", NULL, NULL, 1 }, /* required; root device to boot */ { "rootfstype=", NULL, NULL, 1 }, /* required; root filesystem type */ { "mountopt=", NULL, NULL, 0 }, /* optional; mount option ro or rw; default ro */ { "init=", NULL, NULL, 0 }, /* optional; alt. init prgm; default /sbin/init */ { "runlevel=", NULL, NULL, 0 }, /* optional; runlevel 0123456Ss; default 3 multiuser */ { "console=", NULL, NULL, 0 } /* optional; alt. console; e.g. ttyS0 */ }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, ilastparam }; /***** program * */ kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { fprintf(kmsg, "Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc before dev since some devices * symlink into proc */ fprintf(kmsg, "Attempting mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount proc successful.\n"); } /* mount devtmpfs as expected by an init program * and maybe required to mount zfs */ fprintf(kmsg, "Attempting mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount devtmpfs successful.\n"); } /* it is assumed that all required devices are in devtmpfs * and if not, there will be boot problems * * if you need a more complex device setup, then you might need * udevd and run it with a larger full initrd package from your distro */ /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { fprintf(kmsg, "Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } fprintf(kmsg, "Kernel cmdline size: %i\n", cmdline_size); fprintf(kmsg, "Kernel cmdline: \"%s\"\n", cmdline); for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { fprintf(kmsg, "Kernel parameter %s: value missing.\n", param[i].n); } else param[i].v_end = temp_end; } } /* set defaults on non-required params, except for console */ if( param[imountopt].v == NULL ) param[imountopt].v = "ro"; if( param[iinit].v == NULL ) param[iinit].v = "/sbin/init"; if( param[irunlevel].v == NULL ) param[irunlevel].v = "3"; for( i=iroot; i<ilastparam; i++ ) { if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; fprintf(kmsg, "Using %s \"%s\"\n", param[i].n, param[i].v); } for( i=iroot; i<ilastparam; i++ ) { if( (param[i].req == 1) && (param[i].v == NULL) ) { printf("Error: missing required kernel parameter: %s\n", param[i].n); usage = EX_USAGE; } } if( usage != EX_OK ) { printf("Aborting boot process. Missing required kernel parameter(s).\n"); return usage; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[iroot]: nothing to do, if user put bad device in then we fail */ /* param[irootfstype]: can be checked against /proc/filesystems: */ /* required, so should have value */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { fprintf(kmsg, "Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { fprintf(kmsg, "%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else fprintf(kmsg, "%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else fprintf(kmsg, "%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { fprintf(kmsg, "% \"%\": invalid parameter value;\n" " use \"ro\" or \"rw\" (no quotes or spaces);\n" " defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v ); mountflags = MS_RDONLY; } fprintf(kmsg, "Attempting %s %s mount %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "%s mounted successfully.\n", param[iroot].v); fprintf(kmsg, "Attempting mount --move /dev /mnt/dev\n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount --move /proc /mnt/proc\n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Beginning switch root procedure.\n"); fprintf(kmsg, "Attempting chdir from / to /mnt\n"); if( chdir("/mnt") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move . to /\n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chroot to .\n"); if( chroot(".") != 0 ) { fprintf(kmsg, "time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chdir to /\n"); if( chdir("/") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].v != NULL ) { fprintf(kmsg, "Console redirection to device %s requested.\n", param[iconsole].v); fprintf(kmsg, "Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); /* expect only basename of device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); chdir("/"); } fprintf(kmsg, "Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ fclose(kmsg); free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "time to panic: execl: %s\n", strerror(errno)); fclose(kmsg); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root ro rootfstype=zfs rootwait " lilo reboot </pre> Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notes on the spl and zfs packages to install: If you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevels "s1" (ttyS0) and "s2" (ttyS1) for serial console login support. Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 runlevel=s1 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). When you are in qemu's serial graphics mode, the interface is a little different than in the normal graphical SQL-based mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console of booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.com used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! a3c541d323bd49c9cae2c79d0dce8ae4dc1d66fb 747 746 2012-08-24T02:55:37Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate installation from the fully modular and working system. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS ### prepare contents of initramfs cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 # this should be enough device nodes initially # once devtmpfs mounts over /dev, a lot more is available in it by default cat > /init <<"EOF" <some initial program PID=1 for the system to start on> EOF # an initramfs-source/init program is required to mount and boot a root linux system # the common way to make /init is using busybox with files like this: # /bin/busybox # /bin/ash -> busybox # /bin/sh -> busybox # # run busybox to see what other "applets" can be symlinked to it # # when busybox is run as a different symlinked applet name, it runs the applet # /init # # init is ash script, see slackware's /boot/initrd-tree/init for example # Inside this script: # 1) parse kernel parameters passed into it and set variables based on them # 2) start udevd and trigger rules for block devices to setup initial /dev devices # 3) load kernel modules and keyboard map # 4) run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices # (any udev rules for them should do more /dev setup in the background) # 5) mount the root filesystem read-only at /mnt # 6) stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh # 7) shutdown udevd so it can be restarted by root system when booted # 8) mount --move {proc,sys,run,dev} to under /mnt # 9) run: exec switch_root /mnt /sbin/init $RUNLEVEL # The slackware mkinitrd package is fully configured busybox installation # for an extern file initramfs initrd.gz image outside the kernel. # It could be changed to be inside the kernel easily by just using initrd-tree # as target of INITRAMFS_SOURCE in the kernel config and removing initrd in lilo. # Because the zfs modules are builtin, we really don't need busybox and the whole # mkinitrd package. All we need to do is mount the zfs that is already imported # because the zpool.cache is present in rootfs when the zfs module initializes, and # then we do the switch root procedure to boot up on the mounted system. # udevd rules will still be run when the root system starts udevd. # So, let's make a simple /init c program that will be all that we really need: cat > init.c <<"EOF" /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_INIT_VERSION "1.0.1" #define _BSD_SOURCE #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* Your initramfs-source should contain the following * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 */ int main(int argc, char* argv[]) { /***** variables * */ int i; FILE* kmsg = NULL; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; int usage = EX_OK; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; }; struct nv param[] = { { "root=", NULL, NULL, 1 }, /* required; root device to boot */ { "rootfstype=", NULL, NULL, 1 }, /* required; root filesystem type */ { "mountopt=", NULL, NULL, 0 }, /* optional; mount option ro or rw; default ro */ { "init=", NULL, NULL, 0 }, /* optional; alt. init prgm; default /sbin/init */ { "runlevel=", NULL, NULL, 0 }, /* optional; runlevel 0123456Ss; default 3 multiuser */ { "console=", NULL, NULL, 0 } /* optional; alt. console; e.g. ttyS0 */ }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, ilastparam }; /***** program * */ kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { fprintf(kmsg, "Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc before dev since some devices * symlink into proc */ fprintf(kmsg, "Attempting mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount proc successful.\n"); } /* mount devtmpfs as expected by an init program * and maybe required to mount zfs */ fprintf(kmsg, "Attempting mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount devtmpfs successful.\n"); } /* it is assumed that all required devices are in devtmpfs * and if not, there will be boot problems * * if you need a more complex device setup, then you might need * udevd and run it with a larger full initrd package from your distro */ /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { fprintf(kmsg, "Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } fprintf(kmsg, "Kernel cmdline size: %i\n", cmdline_size); fprintf(kmsg, "Kernel cmdline: \"%s\"\n", cmdline); for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { fprintf(kmsg, "Kernel parameter %s: value missing.\n", param[i].n); } else param[i].v_end = temp_end; } } /* set defaults on non-required params, except for console */ if( param[imountopt].v == NULL ) param[imountopt].v = "ro"; if( param[iinit].v == NULL ) param[iinit].v = "/sbin/init"; if( param[irunlevel].v == NULL ) param[irunlevel].v = "3"; for( i=iroot; i<ilastparam; i++ ) { if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; fprintf(kmsg, "Using %s \"%s\"\n", param[i].n, param[i].v); } for( i=iroot; i<ilastparam; i++ ) { if( (param[i].req == 1) && (param[i].v == NULL) ) { printf("Error: missing required kernel parameter: %s\n", param[i].n); usage = EX_USAGE; } } if( usage != EX_OK ) { printf("Aborting boot process. Missing required kernel parameter(s).\n"); return usage; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[iroot]: nothing to do, if user put bad device in then we fail */ /* param[irootfstype]: can be checked against /proc/filesystems: */ /* required, so should have value */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { fprintf(kmsg, "Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { fprintf(kmsg, "%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else fprintf(kmsg, "%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else fprintf(kmsg, "%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { fprintf(kmsg, "% \"%\": invalid parameter value;\n" " use \"ro\" or \"rw\" (no quotes or spaces);\n" " defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v ); mountflags = MS_RDONLY; } fprintf(kmsg, "Attempting %s %s mount %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "%s mounted successfully.\n", param[iroot].v); fprintf(kmsg, "Attempting mount --move /dev /mnt/dev\n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount --move /proc /mnt/proc\n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Beginning switch root procedure.\n"); fprintf(kmsg, "Attempting chdir from / to /mnt\n"); if( chdir("/mnt") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move . to /\n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chroot to .\n"); if( chroot(".") != 0 ) { fprintf(kmsg, "time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chdir to /\n"); if( chdir("/") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].v != NULL ) { fprintf(kmsg, "Console redirection to device %s requested.\n", param[iconsole].v); fprintf(kmsg, "Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); /* expect only basename of device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); chdir("/"); } fprintf(kmsg, "Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ fclose(kmsg); free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "time to panic: execl: %s\n", strerror(errno)); fclose(kmsg); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root ro rootfstype=zfs rootwait " lilo reboot </pre> Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notes on the spl and zfs packages to install: If you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevels "s1" (ttyS0) and "s2" (ttyS1) for serial console login support: <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 runlevel=s1 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). When you are in qemu's serial graphics mode, the interface is a little different than in the normal graphical SQL-based mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console of booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.com used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! b06632810720a919f16a0d15ec2521e5454af9d9 748 747 2012-08-24T02:57:16Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate installation from the fully modular and working system. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS ### prepare contents of initramfs cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 # this should be enough device nodes initially # once devtmpfs mounts over /dev, a lot more is available in it by default cat > /init <<"EOF" <some initial program PID=1 for the system to start on> EOF # an initramfs-source/init program is required to mount and boot a root linux system # the common way to make /init is using busybox with files like this: # /bin/busybox # /bin/ash -> busybox # /bin/sh -> busybox # # run busybox to see what other "applets" can be symlinked to it # # when busybox is run as a different symlinked applet name, it runs the applet # /init # # init is ash script, see slackware's /boot/initrd-tree/init for example # Inside this script: # 1) parse kernel parameters passed into it and set variables based on them # 2) start udevd and trigger rules for block devices to setup initial /dev devices # 3) load kernel modules and keyboard map # 4) run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices # (any udev rules for them should do more /dev setup in the background) # 5) mount the root filesystem read-only at /mnt # 6) stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh # 7) shutdown udevd so it can be restarted by root system when booted # 8) mount --move {proc,sys,run,dev} to under /mnt # 9) run: exec switch_root /mnt /sbin/init $RUNLEVEL # The slackware mkinitrd package is fully configured busybox installation # for an extern file initramfs initrd.gz image outside the kernel. # It could be changed to be inside the kernel easily by just using initrd-tree # as target of INITRAMFS_SOURCE in the kernel config and removing initrd in lilo. # Because the zfs modules are builtin, we really don't need busybox and the whole # mkinitrd package. All we need to do is mount the zfs that is already imported # because the zpool.cache is present in rootfs when the zfs module initializes, and # then we do the switch root procedure to boot up on the mounted system. # udevd rules will still be run when the root system starts udevd. # So, let's make a simple /init c program that will be all that we really need: cat > init.c <<"EOF" /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_INIT_VERSION "1.0.1" #define _BSD_SOURCE #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* Your initramfs-source should contain the following * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 */ int main(int argc, char* argv[]) { /***** variables * */ int i; FILE* kmsg = NULL; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; int usage = EX_OK; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; }; struct nv param[] = { { "root=", NULL, NULL, 1 }, /* required; root device to boot */ { "rootfstype=", NULL, NULL, 1 }, /* required; root filesystem type */ { "mountopt=", NULL, NULL, 0 }, /* optional; mount option ro or rw; default ro */ { "init=", NULL, NULL, 0 }, /* optional; alt. init prgm; default /sbin/init */ { "runlevel=", NULL, NULL, 0 }, /* optional; runlevel 0123456Ss; default 3 multiuser */ { "console=", NULL, NULL, 0 } /* optional; alt. console; e.g. ttyS0 */ }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, ilastparam }; /***** program * */ kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { fprintf(kmsg, "Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc before dev since some devices * symlink into proc */ fprintf(kmsg, "Attempting mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount proc successful.\n"); } /* mount devtmpfs as expected by an init program * and maybe required to mount zfs */ fprintf(kmsg, "Attempting mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount devtmpfs successful.\n"); } /* it is assumed that all required devices are in devtmpfs * and if not, there will be boot problems * * if you need a more complex device setup, then you might need * udevd and run it with a larger full initrd package from your distro */ /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { fprintf(kmsg, "Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } fprintf(kmsg, "Kernel cmdline size: %i\n", cmdline_size); fprintf(kmsg, "Kernel cmdline: \"%s\"\n", cmdline); for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { fprintf(kmsg, "Kernel parameter %s: value missing.\n", param[i].n); } else param[i].v_end = temp_end; } } /* set defaults on non-required params, except for console */ if( param[imountopt].v == NULL ) param[imountopt].v = "ro"; if( param[iinit].v == NULL ) param[iinit].v = "/sbin/init"; if( param[irunlevel].v == NULL ) param[irunlevel].v = "3"; for( i=iroot; i<ilastparam; i++ ) { if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; fprintf(kmsg, "Using %s \"%s\"\n", param[i].n, param[i].v); } for( i=iroot; i<ilastparam; i++ ) { if( (param[i].req == 1) && (param[i].v == NULL) ) { printf("Error: missing required kernel parameter: %s\n", param[i].n); usage = EX_USAGE; } } if( usage != EX_OK ) { printf("Aborting boot process. Missing required kernel parameter(s).\n"); return usage; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[iroot]: nothing to do, if user put bad device in then we fail */ /* param[irootfstype]: can be checked against /proc/filesystems: */ /* required, so should have value */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { fprintf(kmsg, "Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { fprintf(kmsg, "%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else fprintf(kmsg, "%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else fprintf(kmsg, "%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { fprintf(kmsg, "% \"%\": invalid parameter value;\n" " use \"ro\" or \"rw\" (no quotes or spaces);\n" " defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v ); mountflags = MS_RDONLY; } fprintf(kmsg, "Attempting %s %s mount %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "%s mounted successfully.\n", param[iroot].v); fprintf(kmsg, "Attempting mount --move /dev /mnt/dev\n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount --move /proc /mnt/proc\n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Beginning switch root procedure.\n"); fprintf(kmsg, "Attempting chdir from / to /mnt\n"); if( chdir("/mnt") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move . to /\n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chroot to .\n"); if( chroot(".") != 0 ) { fprintf(kmsg, "time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chdir to /\n"); if( chdir("/") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].v != NULL ) { fprintf(kmsg, "Console redirection to device %s requested.\n", param[iconsole].v); fprintf(kmsg, "Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); /* expect only basename of device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); chdir("/"); } fprintf(kmsg, "Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ fclose(kmsg); free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "time to panic: execl: %s\n", strerror(errno)); fclose(kmsg); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root ro rootfstype=zfs rootwait " lilo reboot </pre> Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notes on the spl and zfs packages to install: If you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevels "s1" (ttyS0) and "s2" (ttyS1) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 runlevel=s1 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). When you are in qemu's serial graphics mode, the interface is a little different than in the normal graphical SQL-based mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console of booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.com used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 098b3e6a225c78d5801ef89dd0dfb8f348b901e0 749 748 2012-08-24T03:32:59Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate installation from the fully modular and working system. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS ### prepare contents of initramfs cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 # this should be enough device nodes initially # once devtmpfs mounts over /dev, a lot more is available in it by default cat > /init <<"EOF" <some initial program PID=1 for the system to start on> EOF # an initramfs-source/init program is required to mount and boot a root linux system # the common way to make /init is using busybox with files like this: # /bin/busybox # /bin/ash -> busybox # /bin/sh -> busybox # # run busybox to see what other "applets" can be symlinked to it # # when busybox is run as a different symlinked applet name, it runs the applet # /init # # init is ash script, see slackware's /boot/initrd-tree/init for example # Inside this script: # 1) parse kernel parameters passed into it and set variables based on them # 2) start udevd and trigger rules for block devices to setup initial /dev devices # 3) load kernel modules and keyboard map # 4) run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices # (any udev rules for them should do more /dev setup in the background) # 5) mount the root filesystem read-only at /mnt # 6) stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh # 7) shutdown udevd so it can be restarted by root system when booted # 8) mount --move {proc,sys,run,dev} to under /mnt # 9) run: exec switch_root /mnt /sbin/init $RUNLEVEL # The slackware mkinitrd package is fully configured busybox installation # for an extern file initramfs initrd.gz image outside the kernel. # It could be changed to be inside the kernel easily by just using initrd-tree # as target of INITRAMFS_SOURCE in the kernel config and removing initrd in lilo. # Because the zfs modules are builtin, we really don't need busybox and the whole # mkinitrd package. All we need to do is mount the zfs that is already imported # because the zpool.cache is present in rootfs when the zfs module initializes, and # then we do the switch root procedure to boot up on the mounted system. # udevd rules will still be run when the root system starts udevd. # So, let's make a simple /init c program that will be all that we really need: cat > init.c <<"EOF" /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_INIT_VERSION "1.0.1" #define _BSD_SOURCE #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* Your initramfs-source should contain the following * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 */ int main(int argc, char* argv[]) { /***** variables * */ int i; FILE* kmsg = NULL; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; int usage = EX_OK; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; }; struct nv param[] = { { "root=", NULL, NULL, 1 }, /* required; root device to boot */ { "rootfstype=", NULL, NULL, 1 }, /* required; root filesystem type */ { "mountopt=", NULL, NULL, 0 }, /* optional; mount option ro or rw; default ro */ { "init=", NULL, NULL, 0 }, /* optional; alt. init prgm; default /sbin/init */ { "runlevel=", NULL, NULL, 0 }, /* optional; runlevel 0123456Ss; default 3 multiuser */ { "console=", NULL, NULL, 0 } /* optional; alt. console; e.g. ttyS0 */ }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, ilastparam }; /***** program * */ kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { fprintf(kmsg, "Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc before dev since some devices * symlink into proc */ fprintf(kmsg, "Attempting mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount proc successful.\n"); } /* mount devtmpfs as expected by an init program * and maybe required to mount zfs */ fprintf(kmsg, "Attempting mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount devtmpfs successful.\n"); } /* it is assumed that all required devices are in devtmpfs * and if not, there will be boot problems * * if you need a more complex device setup, then you might need * udevd and run it with a larger full initrd package from your distro */ /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { fprintf(kmsg, "Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } fprintf(kmsg, "Kernel cmdline size: %i\n", cmdline_size); fprintf(kmsg, "Kernel cmdline: \"%s\"\n", cmdline); for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { fprintf(kmsg, "Kernel parameter %s: value missing.\n", param[i].n); } else param[i].v_end = temp_end; } } /* set defaults on non-required params, except for console */ if( param[imountopt].v == NULL ) param[imountopt].v = "ro"; if( param[iinit].v == NULL ) param[iinit].v = "/sbin/init"; if( param[irunlevel].v == NULL ) param[irunlevel].v = "3"; for( i=iroot; i<ilastparam; i++ ) { if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; fprintf(kmsg, "Using %s \"%s\"\n", param[i].n, param[i].v); } for( i=iroot; i<ilastparam; i++ ) { if( (param[i].req == 1) && (param[i].v == NULL) ) { printf("Error: missing required kernel parameter: %s\n", param[i].n); usage = EX_USAGE; } } if( usage != EX_OK ) { printf("Aborting boot process. Missing required kernel parameter(s).\n"); return usage; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[iroot]: nothing to do, if user put bad device in then we fail */ /* param[irootfstype]: can be checked against /proc/filesystems: */ /* required, so should have value */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { fprintf(kmsg, "Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { fprintf(kmsg, "%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else fprintf(kmsg, "%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else fprintf(kmsg, "%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { fprintf(kmsg, "% \"%\": invalid parameter value;\n" " use \"ro\" or \"rw\" (no quotes or spaces);\n" " defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v ); mountflags = MS_RDONLY; } fprintf(kmsg, "Attempting %s %s mount %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "%s mounted successfully.\n", param[iroot].v); fprintf(kmsg, "Attempting mount --move /dev /mnt/dev\n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount --move /proc /mnt/proc\n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Beginning switch root procedure.\n"); fprintf(kmsg, "Attempting chdir from / to /mnt\n"); if( chdir("/mnt") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move . to /\n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chroot to .\n"); if( chroot(".") != 0 ) { fprintf(kmsg, "time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chdir to /\n"); if( chdir("/") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].v != NULL ) { fprintf(kmsg, "Console redirection to device %s requested.\n", param[iconsole].v); fprintf(kmsg, "Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); /* expect only basename of device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); chdir("/"); } fprintf(kmsg, "Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ fclose(kmsg); free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "time to panic: execl: %s\n", strerror(errno)); fclose(kmsg); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root ro rootfstype=zfs rootwait " lilo reboot </pre> Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notes on the spl and zfs packages to install: If you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 runlevel=s1 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). When you are in qemu's serial graphics mode, the interface is a little different than in the normal graphical SQL-based mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console of booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.com used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! f373dab8816d9958fa2938c422533b79514fbf48 750 749 2012-08-24T03:38:08Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate installation from the fully modular and working system. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS ### prepare contents of initramfs cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 # this should be enough device nodes initially # once devtmpfs mounts over /dev, a lot more is available in it by default cat > /init <<"EOF" <some initial program PID=1 for the system to start on> EOF # an initramfs-source/init program is required to mount and boot a root linux system # the common way to make /init is using busybox with files like this: # /bin/busybox # /bin/ash -> busybox # /bin/sh -> busybox # # run busybox to see what other "applets" can be symlinked to it # # when busybox is run as a different symlinked applet name, it runs the applet # /init # # init is ash script, see slackware's /boot/initrd-tree/init for example # Inside this script: # 1) parse kernel parameters passed into it and set variables based on them # 2) start udevd and trigger rules for block devices to setup initial /dev devices # 3) load kernel modules and keyboard map # 4) run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices # (any udev rules for them should do more /dev setup in the background) # 5) mount the root filesystem read-only at /mnt # 6) stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh # 7) shutdown udevd so it can be restarted by root system when booted # 8) mount --move {proc,sys,run,dev} to under /mnt # 9) run: exec switch_root /mnt /sbin/init $RUNLEVEL # The slackware mkinitrd package is fully configured busybox installation # for an extern file initramfs initrd.gz image outside the kernel. # It could be changed to be inside the kernel easily by just using initrd-tree # as target of INITRAMFS_SOURCE in the kernel config and removing initrd in lilo. # Because the zfs modules are builtin, we really don't need busybox and the whole # mkinitrd package. All we need to do is mount the zfs that is already imported # because the zpool.cache is present in rootfs when the zfs module initializes, and # then we do the switch root procedure to boot up on the mounted system. # udevd rules will still be run when the root system starts udevd. # So, let's make a simple /init c program that will be all that we really need: cat > init.c <<"EOF" /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_INIT_VERSION "1.0.1" #define _BSD_SOURCE #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* Your initramfs-source should contain the following * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 */ int main(int argc, char* argv[]) { /***** variables * */ int i; FILE* kmsg = NULL; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; int usage = EX_OK; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; }; struct nv param[] = { { "root=", NULL, NULL, 1 }, /* required; root device to boot */ { "rootfstype=", NULL, NULL, 1 }, /* required; root filesystem type */ { "mountopt=", NULL, NULL, 0 }, /* optional; mount option ro or rw; default ro */ { "init=", NULL, NULL, 0 }, /* optional; alt. init prgm; default /sbin/init */ { "runlevel=", NULL, NULL, 0 }, /* optional; runlevel 0123456Ss; default 3 multiuser */ { "console=", NULL, NULL, 0 } /* optional; alt. console; e.g. ttyS0 */ }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, ilastparam }; /***** program * */ kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { fprintf(kmsg, "Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc before dev since some devices * symlink into proc */ fprintf(kmsg, "Attempting mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount proc successful.\n"); } /* mount devtmpfs as expected by an init program * and maybe required to mount zfs */ fprintf(kmsg, "Attempting mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { fprintf(kmsg, "Mount devtmpfs successful.\n"); } /* it is assumed that all required devices are in devtmpfs * and if not, there will be boot problems * * if you need a more complex device setup, then you might need * udevd and run it with a larger full initrd package from your distro */ /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { fprintf(kmsg, "Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } fprintf(kmsg, "Kernel cmdline size: %i\n", cmdline_size); fprintf(kmsg, "Kernel cmdline: \"%s\"\n", cmdline); for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { fprintf(kmsg, "Kernel parameter %s: value missing.\n", param[i].n); } else param[i].v_end = temp_end; } } /* set defaults on non-required params, except for console */ if( param[imountopt].v == NULL ) param[imountopt].v = "ro"; if( param[iinit].v == NULL ) param[iinit].v = "/sbin/init"; if( param[irunlevel].v == NULL ) param[irunlevel].v = "3"; for( i=iroot; i<ilastparam; i++ ) { if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; fprintf(kmsg, "Using %s \"%s\"\n", param[i].n, param[i].v); } for( i=iroot; i<ilastparam; i++ ) { if( (param[i].req == 1) && (param[i].v == NULL) ) { printf("Error: missing required kernel parameter: %s\n", param[i].n); usage = EX_USAGE; } } if( usage != EX_OK ) { printf("Aborting boot process. Missing required kernel parameter(s).\n"); return usage; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[iroot]: nothing to do, if user put bad device in then we fail */ /* param[irootfstype]: can be checked against /proc/filesystems: */ /* required, so should have value */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { fprintf(kmsg, "Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { fprintf(kmsg, "Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { fprintf(kmsg, "%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else fprintf(kmsg, "%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) fprintf(kmsg, "%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else fprintf(kmsg, "%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { fprintf(kmsg, "% \"%\": invalid parameter value;\n" " use \"ro\" or \"rw\" (no quotes or spaces);\n" " defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v ); mountflags = MS_RDONLY; } fprintf(kmsg, "Attempting %s %s mount %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "%s mounted successfully.\n", param[iroot].v); fprintf(kmsg, "Attempting mount --move /dev /mnt/dev\n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount --move /proc /mnt/proc\n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Beginning switch root procedure.\n"); fprintf(kmsg, "Attempting chdir from / to /mnt\n"); if( chdir("/mnt") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting mount-move . to /\n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { fprintf(kmsg, "time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chroot to .\n"); if( chroot(".") != 0 ) { fprintf(kmsg, "time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Attempting chdir to /\n"); if( chdir("/") != 0 ) { fprintf(kmsg, "time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } fprintf(kmsg, "Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].v != NULL ) { fprintf(kmsg, "Console redirection to device %s requested.\n", param[iconsole].v); fprintf(kmsg, "Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); /* expect only basename of device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); chdir("/"); } fprintf(kmsg, "Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ fclose(kmsg); free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { kmsg = fopen("/dev/kmsg", "w"); fprintf(kmsg, "time to panic: execl: %s\n", strerror(errno)); fclose(kmsg); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root ro rootfstype=zfs rootwait " lilo reboot </pre> Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notes on the spl and zfs packages to install: If you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial graphics mode, the interface is a little different than in the normal graphical SQL-based mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console of booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.com used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 06380536e60bdc978c2803cb8b50dbe78ca2dba4 751 750 2012-08-24T11:42:16Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate installation from the fully modular and working system. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS ### prepare contents of initramfs cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 # this should be enough device nodes initially # once devtmpfs mounts over /dev, a lot more is available in it by default cat > /init <<"EOF" <some initial program PID=1 for the system to start on> EOF # an initramfs-source/init program is required to mount and boot a root linux system # the common way to make /init is using busybox with files like this: # /bin/busybox # /bin/ash -> busybox # /bin/sh -> busybox # # run busybox to see what other "applets" can be symlinked to it # # when busybox is run as a different symlinked applet name, it runs the applet # /init # # init is ash script, see slackware's /boot/initrd-tree/init for example # Inside this script: # 1) parse kernel parameters passed into it and set variables based on them # 2) start udevd and trigger rules for block devices to setup initial /dev devices # 3) load kernel modules and keyboard map # 4) run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices # (any udev rules for them should do more /dev setup in the background) # 5) mount the root filesystem read-only at /mnt # 6) stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh # 7) shutdown udevd so it can be restarted by root system when booted # 8) mount --move {proc,sys,run,dev} to under /mnt # 9) run: exec switch_root /mnt /sbin/init $RUNLEVEL # The slackware mkinitrd package is fully configured busybox installation # for an extern file initramfs initrd.gz image outside the kernel. # It could be changed to be inside the kernel easily by just using initrd-tree # as target of INITRAMFS_SOURCE in the kernel config and removing initrd in lilo. # Because the zfs modules are builtin, we really don't need busybox and the whole # mkinitrd package. All we need to do is mount the zfs that is already imported # because the zpool.cache is present in rootfs when the zfs module initializes, and # then we do the switch root procedure to boot up on the mounted system. # udevd rules will still be run when the root system starts udevd. # So, let's make a simple /init c program that will be all that we really need: cat > init.c <<"EOF" /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_INIT_VERSION "1.0.8" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_LOCAL 1 /* Your initramfs-source should contain the following * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 */ void printk(char *fmt, ...) { FILE* f; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); usleep(50000); } int main(int argc, char* argv[]) { /***** variables * */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or local */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, ilastparam }; /***** program * */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc before dev since some devices * symlink into proc */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs as expected by an init program * and maybe required to mount zfs */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* it is assumed that all required devices are in devtmpfs * and if not, there will be boot problems * * if you need a more complex device setup, then you might need * udevd and run it with a larger full initrd package from your distro */ /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_LOCAL; /* value src: local */ while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; /* value src: default */ if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = ""; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[iroot]: nothing to do, if user put bad device in then we fail */ /* param[irootfstype]: can be checked against /proc/filesystems: */ /* required, so should have value */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_LOCAL ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root ro rootfstype=zfs rootwait " lilo reboot </pre> Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notes on the spl and zfs packages to install: If you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial graphics mode, the interface is a little different than in the normal graphical SQL-based mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console of booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.com used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 74622532a00318a0c865955f0d196a25d04d8ffe 752 751 2012-08-25T15:02:03Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate installation from the fully modular and working system. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS ### prepare contents of initramfs cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 # this should be enough device nodes initially # once devtmpfs mounts over /dev, a lot more is available in it by default cat > /init <<"EOF" <some initial program PID=1 for the system to start on> EOF # an initramfs-source/init program is required to mount and boot a root linux system # the common way to make /init is using busybox with files like this: # /bin/busybox # /bin/ash -> busybox # /bin/sh -> busybox # # run busybox to see what other "applets" can be symlinked to it # # when busybox is run as a different symlinked applet name, it runs the applet # /init # # init is ash script, see slackware's /boot/initrd-tree/init for example # Inside this script: # 1) parse kernel parameters passed into it and set variables based on them # 2) start udevd and trigger rules for block devices to setup initial /dev devices # 3) load kernel modules and keyboard map # 4) run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices # (any udev rules for them should do more /dev setup in the background) # 5) mount the root filesystem read-only at /mnt # 6) stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh # 7) shutdown udevd so it can be restarted by root system when booted # 8) mount --move {proc,sys,run,dev} to under /mnt # 9) run: exec switch_root /mnt /sbin/init $RUNLEVEL # The slackware mkinitrd package is fully configured busybox installation # for an extern file initramfs initrd.gz image outside the kernel. # It could be changed to be inside the kernel easily by just using initrd-tree # as target of INITRAMFS_SOURCE in the kernel config and removing initrd in lilo. # Because the zfs modules are builtin, we really don't need busybox and the whole # mkinitrd package. All we need to do is mount the zfs that is already imported # because the zpool.cache is present in rootfs when the zfs module initializes, and # then we do the switch root procedure to boot up on the mounted system. # udevd rules will still be run when the root system starts udevd. # So, let's make a simple /init c program that will be all that we really need: cat > init.c <<"EOF" /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_INIT_VERSION "1.0.9" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 /* Your initramfs-source should contain the following * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 */ void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, ilastparam }; /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = ""; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific informative checks */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink("/init") != 0 ) printk("unlink %s: %s\n", "/init", strerror(errno)); else printk("/init %s", "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root ro rootfstype=zfs rootwait " lilo reboot </pre> Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notes on the spl and zfs packages to install: If you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console of booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.com used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 49f20524bd97095566011150cf01077535bb96ef 779 752 2012-09-03T18:33:43Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command zpool set bootfs=zfs-root zfs-root # this may help, but not really sure mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS ### prepare contents of initramfs cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 # this should be enough device nodes initially # once devtmpfs mounts over /dev, a lot more is available in it by default cat > /init <<"EOF" <some initial program PID=1 for the system to start on> EOF # an initramfs-source/init program is required to mount and boot a root linux system # the common way to make /init is using busybox with files like this: # /bin/busybox # /bin/ash -> busybox # /bin/sh -> busybox # # run busybox to see what other "applets" can be symlinked to it # # when busybox is run as a different symlinked applet name, it runs the applet # /init # # init is ash script, see slackware's /boot/initrd-tree/init for example # Inside this script: # 1) parse kernel parameters passed into it and set variables based on them # 2) start udevd and trigger rules for block devices to setup initial /dev devices # 3) load kernel modules and keyboard map # 4) run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices # (any udev rules for them should do more /dev setup in the background) # 5) mount the root filesystem read-only at /mnt # 6) stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh # 7) shutdown udevd so it can be restarted by root system when booted # 8) mount --move {proc,sys,run,dev} to under /mnt # 9) run: exec switch_root /mnt /sbin/init $RUNLEVEL # The slackware mkinitrd package is fully configured busybox installation # for an extern file initramfs initrd.gz image outside the kernel. # It could be changed to be inside the kernel easily by just using initrd-tree # as target of INITRAMFS_SOURCE in the kernel config and removing initrd in lilo. # Because the zfs modules are builtin, we really don't need busybox and the whole # mkinitrd package. All we need to do is mount the zfs that is already imported # because the zpool.cache is present in rootfs when the zfs module initializes, and # then we do the switch root procedure to boot up on the mounted system. # udevd rules will still be run when the root system starts udevd. # So, let's make a simple /init c program that will be all that we really need: cat > init.c <<"EOF" /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_INIT_VERSION "1.0.10rc1" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 /* Your initramfs-source should contain the following * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 */ void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, ilastparam }; /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = ""; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific informative checks */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notes on the spl and zfs packages to install: If you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console of booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! c9beae8be04d64677d1e75ee24ac3b06e3dd9f11 Talk:Install Slackware Using A USB Flash Drive 1 292 753 2012-08-28T06:50:37Z Sapta 301 Created page with "Hi, I'm new to slackware. I tried installing it as given in the wiki page. But ran into trouble in the last stage. First of all, fdisk -l shows sdb - 16 gb(usb size), sdb1 (..." wikitext text/x-wiki Hi, I'm new to slackware. I tried installing it as given in the wiki page. But ran into trouble in the last stage. First of all, fdisk -l shows sdb - 16 gb(usb size), sdb1 (4 gb) and sdb1p1 (similar size). What is sdb1p1? Which one do I mount? I decided to mount sdb1. After mounting and running setup, I set up the targets \home, \usr etc. Then it says it has detected FAT/NTFS filesystem (the usb in all probability) and if I want to add that to fstab. I tried different things here. Since the usb is already mounted, I first tried answering no and going to install. Later I tried mounting sdb1 in flash at this step again and then running install. In both cases, when I select "install from hard disk partition" and select source partition as "/dev/sdb1" and then source path as "/slackware" or "/flash/slackware" or "slackware", it says "error mounting, should I continue". I tried using install option "pre-mounted directory" and gave "/flash/slackware" as the directory but it couldn't find the directory. What am I doing wrong? e58af921ae4d1cb842400f92373e4bbc7966acb6 X Windows: Remote X to Windows with Xming 0 293 754 2012-08-29T15:12:05Z Arfon 70 CREATED! wikitext text/x-wiki 1) Install Xming '''and''' Xming-fonts * Download from sourceforge.net/projects/xming[http://sourceforge.net/projects/xming/] 2) Add the Linux machine's DNS name(s) and IP address to the C:\Program Files\xming\X0.hosts file. File should contain: LinuxBox.mydomain.com LinuxBox 192.168.1.25 3) Start Xming on your Windows machine '''(NOT XLaunch)''' 4) Start the connection: Connect to the Linux machine via ssh/telnet/rlogin/whatever and run: DISPLAY=WINDOWS_IP:0;export DISPLAY;APPLICATION_YOU_WANT_TO_RUN EXAMPLE: DISPLAY=192.168.1.10:0;export DISPLAY;xterm Minimize the telnet session, do not close it. If you close it, your OV connection will close. ---- '''PROBLEMS''' '''PROBLEM:''' "Xlib: connection to YOUR_IP refused by server"<br> '''FIX:''' Check the Xming log, it probably contains "Xming.exe: client 4 rejected from IP YOUR_IP". If so, * close Xming * Make sure that the DNS names and/or IPs are in the C:\Program Files\xming\X0.hosts file * restart Xming '''FIX2:''' If problem is not fixed, restart Xming with the -ac option.<br> '''PROBLEM:''' Map starts but then I get a font error from OpenView.<br> '''FIX:''' Install the Xming-fonts onto your Windows box.<br> '''PROBLEM:''' When starting Xming, a Windows Security Alert pops up saying Windows Firewall has blocked this program.<br> '''FIX:''' Change Windows Firewall setting to allow Xming.<br> '''FIX2:''' Disable Windows Firewall by going to Services, setting Windows Firewall to MANUAL START and then stop the service.<br> '''PROBLEM:''' Cannot connect to Xming and I have checked all of the above.<br> '''FIX:''' When starting Xming as display 0, Windows Firewall does not complain. Check to see if Windows Firewall is blocking the connection.<br> 7e0be231816b95339aa1de14e80a445bf4f28855 755 754 2012-08-29T15:14:36Z Arfon 70 FIXED: typo wikitext text/x-wiki 1) Install Xming '''and''' Xming-fonts * Download from sourceforge.net/projects/xming[http://sourceforge.net/projects/xming/] 2) Add the Linux machine's DNS name(s) and IP address to the C:\Program Files\xming\X0.hosts file. File should contain: LinuxBox.mydomain.com LinuxBox 192.168.1.25 3) Start Xming on your Windows machine '''(NOT XLaunch)''' 4) Start the connection: Connect to the Linux machine via ssh/telnet/rlogin/whatever and run: DISPLAY=WINDOWS_IP:0;export DISPLAY;APPLICATION_YOU_WANT_TO_RUN EXAMPLE: DISPLAY=192.168.1.10:0;export DISPLAY;xterm 5) Minimize the telnet session, do not close it. If you close it, your X connections will close.<br> <br> <br> ---- '''PROBLEMS''' '''PROBLEM:''' "Xlib: connection to YOUR_IP refused by server"<br> '''FIX:''' Check the Xming log, it probably contains "Xming.exe: client 4 rejected from IP YOUR_IP". If so, * close Xming * Make sure that the DNS names and/or IPs are in the C:\Program Files\xming\X0.hosts file * restart Xming '''FIX2:''' If problem is not fixed, restart Xming with the -ac option.<br> '''PROBLEM:''' The application starts but then I get a font error(s).<br> '''FIX:''' Install the Xming-fonts onto your Windows box.<br> '''PROBLEM:''' When starting Xming, a Windows Security Alert pops up saying Windows Firewall has blocked this program.<br> '''FIX:''' Change Windows Firewall setting to allow Xming.<br> '''FIX2:''' Disable Windows Firewall by going to Services, setting Windows Firewall to MANUAL START and then stop the service.<br> '''PROBLEM:''' Cannot connect to Xming and I have checked all of the above.<br> '''FIX:''' When starting Xming as display 0, Windows Firewall does not complain. Check to see if Windows Firewall is blocking the connection.<br> bb4a9fb611a917dd06f27ccdbe27673f1773255a 756 755 2012-08-29T15:16:15Z Arfon 70 ADDED: Category wikitext text/x-wiki 1) Install Xming '''and''' Xming-fonts * Download from sourceforge.net/projects/xming[http://sourceforge.net/projects/xming/] 2) Add the Linux machine's DNS name(s) and IP address to the C:\Program Files\xming\X0.hosts file. File should contain: LinuxBox.mydomain.com LinuxBox 192.168.1.25 3) Start Xming on your Windows machine '''(NOT XLaunch)''' 4) Start the connection: Connect to the Linux machine via ssh/telnet/rlogin/whatever and run: DISPLAY=WINDOWS_IP:0;export DISPLAY;APPLICATION_YOU_WANT_TO_RUN EXAMPLE: DISPLAY=192.168.1.10:0;export DISPLAY;xterm 5) Minimize the telnet session, do not close it. If you close it, your X connections will close.<br> <br> <br> ---- '''PROBLEMS''' '''PROBLEM:''' "Xlib: connection to YOUR_IP refused by server"<br> '''FIX:''' Check the Xming log, it probably contains "Xming.exe: client 4 rejected from IP YOUR_IP". If so, * close Xming * Make sure that the DNS names and/or IPs are in the C:\Program Files\xming\X0.hosts file * restart Xming '''FIX2:''' If problem is not fixed, restart Xming with the -ac option.<br> '''PROBLEM:''' The application starts but then I get a font error(s).<br> '''FIX:''' Install the Xming-fonts onto your Windows box.<br> '''PROBLEM:''' When starting Xming, a Windows Security Alert pops up saying Windows Firewall has blocked this program.<br> '''FIX:''' Change Windows Firewall setting to allow Xming.<br> '''FIX2:''' Disable Windows Firewall by going to Services, setting Windows Firewall to MANUAL START and then stop the service.<br> '''PROBLEM:''' Cannot connect to Xming and I have checked all of the above.<br> '''FIX:''' When starting Xming as display 0, Windows Firewall does not complain. Check to see if Windows Firewall is blocking the connection.<br> [[Category:Tutorials]] 53be366e3535fee125d6ce95638423c824b47d79 767 756 2012-08-30T13:26:13Z Arfon 70 ADDED: Remote X over SSH wikitext text/x-wiki ===Plain Ol' Vanilla Remote X Session=== 1) Install Xming '''and''' Xming-fonts * Download from sourceforge.net/projects/xming[http://sourceforge.net/projects/xming/] 2) Add the Linux machine's DNS name(s) and IP address to the C:\Program Files\xming\X0.hosts file. File should contain: LinuxBox.mydomain.com LinuxBox 192.168.1.25 3) Start Xming on your Windows machine '''(NOT XLaunch)''' 4) Start the connection: Connect to the Linux machine via ssh/telnet/rlogin/whatever and run: DISPLAY=WINDOWS_IP:0;export DISPLAY;APPLICATION_YOU_WANT_TO_RUN EXAMPLE: DISPLAY=192.168.1.10:0;export DISPLAY;xterm 5) Minimize the telnet session, do not close it. If you close it, your X connections will close.<br> <br> <br> ---- ===Remote X11 Over SSH=== 1) Install Xming '''and''' Xming-fonts * Download from sourceforge.net/projects/xming[http://sourceforge.net/projects/xming/] 2) Add the Linux machine's DNS name(s) and IP address to the C:\Program Files\xming\X0.hosts file. File should contain: LinuxBox.mydomain.com LinuxBox 192.168.1.25 3) Start Xming on your Windows machine '''(NOT XLaunch)''' 4) Install Putty (if it's not already installed). * Download from www.chiark.greenend.org.uk/~sgtatham/putty/ 5) Open putty and fill in the “Host Name” box. 6) Ensure that SSH is checked. 7) Under Category > Connection > SSH > X11 check the “Enable X11 forwarding” box. 8) Click the “Open” button to start the connection. 9) Log into the remote machine as you would do in a normal SSH session. 10) Start the X application from the command line, a window should open on your local machine with the application. (It's a regular SSH session with putty but with X11 forwarding enabled.) ---- ===PROBLEMS=== '''PROBLEM:''' "Xlib: connection to YOUR_IP refused by server"<br> '''FIX:''' Check the Xming log, it probably contains "Xming.exe: client 4 rejected from IP YOUR_IP". If so, * close Xming * Make sure that the DNS names and/or IPs are in the C:\Program Files\xming\X0.hosts file * restart Xming '''FIX2:''' If problem is not fixed, restart Xming with the -ac option.<br> '''PROBLEM:''' The application starts but then I get a font error(s).<br> '''FIX:''' Install the Xming-fonts onto your Windows box.<br> '''PROBLEM:''' When starting Xming, a Windows Security Alert pops up saying Windows Firewall has blocked this program.<br> '''FIX:''' Change Windows Firewall setting to allow Xming.<br> '''FIX2:''' Disable Windows Firewall by going to Services, setting Windows Firewall to MANUAL START and then stop the service.<br> '''PROBLEM:''' Cannot connect to Xming and I have checked all of the above.<br> '''FIX:''' When starting Xming as display 0, Windows Firewall does not complain. Check to see if Windows Firewall is blocking the connection.<br> [[Category:Tutorials]] fecd269b5f8f1214c862a96fd7ffa9379ac1edc9 768 767 2012-08-30T13:40:57Z Arfon 70 ADDED: Enable X11Forwarding to sshd_conf wikitext text/x-wiki ===Plain Ol' Vanilla Remote X Session=== 1) Install Xming '''and''' Xming-fonts * Download from sourceforge.net/projects/xming[http://sourceforge.net/projects/xming/] 2) Add the Linux machine's DNS name(s) and IP address to the C:\Program Files\xming\X0.hosts file. File should contain: LinuxBox.mydomain.com LinuxBox 192.168.1.25 3) Start Xming on your Windows machine '''(NOT XLaunch)''' 4) Start the connection: Connect to the Linux machine via ssh/telnet/rlogin/whatever and run: DISPLAY=WINDOWS_IP:0;export DISPLAY;APPLICATION_YOU_WANT_TO_RUN & EXAMPLE: DISPLAY=192.168.1.10:0;export DISPLAY;xterm & 5) Minimize the SSH/telnet session, do not close it. If you close it, your X connections will close.<br> <br> <br> ---- ===Remote X11 Over SSH=== '''On the remote machine (Linux):'''<br> 1) Ensure that X11Forwarding is enabled in /etc/ssh/sshd_conf on the remote machine. '''On the local machine (Windows):'''<br> 2) Install Xming '''and''' Xming-fonts * Download from sourceforge.net/projects/xming[http://sourceforge.net/projects/xming/] 3) Add the Linux machine's DNS name(s) and IP address to the C:\Program Files\xming\X0.hosts file. File should contain: LinuxBox.mydomain.com LinuxBox 192.168.1.25 4) Start Xming on your Windows machine '''(NOT XLaunch)''' 5) Install Putty (if it's not already installed) onto your Windows machine. * Download from www.chiark.greenend.org.uk/~sgtatham/putty/[http://www.chiark.greenend.org.uk/~sgtatham/putty/] 6) Open putty and fill in the “Host Name” box. 7) Ensure that SSH is checked and that the port is correct (probably 22). 8) Under Category > Connection > SSH > X11 check the “Enable X11 forwarding” box. 9) Click the “Open” button to start the connection. 10) Log into the remote machine as you would do in a normal SSH session. 11) Start the X application from the command line, a window should open on your local machine with the application. 12) Minimize the SSH session, do not close it. If you close it, your X connections will close. (It's a regular SSH session with putty but with X11 forwarding enabled.) ---- ===PROBLEMS=== '''PROBLEM:''' "Xlib: connection to YOUR_IP refused by server"<br> '''FIX:''' Check the Xming log, it probably contains "Xming.exe: client 4 rejected from IP YOUR_IP". If so, * close Xming * Make sure that the DNS names and/or IPs are in the C:\Program Files\xming\X0.hosts file * restart Xming '''FIX2:''' If problem is not fixed, restart Xming with the -ac option.<br> '''PROBLEM:''' The application starts but then I get a font error(s).<br> '''FIX:''' Install the Xming-fonts onto your Windows box.<br> '''PROBLEM:''' When starting Xming, a Windows Security Alert pops up saying Windows Firewall has blocked this program.<br> '''FIX:''' Change Windows Firewall setting to allow Xming.<br> '''FIX2:''' Disable Windows Firewall by going to Services, setting Windows Firewall to MANUAL START and then stop the service.<br> '''PROBLEM:''' Cannot connect to Xming and I have checked all of the above.<br> '''FIX:''' When starting Xming as display 0, Windows Firewall does not complain. Check to see if Windows Firewall is blocking the connection.<br> [[Category:Tutorials]] fa1e51c63492a43c790198d98c1d625f663c57fe DHCP Server: DNSMasq 0 294 757 2012-08-29T16:07:31Z Arfon 70 CREATED! wikitext text/x-wiki Written from a Slackware 13.37 perspective. To set up a DHCP server you can use the dchp package that is included with Slackware OR you can do it the easier way and use DNSMasq (also included with Slackware). '''Assuming that you do not have DNSMasq installed''' 1) Install the official dnsmasq Slackware package either by pkgtool oe slackpkg. 2) Make DNSMasq start on boot: CHMOD 755 /etc/rc.d/rc.dnsmasq At this point you will have a really cool little DNS on your box... '''If you already had DNSMasq running on your box, start here''' 1) edit the /etc/dnsmasq.conf file: CHANGE: #dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h TO: dhcp-range=192.168.1.200,192.168.1.239,12h (using your correct IP range) 2) start/restart DNSMasq /etc/rc.d/rc.dnsmasq restart You should now have a working DCHP server. ---- '''Persistent IPs''' To assign IPs based on a device's MAC address, edit /etc/dnsmasq.conf and add the following line for every device (using the correct MAC and IP of course): dhcp-host=11:22:33:44:55:66,192.168.1.61 '''NOTE:''' The IP address should be OUTSIDE the DHCP pool. 5c7c0248f48f15326855a44a3e7cb8b18f3665f8 758 757 2012-08-29T16:08:37Z Arfon 70 ADDED: Category wikitext text/x-wiki Written from a Slackware 13.37 perspective. To set up a DHCP server you can use the dchp package that is included with Slackware OR you can do it the easier way and use DNSMasq (also included with Slackware). '''Assuming that you do not have DNSMasq installed''' 1) Install the official dnsmasq Slackware package either by pkgtool oe slackpkg. 2) Make DNSMasq start on boot: CHMOD 755 /etc/rc.d/rc.dnsmasq At this point you will have a really cool little DNS on your box... '''If you already had DNSMasq running on your box, start here''' 1) edit the /etc/dnsmasq.conf file: CHANGE: #dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h TO: dhcp-range=192.168.1.200,192.168.1.239,12h (using your correct IP range) 2) start/restart DNSMasq /etc/rc.d/rc.dnsmasq restart You should now have a working DCHP server. ---- '''Persistent IPs''' To assign IPs based on a device's MAC address, edit /etc/dnsmasq.conf and add the following line for every device (using the correct MAC and IP of course): dhcp-host=11:22:33:44:55:66,192.168.1.61 '''NOTE:''' The IP address should be OUTSIDE the DHCP pool. [[Category: Tutorials]] 9829dc95f23aec296fc8a935713fc5bcb63d7eab 760 758 2012-08-29T16:18:08Z Arfon 70 FIXED: typo wikitext text/x-wiki Written from a Slackware 13.37 perspective. To set up a DHCP server you can use the dchp package (that is included with Slackware)<br> '''or'''<br> you can do it the easier way and use DNSMasq (also included with Slackware). '''Assuming that you do not have DNSMasq installed''' 1) Install the official dnsmasq Slackware package either by pkgtool or slackpkg. 2) Make DNSMasq start on boot: CHMOD 755 /etc/rc.d/rc.dnsmasq At this point you will have a really cool little DNS on your box... '''If you already had DNSMasq running on your box, start here''' 1) edit the /etc/dnsmasq.conf file: CHANGE: #dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h TO: dhcp-range=1ST_POOL_IP,LAST_POOL_IP,12h (using your correct IP range) 1a) If your DNSMasq box isn't also your gateway router, tell your DHCP clients who is the default gateway: CHANGE: #dhcp-option=3,1.2.3.4 TO: dhcp-option=3,YOUR_GATEWAY_IP 2) start/restart DNSMasq /etc/rc.d/rc.dnsmasq restart You should now have a working DCHP server. ---- '''Persistent IPs''' To assign IPs based on a device's MAC address, edit /etc/dnsmasq.conf and add the following line for every device (using the correct MAC and IP of course): dhcp-host=11:22:33:44:55:66,192.168.1.61 '''NOTE:''' The IP address should be OUTSIDE the DHCP pool. [[Category: Tutorials]] 8803ce1a95b81577985f3119f0dcbd5e32e530d1 DHCP Server: dhcpd 0 295 759 2012-08-29T16:11:03Z Arfon 70 CREATED to match DCHP Server: DNSMasq wikitext text/x-wiki NEEDS TO BE CREATED You can look at [[DHCP Server: DNSMasq]] [[Category: Tutorials]] a1aa167491f628128c0f524ac3a79656d4487744 X Windows: Remote X to Linux 0 296 761 2012-08-29T19:25:29Z Arfon 70 CREATED! wikitext text/x-wiki '''NOTE:''' in the X11 world, the '''SERVER machine''' is the one listening for a connection (your desktop).<br> '''NOTE:''' The '''CLIENT machine''' is the one initiating the connection (the remote machine).<br> I know, it sounds backwards but, it is actually correct if you understand the X11 connection.<br> ---- 1) Tell your X11 Server Linux box (your desktop) to accept X11 connections from the Client machines.<br> * If it's a one time connection, just run the following from the command line<br> or<br> * You can add the following to .bashrc or .profile to make it permenant<br> xhost +144.45.254.150 2) Start the connection from the Client Linux machine (the remote machine)- Connect to the remote Linux machine via ssh/telnet/rlogin/whatever and run: DISPLAY=X11_SERVER_IP:0;export DISPLAY;APPLICATION_YOU_WANT_TO_RUN & '''EXAMPLE:''' DISPLAY=192.168.1.10:0;export DISPLAY;xterm & '''REMEMBER:''' ''The X11 server is your desktop.'' [[Category: Tutorials]] 09cbe1e84dafe4d1775f7fa9d5c66f4d773cb8ba 766 761 2012-08-30T12:59:00Z Arfon 70 ADDED: X11 over SSH wikitext text/x-wiki '''NOTE:''' In the X11 world, the '''SERVER machine''' is the one listening for a connection (the local machine (your desktop)).<br> '''NOTE:''' The '''CLIENT machine''' is the one initiating the connection (the remote machine).<br> I know, it sounds backwards but, it is actually correct if you understand the X11 connection.<br> ---- ===Plain Ol' Vanilla X11 Remote Connection=== 1) Tell your X11 server machine (your desktop) to accept X11 connections from the client machine.<br> * If it's a one time connection, just run the following from the command line<br> or<br> * You can add the following to .bashrc or .profile to make it permanent<br> xhost +X11_SERVER_IP (the '''remote''' machine) '''EXAMPLE:''' xhost +192.168.1.45 2) Start the connection from the Client Linux machine (the remote machine)- Connect to the remote Linux machine via ssh/telnet/rlogin/whatever and run: DISPLAY=X11_SERVER_IP:0;export DISPLAY;APPLICATION_YOU_WANT_TO_RUN & '''EXAMPLE:''' DISPLAY=192.168.1.10:0;export DISPLAY;xterm & '''REMEMBER:''' ''The X11 server is your desktop.'' ---- ===Remote X11 Over SSH=== 1) ensure that X11Forwarding is enabled in /etc/ssh/ssh'''d'''_conf on the '''remote''' machine. 2) ensure that X11Forwarding is enabled in /etc/ssh/ssh_conf on the '''local''' machine. 3) open an X11 forwarded ssh session '''from the local machine to the remote machine''' (opposite of what you do for a 'vanilla' remote X connection): ssh -X USER@REMOTE_MACHINE XAPPLICATION_YOU_WANT_TO_RUN '''EXAMPLE:''' ssh -X joe@192.168.1.45 xterm & '''PROBLEMS'''<br> '''PROBLEM:''' ssh connection is complaining about an “Invalid MIT-MAGIC-COOKIE”.<br> '''FIX:''' start a less secure ssh session: ssh -Y USER@REMOTE_MACHINE [[Category: Tutorials]] c2ae0e4b2885f20ce513da039dfcbac4a0e176ec Perl Modules 0 129 762 155 2012-08-29T19:41:55Z Arfon 70 I originally created this page and things have changed slightly... wikitext text/x-wiki [[Category:Tutorials]] ==Getting To The CPAN Prompt== To administer your Perl modules you must use the CPAN prompt. To get to the CPAN prompt, <b>as root</b> type: ::<code>perl -MCPAN -e shell</code> If this is the first time that you have entered the CPAN shell, you will be asked some set-up questions that will allow the shell to access CPAN's servers to get modules. Just read the questions and answer them. If you ever need to re-run the set-up again, enter the CPAN shell and then type: ::<code>o conf init</code> ==Listing The Installed Modules== '''Easy way''' instmodsh l (L) '''Hard way''' use this Perl program: #!/usr/bin/perl use ExtUtils::Installed; my $instmod = ExtUtils::Installed->new(); foreach my $module ($instmod->modules()) { my $version = $instmod->version($module) || "???"; print "$module -- $version\n"; } ==Installing New Modules== From the CPAN shell prompt, type: install &lt;Some::Module&gt; ==Removing Modules== A clean way is by using this Perl program: #!/usr/bin/perl -w use ExtUtils::Packlist; use ExtUtils::Installed; $ARGV[0] or die "Usage: $0 Module::Name\n"; my $mod = $ARGV[0]; my $inst = ExtUtils::Installed->new(); foreach my $item (sort($inst->files($mod))) { print "removing $item\n"; unlink $item; } my $packfile = $inst->packlist($mod)->packlist_file(); print "removing $packfile\n"; unlink $packfile; 7109e17827390ccc6d5783d7824b90cba0e1b669 763 762 2012-08-29T19:43:08Z Arfon 70 /* Getting To The CPAN Prompt */ REMOVED perl MCPAN and ADDED cpan wikitext text/x-wiki [[Category:Tutorials]] ==Getting To The CPAN Prompt== To administer your Perl modules you must use the CPAN prompt. To get to the CPAN prompt, <b>as root</b> type: ::<code>cpan</code> If this is the first time that you have entered the CPAN shell, you will be asked some set-up questions that will allow the shell to access CPAN's servers to get modules. Just read the questions and answer them. If you ever need to re-run the set-up again, enter the CPAN shell and then type: ::<code>o conf init</code> ==Listing The Installed Modules== '''Easy way''' instmodsh l (L) '''Hard way''' use this Perl program: #!/usr/bin/perl use ExtUtils::Installed; my $instmod = ExtUtils::Installed->new(); foreach my $module ($instmod->modules()) { my $version = $instmod->version($module) || "???"; print "$module -- $version\n"; } ==Installing New Modules== From the CPAN shell prompt, type: install &lt;Some::Module&gt; ==Removing Modules== A clean way is by using this Perl program: #!/usr/bin/perl -w use ExtUtils::Packlist; use ExtUtils::Installed; $ARGV[0] or die "Usage: $0 Module::Name\n"; my $mod = $ARGV[0]; my $inst = ExtUtils::Installed->new(); foreach my $item (sort($inst->files($mod))) { print "removing $item\n"; unlink $item; } my $packfile = $inst->packlist($mod)->packlist_file(); print "removing $packfile\n"; unlink $packfile; 7c759926b25e3032bcdf2f6af7c7509b87199a1d 764 763 2012-08-29T19:46:23Z Arfon 70 ADDED: upgrade modules wikitext text/x-wiki [[Category:Tutorials]] ==Getting To The CPAN Prompt== To administer your Perl modules you must use the CPAN prompt. To get to the CPAN prompt, <b>as root</b> type: ::<code>cpan</code> If this is the first time that you have entered the CPAN shell, you will be asked some set-up questions that will allow the shell to access CPAN's servers to get modules. Just read the questions and answer them. If you ever need to re-run the set-up again, enter the CPAN shell and then type: ::<code>o conf init</code> ==Listing The Installed Modules== '''Easy way''' instmodsh l (L) '''Hard way''' use this Perl program: #!/usr/bin/perl use ExtUtils::Installed; my $instmod = ExtUtils::Installed->new(); foreach my $module ($instmod->modules()) { my $version = $instmod->version($module) || "???"; print "$module -- $version\n"; } ==Installing New Modules== From the CPAN shell prompt, type: install &lt;Some::Module&gt; ==Removing Modules== A clean way is by using this Perl program: #!/usr/bin/perl -w use ExtUtils::Packlist; use ExtUtils::Installed; $ARGV[0] or die "Usage: $0 Module::Name\n"; my $mod = $ARGV[0]; my $inst = ExtUtils::Installed->new(); foreach my $item (sort($inst->files($mod))) { print "removing $item\n"; unlink $item; } my $packfile = $inst->packlist($mod)->packlist_file(); print "removing $packfile\n"; unlink $packfile; ==Upgrade Modules== In the cpan prompt, type: upgrade MODULE::NAME to upgrade an individual module '''or''' f1e89d29c3f2451d47e9575b90e1639e26fafb5c 765 764 2012-08-29T19:48:38Z Arfon 70 ADDED: upgrade modules wikitext text/x-wiki [[Category:Tutorials]] ==Getting To The CPAN Prompt== To administer your Perl modules you must use the CPAN prompt. To get to the CPAN prompt, <b>as root</b> type: ::<code>cpan</code> If this is the first time that you have entered the CPAN shell, you will be asked some set-up questions that will allow the shell to access CPAN's servers to get modules. Just read the questions and answer them. If you ever need to re-run the set-up again, enter the CPAN shell and then type: ::<code>o conf init</code> ==Listing The Installed Modules== From the BASH prompt: '''Easy way''' instmodsh l (L) '''Hard way''' use this Perl program: #!/usr/bin/perl use ExtUtils::Installed; my $instmod = ExtUtils::Installed->new(); foreach my $module ($instmod->modules()) { my $version = $instmod->version($module) || "???"; print "$module -- $version\n"; } ==Installing New Modules== From the CPAN prompt, type: install &lt;Some::Module&gt; ==Removing Modules== A clean way is by using this Perl program from the BASH prompt: #!/usr/bin/perl -w use ExtUtils::Packlist; use ExtUtils::Installed; $ARGV[0] or die "Usage: $0 Module::Name\n"; my $mod = $ARGV[0]; my $inst = ExtUtils::Installed->new(); foreach my $item (sort($inst->files($mod))) { print "removing $item\n"; unlink $item; } my $packfile = $inst->packlist($mod)->packlist_file(); print "removing $packfile\n"; unlink $packfile; ==Upgrade Modules== From the CPAN prompt, type: upgrade MODULE::NAME (to upgrade an individual module) '''or''' upgrade (to upgrade ALL modules) cad2d5601695462ad5bbbfa71233ea74b37c75d7 PPTP (Poptop) 0 297 769 2012-08-30T14:38:02Z Arfon 70 Moved from Pptp wikitext text/x-wiki [[Category:Server]] [[Category:Networking]] [[Category:Tutorials]] ==(Poptop) pptpd Server Setup== Here's what I did to get Poptop pptpd (1.3.4) running on my Slackware (13.37) box. 1) Install the official Slackware ppp package using pkgtool or slackpkg. 2) Install the ppptpd package from Slackbuilds.org using sbopkg. ***NOTE: The package name is NOT Poptop, it's pptpd*** 3) Edit /etc/pptpd.conf ADD: localip 10.7.0.1 remoteip 10.7.0.2-50 CHANGE: option /etc/ppp/options.pptpd -> option /etc/ppp/options 4) Edit /etc/ppp/options HERE IS A GOTCHA- The official Slackware ppp package (at the time of this writing) contains an error in the options file. The pppd binary was compiled to look for the new ms-dns parameter but the option file has the old dns-addr parameter. CHANGE: # dns-addr 192.168.1.1 -> ms-dns 8.8.8.8 (or whatever your dns server is) 5) Edit the /etc/ppp/chap-secrets file. For some reason, the default Slackware package has 4 example entries in it that are not commented (jacco,*,sam,*) delete these. You don't want jacco or sam to have a free connection into your box... ADD: one entry for each user you want to allow access. Format is: CLIENT [tab] SERVER [tab] PASSWORD [tab] IP ADDRESS Mine looks like this: bob * "BobsPasswordIsStrong" * sue * "FluffyBunnies92" * 6) Finally to start pptpd, normally you would just execute 'pptpd &' but being that I'm a good Slacker, I wrote an rc.pptpd script. Create /etc/rc.d/rc.pptpd contents: #!/bin/sh # # /etc/rc.d/rc.pptpd # # Start/stop/restart the pptpd server. # # To make PopTop start automatically at boot, make this # file executable: chmod 755 /etc/rc.d/rc.pptpd # pptpd_start() { if [ -x /usr/sbin/pptpd ]; then echo "Starting PopTop pptpd: /usr/sbin/pptpd server.conf" /usr/sbin/pptpd & fi } pptpd_stop() { killall pptpd } pptpd_restart() { pptpd_stop sleep 2 pptpd_start } case "$1" in 'start') pptpd_start ;; 'stop') pptpd_stop ;; 'restart') pptpd_restart ;; *) # Default is "start", for backwards compatibility with previous # Slackware versions. This may change to a 'usage' error someday. pptpd_start esac 7) Make it executable (and autobootable on start up) chmod 755 /etc/rc.d/rc.pptpd To start it manually- /etc/rc.d/rc.pptpd start To be useful you next need to configure your firewall to forward and masquerade traffic from the vpn out to the world... 8) Edit/create: /etc/rc.d/rc.firewall ADD: iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i ppp+ -j ACCEPT iptables -A FORWARD -o ppp+ -j ACCEPT iptables -A FORWARD -j ACCEPT iptables -t nat -A POSTROUTING -s 10.7.0.0/24 -o ppp+ -j MASQUERADE 9) Make it executable chmod 755 /etc/rc.d/rc.firewall 10) Flush the old firewall rules (forgetting to do this caused me all sorts of grief (Thanks mancha)) iptables -F 11) Execute the new firewall rules /etc/rc.d/rc.firewall If you and I haven't made any mistakes, you should now have pptp (server) and router working on your box. ==pptp Client Setup== Needs to be added. a28dd0fdb696a708217fbb99c929d401a1f060b9 Pptp 0 285 770 725 2012-08-30T14:38:48Z Arfon 70 Moved to PPPTP (Poptop) wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 NTPD 0 126 771 149 2012-08-30T14:52:37Z Arfon 70 Moved to NTPD wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 772 771 2012-08-30T15:01:26Z Arfon 70 Undo revision 771 by [[Special:Contributions/Arfon|Arfon]] ([[User talk:Arfon|talk]]) - Removed 2007 stuff, fixed typos wikitext text/x-wiki == Automating the time synchronization == You have two choices for automatic time updating, you can run ntpd all the time as a background process or you can have it run once in awhile (if you are tight on system resources). '''Running ntpd all the time'''<br> ::Just enable rc.ntpd script: ::::<code>chmod +x /etc/rc.d/rc.ntpd</code> ::After the script is enabled you probably will want ntpd to start immediately so, can either restart the system or manually start ntpd with: ::::<code>/etc/rc.d/rc.ntpd start</code> '''Running ntpd once in awhile'''<br> ::You have many choices but the two best ones are: :::1) Set up a cron job :::2) Set up a /etc/rc.d/rc.local entry and update the time on start-up only. ::Either way, you need to add the following commands into your cron job or rc.local script: ::::<code>ntpdate pool.ntp.org</code> <---(updates the time) ::::<code>hwclock --systohc</code> <------(saves the time to the hardware clock) <br> <br> ==Manually updating the time== Issue the following commands: ::::<code>ntpdate pool.ntp.org</code> ::::<code>hwclock --systohc</code> <br> <br> ==Choosing the right time server== On ntp.org you will find a complete list with the right time server for you. Let's say you live in germany, then you will choose <code>de.pool.ntp.org</code>. A complete List is available at http://support.ntp.org/bin/view/Servers/NTPPoolServers <br> <br> ==DST changes== If your time is off due to DST changes, you must update the <code>/etc/localtime</code> file. You should be able to find a correct file on the internet and just replace the old <code>/etc/localtime</code> file. <br> <br> ==PROBLEMS== '''PROBLEM:''' "Unable to contact time server:" error with KDE's Time Control Module.<br> '''FIX:''' Make sure ntpd is NOT running. If ntpd is running, manual ntp and KDE ntp updates will return errors due to ntpd having control of the ntp port. [[Category:Tutorials]] 53bc989820cf8bcf52ec176733c416e6da5fae64 773 772 2012-08-30T15:04:19Z Arfon 70 Arfon moved page [[Ntpd]] to [[NTPD - temp]]: Fixing page name wikitext text/x-wiki == Automating the time synchronization == You have two choices for automatic time updating, you can run ntpd all the time as a background process or you can have it run once in awhile (if you are tight on system resources). '''Running ntpd all the time'''<br> ::Just enable rc.ntpd script: ::::<code>chmod +x /etc/rc.d/rc.ntpd</code> ::After the script is enabled you probably will want ntpd to start immediately so, can either restart the system or manually start ntpd with: ::::<code>/etc/rc.d/rc.ntpd start</code> '''Running ntpd once in awhile'''<br> ::You have many choices but the two best ones are: :::1) Set up a cron job :::2) Set up a /etc/rc.d/rc.local entry and update the time on start-up only. ::Either way, you need to add the following commands into your cron job or rc.local script: ::::<code>ntpdate pool.ntp.org</code> <---(updates the time) ::::<code>hwclock --systohc</code> <------(saves the time to the hardware clock) <br> <br> ==Manually updating the time== Issue the following commands: ::::<code>ntpdate pool.ntp.org</code> ::::<code>hwclock --systohc</code> <br> <br> ==Choosing the right time server== On ntp.org you will find a complete list with the right time server for you. Let's say you live in germany, then you will choose <code>de.pool.ntp.org</code>. A complete List is available at http://support.ntp.org/bin/view/Servers/NTPPoolServers <br> <br> ==DST changes== If your time is off due to DST changes, you must update the <code>/etc/localtime</code> file. You should be able to find a correct file on the internet and just replace the old <code>/etc/localtime</code> file. <br> <br> ==PROBLEMS== '''PROBLEM:''' "Unable to contact time server:" error with KDE's Time Control Module.<br> '''FIX:''' Make sure ntpd is NOT running. If ntpd is running, manual ntp and KDE ntp updates will return errors due to ntpd having control of the ntp port. [[Category:Tutorials]] 53bc989820cf8bcf52ec176733c416e6da5fae64 775 773 2012-08-30T15:04:37Z Arfon 70 Arfon moved page [[NTPD - temp]] to [[NTPD]]: Fixing page name wikitext text/x-wiki == Automating the time synchronization == You have two choices for automatic time updating, you can run ntpd all the time as a background process or you can have it run once in awhile (if you are tight on system resources). '''Running ntpd all the time'''<br> ::Just enable rc.ntpd script: ::::<code>chmod +x /etc/rc.d/rc.ntpd</code> ::After the script is enabled you probably will want ntpd to start immediately so, can either restart the system or manually start ntpd with: ::::<code>/etc/rc.d/rc.ntpd start</code> '''Running ntpd once in awhile'''<br> ::You have many choices but the two best ones are: :::1) Set up a cron job :::2) Set up a /etc/rc.d/rc.local entry and update the time on start-up only. ::Either way, you need to add the following commands into your cron job or rc.local script: ::::<code>ntpdate pool.ntp.org</code> <---(updates the time) ::::<code>hwclock --systohc</code> <------(saves the time to the hardware clock) <br> <br> ==Manually updating the time== Issue the following commands: ::::<code>ntpdate pool.ntp.org</code> ::::<code>hwclock --systohc</code> <br> <br> ==Choosing the right time server== On ntp.org you will find a complete list with the right time server for you. Let's say you live in germany, then you will choose <code>de.pool.ntp.org</code>. A complete List is available at http://support.ntp.org/bin/view/Servers/NTPPoolServers <br> <br> ==DST changes== If your time is off due to DST changes, you must update the <code>/etc/localtime</code> file. You should be able to find a correct file on the internet and just replace the old <code>/etc/localtime</code> file. <br> <br> ==PROBLEMS== '''PROBLEM:''' "Unable to contact time server:" error with KDE's Time Control Module.<br> '''FIX:''' Make sure ntpd is NOT running. If ntpd is running, manual ntp and KDE ntp updates will return errors due to ntpd having control of the ntp port. [[Category:Tutorials]] 53bc989820cf8bcf52ec176733c416e6da5fae64 Ntpd 0 298 774 2012-08-30T15:04:19Z Arfon 70 Arfon moved page [[Ntpd]] to [[NTPD - temp]]: Fixing page name wikitext text/x-wiki #REDIRECT [[NTPD - temp]] 491e8c735247530ec62d34ff181f2e4b450f17b8 NTPD - temp 0 299 776 2012-08-30T15:04:37Z Arfon 70 Arfon moved page [[NTPD - temp]] to [[NTPD]]: Fixing page name wikitext text/x-wiki #REDIRECT [[NTPD]] 8014faa7f0f3239ddb9979a4ed92940829869303 Network Configuration 0 300 777 2012-08-30T18:38:57Z Arfon 70 CREATED! wikitext text/x-wiki ==See Your Current Network Configuration== ifconfig /sbin/ifconfig (if you are not root) ==Network Reconfiguration - Temporary Changes== ifconfig is the command to make changes to your networking. ifconfig (shows the current interface configuration) ifconfig eth0 up (brings eth0 interface up) ifconfig eth1 down (takes eth1 interface down) ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up (brings eth0 up with an IP of 192.168.1.5) ifconfig eth0:1 192.168.2.15 netmask 255.255.255.0 (adds a secondary IP address of 192.168.2.15 to eth0) ==Network Reconfiguration - Permanent Changes== '''ETH0'''<br> If you need to change your '''eth0''' configuration after an install, use netconfig netconfig '''OTHER INTERFACES'''<br> To reconfigure other network devices, you need to edit the /etc/rc.d/rc.inet1.conf files by hand. The file is very easy to figure out. vi /etc/rc.d/rc.inet1.conf ==Make changes take effect immediately== To make the network changes immediately active: /etc/rc.d/rc.inet1 restart (restarts all interfaces) /etc/rc.d/rc.inet1 eth0_restart (restarts eth0) /etc/rc.d/rc.inet1 eth1_restart (restarts eth1) ...etc... 15fb224a6d1728e9cf308c9b33560a145c12d58e 778 777 2012-08-30T18:40:34Z Arfon 70 Forgot to add Category AGAIN! wikitext text/x-wiki ==See Your Current Network Configuration== ifconfig /sbin/ifconfig (if you are not root) ==Network Reconfiguration - Temporary Changes== ifconfig is the command to make changes to your networking. ifconfig (shows the current interface configuration) ifconfig eth0 up (brings eth0 interface up) ifconfig eth1 down (takes eth1 interface down) ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up (brings eth0 up with an IP of 192.168.1.5) ifconfig eth0:1 192.168.2.15 netmask 255.255.255.0 (adds a secondary IP address of 192.168.2.15 to eth0) ==Network Reconfiguration - Permanent Changes== '''ETH0'''<br> If you need to change your '''eth0''' configuration after an install, use netconfig netconfig '''OTHER INTERFACES'''<br> To reconfigure other network devices, you need to edit the /etc/rc.d/rc.inet1.conf files by hand. The file is very easy to figure out. vi /etc/rc.d/rc.inet1.conf ==Make changes take effect immediately== To make the network changes immediately active: /etc/rc.d/rc.inet1 restart (restarts all interfaces) /etc/rc.d/rc.inet1 eth0_restart (restarts eth0) /etc/rc.d/rc.inet1 eth1_restart (restarts eth1) ...etc... [[Category: Tutorials]] 8b12afb0dc6ed769f9cea3587f2a622e9a4f6158 ZFS root 0 290 783 782 2012-09-09T04:06:47Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, try changing "order=dc" or hitting F12 at boot prompt and select the CD/DVD boot option. Note: The support for booting drives using if=scsi is not included with current versions of qemu. Booting scsi requires the 8xx_64.rom option-rom, which can be downloaded at [http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip LSI.com]. Unzip it, and then: <pre> cp 8xx_64.rom /usr/share/qemu # then run qemu-kvm with additional command line option: -option-rom 8xx_64.rom,bootindex=1 </pre> Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors inside the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. Note: On a real ZFS installation, users will typically want to use the ZFS mirror or raidz virtual device (vdev) types for reliability against hard drive failures. For example, a good configuration might be to use a USB memory stick (and a backup stick) for /boot that is plugged into an on-motherboard "Type A" USB connector. Then, use four whole hard drives in a raidz2 vdev as the initial storage space in the root zpool. At a later time, to add more storage space, additional whole four-drive raidz2 vdevs of the same size could be added to the zpool. It is recommended to only add the same vdev type (disk, mirror, or raidz|1|2|3) and size to a zpool since zfs stripes across the vdevs, and vdevs of different types/sizes do not stripe together optimally. After adding a vdev to your zpool, you might need to copy the new /etc/zfs/zpool.cache to your initrd-tree or initramfs-source (and rebuild/reinstall them) if you are using the cachefile to import your zpool. Using mirror vdevs would be similar to a raid10. Using 4-disk raidz2 vdevs would give the same storage space as raid10 while fully reliable against any double-disk failure; however, the raidz2 parity calculations results in higher CPU usage and/or lower performance. Because raidz vdevs cannot be grown by adding hard drives to them, and vdevs in a zpool are striped, it is important with ZFS to decide what type and size of vdev will be used in a zpool as the units of add-on storage space; it could be difficult to alter this decision later. Finally, on a real installation with raidz, data scrub should be scheduled to actively search for "latent defects" on the hard drives so that unknown read/write errors do not become known later during a disk swap/rebuild and result in the zpool becoming faulted (lost). <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is most likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Let's use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export zpool commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactivated without need to issue the zpool import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override the <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how the two methods of mounting interact. When <code>mountpoint=legacy</code> is set, zfs expects the regular mount and umount commands to be used to mount and unmount the dataset with the assistance of the mount.zfs helper. For now, we will continue with <code>mountpoint=none</code>, but using legacy is also a good option. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. You can use <code>mountpoint=legacy"</code> to avoid this small problem if you are preferring to use the regular mount and umount commands on your zfs-root. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process is normal. <pre> # Finish installation and exit setup, but do NOT reboot! # There is still a lot to do before rebooting. umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We installed spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz label = vmlinuz initrd = /boot/initrd.gz root = /dev/ram0 read-write # alternatively, the root and read-write lines # can be this one line of kernel parameters: # addappend = " root=/dev/ram0 rw " </pre> A note about initrd: The /boot/initrd.gz is a gzipped cpio archive containing a minimal BusyBox-based slackware root system that is sourced from /boot/initrd-tree. The commands "mkinitrd" and "mkinitrd -F" generates /boot/initrd-tree and /boot/initrd.gz. When using a initrd, the initial root device is normally set to root=/dev/ram0 (a ramfs block device) and allowed read-write. The kernel refers to devices in terms of "major" and "minor" numbers, and the ram0 device is assigned the block device major 1 and minor 0. This ram0 major/minor is written in hexadecimal as 0x0100 (256 in decimal). This hexademical number makes an appearance in /boot/initrd-tree/int where it runs: "echo 0x0100 > /proc/sys/kernel/real-root-dev". Echoing a device code to real-root-dev is part of a deprecated initrd mechanism, but is probably harmless to leave alone as slackware has it unless you know otherwise. More information about how initrd works can be found in: <pre> /usr/src/linux/Documentation/devices.txt (info about major:minor device numbers) /usr/src/linux/Documentation/initrd.txt (mostly obsolete info on old initrd) /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt (current info on new initrd, called initramfs) </pre> Advanced note about initrd: Slackware's mkinitrd package does not use the "pivot_root" command as documented in "initrd.txt", but instead uses "switch_root" provided by a project called BusyBox. The switch_root command changes the effective root filesystem from the initrd (unpacked in rootfs at /) to the new root filesystem (zfs-root mounted at /mnt); it overmounts rootfs / with zfs-root /mnt. The switch_root works as follows: delete everything in rootfs / (one filesystem only) that held initrd to free up ram memory, then use mount, chroot, and chdir to make the effective root change. In concept (as a shell script), the command "exec switch_root /mnt $INIT $RUNLEVEL" is performed as follows: <pre> find / -xdev | xargs rm -rf cd "$1" shift mount --move . / exec chroot . "$@" </pre> Here, typically INIT=/sbin/init RUNLEVEL=3. The 'exec' causes switch_root to take the place of the parent process having PID=1. In system calls, the switch_root looks similar to this: <pre> chdir("/mnt"); /* <insert code to unlink/rmdir all initrd files/directories * installed in rootfs / without crossing filesystems > */ mount(".", "/", NULL, MS_MOVE, NULL); chroot("."); chdir("/"); execl("/sbin/init", "3", (char*) NULL ); </pre> The kernel's rootfs / that contained initrd is never actually unmounted (it can't be) because it is built into the kernel and always exists as at least a tiny ramfs or tmpfs, so you can continue to see it in /proc/mounts. When you give lilo root=/dev/ram0 (a ramfs device), the kernel will actually use the internal rootfs, which is an instance of a tmpfs (if your kernel config includes tmpfs) or ramfs. The rootfs that is a tmpfs can by default use up to half of system ram. If rootfs is a ramfs, it can use up to almost all of system ram until the system panics. Typically, tmpfs is built into the kernel, and so depending on how much ram your computer has, the initrd-tree can probably be up to about half that size. Quite a lot of notes... now to continue on: Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:e1000:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module e1000 for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p modules could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted zfs-root, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for the zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using "zpool import" and "zpool export" commands and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out the zpool import/export lines. As mentioned, the zpool import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, zfs-root will not get mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "zpool import -f zfs-root", "mount zfs-root", and then "exit" to continue booting onto zfs-root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). This is a ip-based hostid value, a 32bit hexadecimal number. The hostid has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set, and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could become invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and quit vi. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as readonly property changes. Note: if you use mountpoint=legacy, then you do not need to make the following changes: In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem check. The rc.S script will complain a lot in many places about not being able to run fsck on the zfs-root. To disable all attempts of run fsck, we can simply create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to umount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrats! If this seems to go badly, and this might happen if the import fails as explained some before, then you will be on the initrd's rescue command line just before the part in init where it wants to mount zfs-root and switch_root to boot up. In this case, you typically got commands like these to do: If you get dumped to rescue because zpool import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zpool import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your zfs-root as readonly=on to /mnt, then "exit" to continue booting. In other emergency command lines, you might need to run the lines at the end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line in init is run like: <code>exec switch_root /mnt /sbin/init 1</code> Warning: the switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. However, the deletes should not cross filesystems, but only delete the contents of initramfs. Also, in rescue command line or anytime you have finished making changes and are about to reboot in some abnormal situation, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. ---- Upgrading: From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuild and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, kernel-headers, and kernel-source. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SPL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname -r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. ---- More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> ---- Now available! "ZFS root (builtin)" wiki (aka "ZFS root, part II"): http://slackwiki.com/ZFS_root_(builtin) It is now possible to build the modules and a small initramfs into your kernel to have a fully-contained and bootable ZFS root kernel from a simple lilo entry. Good luck! b840f3f890c141b5f30533b03f357c079d70ed95 792 783 2012-09-14T06:50:06Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, try changing "order=dc" or hitting F12 at boot prompt and select the CD/DVD boot option. Note: The support for booting drives using if=scsi is not included with current versions of qemu. Booting scsi requires the 8xx_64.rom option-rom, which can be downloaded at [http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip LSI.com]. Unzip it, and then: <pre> cp 8xx_64.rom /usr/share/qemu # then run qemu-kvm with additional command line option: -option-rom 8xx_64.rom,bootindex=1 </pre> Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors inside the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. Note: On a real ZFS installation, users will typically want to use the ZFS mirror or raidz virtual device (vdev) types for reliability against hard drive failures. For example, a good configuration might be to use a USB memory stick (and a backup stick) for /boot that is plugged into an on-motherboard "Type A" USB connector. Then, use four whole hard drives in a raidz2 vdev as the initial storage space in the root zpool. At a later time, to add more storage space, additional whole four-drive raidz2 vdevs of the same size could be added to the zpool. It is recommended to only add the same vdev type (disk, mirror, or raidz|1|2|3) and size to a zpool since zfs stripes across the vdevs, and vdevs of different types/sizes do not stripe together optimally. After adding a vdev to your zpool, you might need to copy the new /etc/zfs/zpool.cache to your initrd-tree or initramfs-source (and rebuild/reinstall them) if you are using the cachefile to import your zpool. Using mirror vdevs would be similar to a raid10. Using 4-disk raidz2 vdevs would give the same storage space as raid10 while fully reliable against any double-disk failure; however, the raidz2 parity calculations results in higher CPU usage and/or lower performance. Because raidz vdevs cannot be grown by adding hard drives to them, and vdevs in a zpool are striped, it is important with ZFS to decide what type and size of vdev will be used in a zpool as the units of add-on storage space; it could be difficult to alter this decision later. Finally, on a real installation with raidz, data scrub should be scheduled to actively search for "latent defects" on the hard drives so that unknown read/write errors do not become known later during a disk swap/rebuild and result in the zpool becoming faulted (lost). <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is most likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Let's use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export zpool commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactivated without need to issue the zpool import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override the <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how the two methods of mounting interact. When <code>mountpoint=legacy</code> is set, zfs expects the regular mount and umount commands to be used to mount and unmount the dataset with the assistance of the mount.zfs helper. For now, we will continue with <code>mountpoint=none</code>, but using legacy is also a good option. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. You can use <code>mountpoint=legacy"</code> to avoid this small problem if you are preferring to use the regular mount and umount commands on your zfs-root. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process is normal. <pre> # Finish installation and exit setup, but do NOT reboot! # There is still a lot to do before rebooting. umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We installed spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz label = vmlinuz initrd = /boot/initrd.gz root = /dev/ram0 read-write # alternatively, the root and read-write lines # can be this one line of kernel parameters: # addappend = " root=/dev/ram0 rw " </pre> A note about initrd: The /boot/initrd.gz is a gzipped cpio archive containing a minimal BusyBox-based slackware root system that is sourced from /boot/initrd-tree. The commands "mkinitrd" and "mkinitrd -F" generates /boot/initrd-tree and /boot/initrd.gz. When using a initrd, the initial root device is normally set to root=/dev/ram0 (a ramfs block device) and allowed read-write. The kernel refers to devices in terms of "major" and "minor" numbers, and the ram0 device is assigned the block device major 1 and minor 0. This ram0 major/minor is written in hexadecimal as 0x0100 (256 in decimal). This hexademical number makes an appearance in /boot/initrd-tree/int where it runs: "echo 0x0100 > /proc/sys/kernel/real-root-dev". Echoing a device code to real-root-dev is part of a deprecated initrd mechanism, but is probably harmless to leave alone as slackware has it unless you know otherwise. More information about how initrd works can be found in: <pre> /usr/src/linux/Documentation/devices.txt (info about major:minor device numbers) /usr/src/linux/Documentation/initrd.txt (mostly obsolete info on old initrd) /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt (current info on new initrd, called initramfs) </pre> Advanced note about initrd: Slackware's mkinitrd package does not use the "pivot_root" command as documented in "initrd.txt", but instead uses "switch_root" provided by a project called BusyBox. The switch_root command changes the effective root filesystem from the initrd (unpacked in rootfs at /) to the new root filesystem (zfs-root mounted at /mnt); it overmounts rootfs / with zfs-root /mnt. The switch_root works as follows: delete everything in rootfs / (one filesystem only) that held initrd to free up ram memory, then use mount, chroot, and chdir to make the effective root change. In concept (as a shell script), the command "exec switch_root /mnt $INIT $RUNLEVEL" is performed as follows: <pre> find / -xdev | xargs rm -rf cd "$1" shift mount --move . / exec chroot . "$@" </pre> Here, typically INIT=/sbin/init RUNLEVEL=3. The 'exec' causes switch_root to take the place of the parent process having PID=1. In system calls, the switch_root looks similar to this: <pre> chdir("/mnt"); /* <insert code to unlink/rmdir all initrd files/directories * installed in rootfs / without crossing filesystems > */ mount(".", "/", NULL, MS_MOVE, NULL); chroot("."); chdir("/"); execl("/sbin/init", "3", (char*) NULL ); </pre> The kernel's rootfs / that contained initrd is never actually unmounted (it can't be) because it is built into the kernel and always exists as at least a tiny ramfs or tmpfs, so you can continue to see it in /proc/mounts. When you give lilo root=/dev/ram0 (a ramfs device), the kernel will actually use the internal rootfs, which is an instance of a tmpfs (if your kernel config includes tmpfs) or ramfs. The rootfs that is a tmpfs can by default use up to half of system ram. If rootfs is a ramfs, it can use up to almost all of system ram until the system panics. Typically, tmpfs is built into the kernel, and so depending on how much ram your computer has, the initrd-tree can probably be up to about half that size. Quite a lot of notes... now to continue on: Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:e1000:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module e1000 for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p modules could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted zfs-root, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for the zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using "zpool import" and "zpool export" commands and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out the zpool import/export lines. As mentioned, the zpool import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, zfs-root will not get mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "zpool import -f zfs-root", "mount zfs-root", and then "exit" to continue booting onto zfs-root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). This is a ip-based hostid value, a 32bit hexadecimal number. The hostid has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set, and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could become invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and quit vi. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as readonly property changes. Note: if you use mountpoint=legacy, then you do not need to make the following changes: In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem check. The rc.S script will complain a lot in many places about not being able to run fsck on the zfs-root. To disable all attempts to run fsck, we can simply create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! An alternative to using /etc/fastboot is to make the file <code>/sbin/fsck.zfs</code> that always just "does nothing successfully": <pre> #!/bin/sh exec /usr/bin/true </pre> This fsck helper has the advantage that you do not need to alter <code>rc.S</code> as much, or at all if you use zfs property <code>mountpoint=legacy</code> and the regular <code>mount</code> command on your zfs-root. With these ideas, no slackware /etc/rc.d/* files really need editing, but it is up to you how you want to experiment. We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to umount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrats! If this seems to go badly, and this might happen if the import fails as explained some before, then you will be on the initrd's rescue command line just before the part in init where it wants to mount zfs-root and switch_root to boot up. In this case, you typically got commands like these to do: If you get dumped to rescue because zpool import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zpool import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your zfs-root as readonly=on to /mnt, then "exit" to continue booting. In other emergency command lines, you might need to run the lines at the end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line in init is run like: <code>exec switch_root /mnt /sbin/init 1</code> Warning: the switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. However, the deletes should not cross filesystems, but only delete the contents of initramfs. Also, in rescue command line or anytime you have finished making changes and are about to reboot in some abnormal situation, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. ---- Upgrading: From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuild and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, kernel-headers, and kernel-source. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SPL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname -r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. ---- More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> ---- Now available! "ZFS root (builtin)" wiki (aka "ZFS root, part II"): http://slackwiki.com/ZFS_root_(builtin) It is now possible to build the modules and a small initramfs into your kernel to have a fully-contained and bootable ZFS root kernel from a simple lilo entry. Good luck! e8ad383f860374ce018bd4fe1b883bfd9aa3c58a 793 792 2012-09-14T07:59:36Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, try changing "order=dc" or hitting F12 at boot prompt and select the CD/DVD boot option. Note: The support for booting drives using if=scsi is not included with current versions of qemu. Booting scsi requires the 8xx_64.rom option-rom, which can be downloaded at [http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip LSI.com]. Unzip it, and then: <pre> cp 8xx_64.rom /usr/share/qemu # then run qemu-kvm with additional command line option: -option-rom 8xx_64.rom,bootindex=1 </pre> Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors inside the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. Note: On a real ZFS installation, users will typically want to use the ZFS mirror or raidz virtual device (vdev) types for reliability against hard drive failures. For example, a good configuration might be to use a USB memory stick (and a backup stick) for /boot that is plugged into an on-motherboard "Type A" USB connector. Then, use four whole hard drives in a raidz2 vdev as the initial storage space in the root zpool. At a later time, to add more storage space, additional whole four-drive raidz2 vdevs of the same size could be added to the zpool. It is recommended to only add the same vdev type (disk, mirror, or raidz|1|2|3) and size to a zpool since zfs stripes across the vdevs, and vdevs of different types/sizes do not stripe together optimally. After adding a vdev to your zpool, you might need to copy the new /etc/zfs/zpool.cache to your initrd-tree or initramfs-source (and rebuild/reinstall them) if you are using the cachefile to import your zpool. Using mirror vdevs would be similar to a raid10. Using 4-disk raidz2 vdevs would give the same storage space as raid10 while fully reliable against any double-disk failure; however, the raidz2 parity calculations results in higher CPU usage and/or lower performance. Because raidz vdevs cannot be grown by adding hard drives to them, and vdevs in a zpool are striped, it is important with ZFS to decide what type and size of vdev will be used in a zpool as the units of add-on storage space; it could be difficult to alter this decision later. Finally, on a real installation with raidz, data scrub should be scheduled to actively search for "latent defects" on the hard drives so that unknown read/write errors do not become known later during a disk swap/rebuild and result in the zpool becoming faulted (lost). <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is most likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Let's use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export zpool commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on and sync disks. To avoid the requirement to import the zfs-root pool at startup, keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactivated without need to issue the zpool import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A zfs fs will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override the <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how the two methods of mounting interact. When <code>mountpoint=legacy</code> is set, zfs expects the regular mount and umount commands to be used to mount and unmount the dataset with the assistance of the mount.zfs helper. For now, we will continue with <code>mountpoint=none</code>, but using legacy is also a good option. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. You can use <code>mountpoint=legacy"</code> to avoid this small problem if you are preferring to use the regular mount and umount commands on your zfs-root. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process is normal. <pre> # Finish installation and exit setup, but do NOT reboot! # There is still a lot to do before rebooting. umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel. <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We installed spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz label = vmlinuz initrd = /boot/initrd.gz root = /dev/ram0 read-write # alternatively, the root and read-write lines # can be this one line of kernel parameters: # addappend = " root=/dev/ram0 rw " </pre> A note about initrd: The /boot/initrd.gz is a gzipped cpio archive containing a minimal BusyBox-based slackware root system that is sourced from /boot/initrd-tree. The commands "mkinitrd" and "mkinitrd -F" generates /boot/initrd-tree and /boot/initrd.gz. When using a initrd, the initial root device is normally set to root=/dev/ram0 (a ramfs block device) and allowed read-write. The kernel refers to devices in terms of "major" and "minor" numbers, and the ram0 device is assigned the block device major 1 and minor 0. This ram0 major/minor is written in hexadecimal as 0x0100 (256 in decimal). This hexademical number makes an appearance in /boot/initrd-tree/int where it runs: "echo 0x0100 > /proc/sys/kernel/real-root-dev". Echoing a device code to real-root-dev is part of a deprecated initrd mechanism, but is probably harmless to leave alone as slackware has it unless you know otherwise. More information about how initrd works can be found in: <pre> /usr/src/linux/Documentation/devices.txt (info about major:minor device numbers) /usr/src/linux/Documentation/initrd.txt (mostly obsolete info on old initrd) /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt (current info on new initrd, called initramfs) </pre> Advanced note about initrd: Slackware's mkinitrd package does not use the "pivot_root" command as documented in "initrd.txt", but instead uses "switch_root" provided by a project called BusyBox. The switch_root command changes the effective root filesystem from the initrd (unpacked in rootfs at /) to the new root filesystem (zfs-root mounted at /mnt); it overmounts rootfs / with zfs-root /mnt. The switch_root works as follows: delete everything in rootfs / (one filesystem only) that held initrd to free up ram memory, then use mount, chroot, and chdir to make the effective root change. In concept (as a shell script), the command "exec switch_root /mnt $INIT $RUNLEVEL" is performed as follows: <pre> find / -xdev | xargs rm -rf cd "$1" shift mount --move . / exec chroot . "$@" </pre> Here, typically INIT=/sbin/init RUNLEVEL=3. The 'exec' causes switch_root to take the place of the parent process having PID=1. In system calls, the switch_root looks similar to this: <pre> chdir("/mnt"); /* <insert code to unlink/rmdir all initrd files/directories * installed in rootfs / without crossing filesystems > */ mount(".", "/", NULL, MS_MOVE, NULL); chroot("."); chdir("/"); execl("/sbin/init", "3", (char*) NULL ); </pre> The kernel's rootfs / that contained initrd is never actually unmounted (it can't be) because it is built into the kernel and always exists as at least a tiny ramfs or tmpfs, so you can continue to see it in /proc/mounts. When you give lilo root=/dev/ram0 (a ramfs device), the kernel will actually use the internal rootfs, which is an instance of a tmpfs (if your kernel config includes tmpfs) or ramfs. The rootfs that is a tmpfs can by default use up to half of system ram. If rootfs is a ramfs, it can use up to almost all of system ram until the system panics. Typically, tmpfs is built into the kernel, and so depending on how much ram your computer has, the initrd-tree can probably be up to about half that size. Quite a lot of notes... now to continue on: Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:e1000:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module e1000 for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p modules could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit. <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it). <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt. <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time. ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by a system call, the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsibe for configuring your block devices and mount your root at /mnt and then booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short name. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted zfs-root, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for the zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using "zpool import" and "zpool export" commands and startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out the zpool import/export lines. As mentioned, the zpool import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, zfs-root will not get mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually "zpool import -f zfs-root", "mount zfs-root", and then "exit" to continue booting onto zfs-root. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid. In this setup so far, the value is based on the ip assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). This is a ip-based hostid value, a 32bit hexadecimal number. The hostid has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the system call sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"), import only the pool for the root fs with mountpoint=none and readonly=on properties set, and while it is not mounted: <pre> (on installer or initrd rescue shell) cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd zfs set readonly=off zfs-root mount zfs-pool cp /etc/zfs/zpool.cache-initrd /mnt/etc/zfs/ cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Now, doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could become invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. Save /boot/initrd-tree/init and quit vi. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to "remount" rw or ro as readonly property changes. Note: if you use mountpoint=legacy, then you do not need to make the following changes: In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> In /etc/rc.d/rc.6 <pre> # comment out the line # /bin/mount -v -n -o remount,ro / #add the line /sbin/zfs set readonly=on zfs-root </pre> In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem check. The rc.S script will complain a lot in many places about not being able to run fsck on the zfs-root. To disable all attempts to run fsck, we can simply create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! An alternative to using /etc/fastboot is to make the file <code>/sbin/fsck.zfs</code> that always just "does nothing successfully": <pre> #!/bin/sh exec /bin/true </pre> Or, it can be: <pre> #!/bin/sh exit 0 </pre> Or, you just do (LOL!): <pre> ln -s /bin/true /sbin/fsck.zfs </pre> Got the idea, right! This fsck helper has the advantage that you do not need to alter <code>rc.S</code> as much, or at all if you use zfs property <code>mountpoint=legacy</code> and the regular <code>mount</code> command on your zfs-root. With these ideas, no slackware /etc/rc.d/* files really need editing, but it is up to you how you want to experiment. We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to umount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrats! If this seems to go badly, and this might happen if the import fails as explained some before, then you will be on the initrd's rescue command line just before the part in init where it wants to mount zfs-root and switch_root to boot up. In this case, you typically got commands like these to do: If you get dumped to rescue because zpool import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zpool import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your zfs-root as readonly=on to /mnt, then "exit" to continue booting. In other emergency command lines, you might need to run the lines at the end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line in init is run like: <code>exec switch_root /mnt /sbin/init 1</code> Warning: the switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. However, the deletes should not cross filesystems, but only delete the contents of initramfs. Also, in rescue command line or anytime you have finished making changes and are about to reboot in some abnormal situation, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. ---- Upgrading: From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuild and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, kernel-headers, and kernel-source. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SPL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname -r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. ---- More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> ---- Now available! "ZFS root (builtin)" wiki (aka "ZFS root, part II"): http://slackwiki.com/ZFS_root_(builtin) It is now possible to build the modules and a small initramfs into your kernel to have a fully-contained and bootable ZFS root kernel from a simple lilo entry. Good luck! 0c9821e46f48699d0f8535063aa83bcfc1095f13 795 793 2012-09-16T08:07:20Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, try changing "order=dc" or hitting F12 at boot prompt and select the CD/DVD boot option. Note: The support for booting drives using if=scsi is not included with current versions of qemu. Booting scsi requires the 8xx_64.rom option-rom, which can be downloaded at [http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip LSI.com]. Unzip it, and then: <pre> cp 8xx_64.rom /usr/share/qemu # then run qemu-kvm with additional command line option: -option-rom 8xx_64.rom,bootindex=1 </pre> Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors inside the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. Note: On a real ZFS installation, users will typically want to use the ZFS mirror or raidz virtual device (vdev) types for reliability against hard drive failures. For example, a good configuration might be to use a USB memory stick (and a backup stick) for /boot that is plugged into an on-motherboard "Type A" USB connector. Then, use four whole hard drives in a raidz2 vdev as the initial storage space in the root zpool. At a later time, to add more storage space, additional whole four-drive raidz2 vdevs of the same size could be added to the zpool. It is recommended to only add the same vdev type (disk, mirror, or raidz|1|2|3) and size to a zpool since zfs stripes across the vdevs, and vdevs of different types/sizes do not stripe together optimally. After adding a vdev to your zpool, you might need to copy the new /etc/zfs/zpool.cache to your initrd-tree or initramfs-source (and rebuild/reinstall them) if you are using the cachefile to import your zpool. Using mirror vdevs would be similar to a raid10. Using 4-disk raidz2 vdevs would give the same storage space as raid10 while fully reliable against any double-disk failure; however, the raidz2 parity calculations results in higher CPU usage and/or lower performance. Because raidz vdevs cannot be grown by adding hard drives to them, and vdevs in a zpool are striped, it is important with ZFS to decide what type and size of vdev will be used in a zpool as the units of add-on storage space; it could be difficult to alter this decision later. Finally, on a real installation with raidz, data scrub should be scheduled to actively search for "latent defects" on the hard drives so that unknown read/write errors do not become known later during a disk swap/rebuild and result in the zpool becoming faulted (lost). <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is most likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Let's use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> You can also use "legacy" for the mountpoint and the management of mounting and unmounting the pool will be expected to be done using the regular "mount" and "umount" commands: <pre> zfs set mountpoint=legacy zfs-root </pre> Later in the wiki, it is shown how to mount using "zfs mount" for mountpoint=none, and regular "mount" for mountpoint=legacy. Using mountpoint=legacy is probably the preferred setting for the zfs-root because you can use the normal mount and umount commands and do no have to change slackware /etc/rc.d/* scripts much, if any. The normal slackware scripts handle a root filesystem's mounting and remounting using the normal mount command. On creation, the zpool zfs-pool is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export zpool commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on or remount read-only and sync disks. To avoid the requirement to import the zfs-root pool at startup, you can keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactivated without need to issue the zpool import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A warning about the zpool.cache file: Having /etc/zfs/zpool.cache present at zfs module load or module init time can be unsafe if the device names in /dev have changed since the last boot. Especially dangerous is if two hard drives have swapped names, like /dev/sda and /dev/sdb have swapped names. It is safer to not have a zpool.cache file on the system at boot and zfs module load/init time to guard against the possibility that the cache file is no longer correct. This wiki will try to show how you can use zpool.cache to import your pool if the regular zpool import command seems to always require you to force it. This wiki will also show how to not need a zpool.cache file to import normally. A zfs filesystem will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> If you are using <code>mountpoint=legacy</code> then the options for the mount command for ro or rw mounting will work as normal also and override whatever the readonly property is set to. The readonly property does serve as a default. Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override the <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how the two methods of mounting interact. When <code>mountpoint=legacy</code> is set, zfs expects the regular mount and umount commands to be used to mount and unmount the dataset with the assistance of the mount.zfs helper. For now, we will continue with <code>mountpoint=none</code>, but using legacy is also a good option. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. You can use <code>mountpoint=legacy"</code> to avoid this small problem if you are preferring to use the regular mount and umount commands on your zfs-root. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process is normal. <pre> # Finish installation and exit setup, but do NOT reboot! # There is still a lot to do before rebooting. umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Although the fstab option for fs_passno is 0 and indicates that root (/) should not be fsck, this fs_passno option in fstab is ignored during system startup for / in rc.S because rc.S explicity runs "fsck /" which does not look at options inside fstab. Fsck doesn't work on a zfs fs, and we will deal with that problem in a moment (see below). Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel: <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We installed spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz label = vmlinuz initrd = /boot/initrd.gz root = /dev/ram0 read-write # alternatively, the root and read-write lines # can be this one line of kernel parameters: # addappend = " root=/dev/ram0 rw " </pre> A note about initrd: The /boot/initrd.gz is a gzipped cpio archive containing a minimal BusyBox-based slackware root system that is sourced from /boot/initrd-tree. The commands "mkinitrd" and "mkinitrd -F" generates /boot/initrd-tree and /boot/initrd.gz. When using a initrd, the initial root device is normally set to root=/dev/ram0 (a ramfs block device) and allowed read-write. The kernel refers to devices in terms of "major" and "minor" numbers, and the ram0 device is assigned the block device major 1 and minor 0. This ram0 major/minor is written in hexadecimal as 0x0100 (256 in decimal). This hexademical number makes an appearance in /boot/initrd-tree/int where it runs: "echo 0x0100 > /proc/sys/kernel/real-root-dev". Echoing a device code to real-root-dev is part of a deprecated initrd mechanism, but is probably harmless to leave alone as slackware has it unless you know otherwise. More information about how initrd works can be found in: <pre> /usr/src/linux/Documentation/devices.txt (info about major:minor device numbers) /usr/src/linux/Documentation/initrd.txt (mostly obsolete info on old initrd) /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt (current info on new initrd, called initramfs) </pre> Advanced note about initrd: Slackware's mkinitrd package does not use the "pivot_root" command as documented in "initrd.txt", but instead uses "switch_root" provided by a project called BusyBox. The switch_root command changes the effective root filesystem from the initrd (unpacked in rootfs at /) to the new root filesystem (zfs-root mounted at /mnt); it overmounts rootfs / with zfs-root /mnt. The switch_root works as follows: delete everything in rootfs / (one filesystem only) that held initrd to free up ram memory, then use mount, chroot, and chdir to make the effective root change. In concept (as a shell script), the command "exec switch_root /mnt $INIT $RUNLEVEL" is performed as follows: <pre> find / -xdev | xargs rm -rf cd "$1" shift mount --move . / exec chroot . "$@" </pre> Here, typically INIT=/sbin/init RUNLEVEL=3. The 'exec' causes switch_root to take the place of the parent process having PID=1. In system calls, the switch_root looks similar to this: <pre> chdir("/mnt"); /* <insert code to unlink/rmdir all initrd files/directories * installed in rootfs / without crossing filesystems > */ mount(".", "/", NULL, MS_MOVE, NULL); chroot("."); chdir("/"); execl("/sbin/init", "3", (char*) NULL ); </pre> The kernel's rootfs / that contained initrd is never actually unmounted (it can't be) because it is built into the kernel and always exists as at least a tiny ramfs or tmpfs, so you can continue to see it in /proc/mounts. When you give lilo root=/dev/ram0 (a ramfs device), the kernel will actually use the internal rootfs, which is an instance of a tmpfs (if your kernel config includes tmpfs) or ramfs. The rootfs that is a tmpfs can by default use up to half of system ram. If rootfs is a ramfs, it can use up to almost all of system ram until the system panics. Typically, tmpfs is built into the kernel, and so depending on how much ram your computer has, the initrd-tree can probably be up to about half that size. Quite a lot of notes... now to continue on... Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:e1000:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module e1000 for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p modules could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit: <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it): <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt: <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage (NAS) where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time (that requires a "cluster" fs). ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. The hostid can also be passed to the SPL module with the module parameter <code>spl.spl_hostid=0xHHHHHHHH</code> where the Hs are a hexadecimal hostid value and this overrides any /etc/hostid or hostname/IP-based hostid value. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsible for configuring your block devices, mounting root at /mnt, and booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short hostname. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> We want to make sure the default is to mount readonly, then it mounts using defaults from /etc/fstab inside the initrd. Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted zfs-root, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for the zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using "zpool import" and "zpool export" commands at startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out the zpool import/export lines. Using zpool import/export is safer than using a zpool.cache, so we try to setup that way preferably. As mentioned, the zpool import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, zfs-root will not get mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually do: <pre> zpool import -f zfs-root mount zfs-root exit </pre> This will force import, overriding the conflict that zfs thinks may be happening. Next is mount. After this, exit to let the init script continue on to boot the system normally. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid (the SPL module actually tries to run the hostid command to get this value or it uses the spl.spl_hostid value that is given to it). In this setup so far, the value is based on the ip assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). This is a ip-based hostid value, a 32bit hexadecimal number. The hostid has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the function sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"): <pre> (on installer or initrd rescue shell) zpool import zfs-root zfs set readonly=off zfs-root mount zfs-root cp /etc/zfs/zpool.cache /mnt/etc/zfs/zpool.cache-initrd cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Words of caution, again: Doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could become invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. As will be spammed all over this wiki, using zpool.cache is not recommended if you can avoid it because it is potentially unsafe for your pool. Save /boot/initrd-tree/init and quit vi. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to remount rw or ro as readonly property changes: In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> If you are using <code>mountpoint=legacy</code> for zfs-root, you do not need to make the above change. In /etc/rc.d/rc.6: <pre> # before: echo "Unmounting local file systems." # add lines: rm -f /etc/zfs/zpool.cache echo "Removed /etc/zfs/zpool.cache" </pre> Remove /etc/zfs/zpool.cache on shutdown. This is recommended because if it is present when you import a pool, it might use this old cache to determine the device filenames in the pool, which may have changed filenames since the last boot, especially the non-persistent /dev/sd* device filenames. It is safest to avoid any usage of the zpool.cache file at boot in initramfs, zfs module load, and at zpool import of other pools. In /etc/rc.d/rc.6: <pre> # comment out the line: # /bin/mount -v -n -o remount,ro / # add the line: /sbin/zfs set readonly=on zfs-root </pre> If you are using <code>mountpoint=legacy</code> for zfs-root, you do not need to make the above change. In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> This attempts to export even though it cannot return success for the root pool. The attempt is still recorded in the zpool history, and even though it fails the pool may actually be marked as exported (not sure). For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem check. The rc.S script will complain a lot in many places about not being able to run fsck on the zfs-root. To disable all attempts to run fsck, we can simply create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! An alternative to using /etc/fastboot is to make the file <code>/sbin/fsck.zfs</code> that always just "does nothing successfully": <pre> #!/bin/sh exec /bin/true </pre> Or, it can be: <pre> #!/bin/sh exit 0 </pre> Or, just do: <pre> ln -s /bin/true /sbin/fsck.zfs </pre> This fsck helper has the advantage that you do not need to alter <code>rc.S</code> as much, or at all if you use zfs property <code>mountpoint=legacy</code> and the regular <code>mount</code> command on your zfs-root. With these ideas, no slackware /etc/rc.d/* files really need editing, but it is up to you how you want to experiment. I prefer to use <code>mountpoint=legacy</code> and edit just the initrd init script as above, and edit rc.6 to remove /etc/zfs/zpool.cache and try to export. We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to umount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrats! If this seems to go badly, and this might happen if the import fails as explained some before, then you will be on the initrd's rescue command line just before the part in init where it wants to mount zfs-root and switch_root to boot up. In this case, you typically got commands like these to do: If you get dumped to rescue because zpool import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zpool import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your zfs-root as readonly=on to /mnt, then "exit" to continue booting. In other emergency command lines, you might need to run the lines at the end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line in init is run like: <code>exec switch_root /mnt /sbin/init 1</code> Warning: the switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. However, the deletes should not cross filesystems, but only delete the contents of initramfs. Also, in rescue command line or anytime you have finished making changes and are about to reboot in some abnormal situation, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. ---- Upgrading: From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuild and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, kernel-headers, and kernel-source. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SPL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname -r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. ---- More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> ---- Now available! "ZFS root (builtin)" wiki (aka "ZFS root, part II"): http://slackwiki.com/ZFS_root_(builtin) It is now possible to build the modules and a small initramfs into your kernel to have a fully-contained and bootable ZFS root kernel from a simple lilo entry. Good luck! 9f4c0b96e8e35300283c1a87033731e84a8ac4db 796 795 2012-09-16T09:58:56Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc10) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc2. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc10.tar.gz and zfs-0.6.0-rc10.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, try changing "order=dc" or hitting F12 at boot prompt and select the CD/DVD boot option. Note: The support for booting drives using if=scsi is not included with current versions of qemu. Booting scsi requires the 8xx_64.rom option-rom, which can be downloaded at [http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip LSI.com]. Unzip it, and then: <pre> cp 8xx_64.rom /usr/share/qemu # then run qemu-kvm with additional command line option: -option-rom 8xx_64.rom,bootindex=1 </pre> Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors inside the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp spl-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc10_3.2.27-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod cp zfs-0.6.0rc10_3.2.27-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations such as pools (similar to a volume group) backed by one or more of various kinds of virtual devices (similar to disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. Note: On a real ZFS installation, users will typically want to use the ZFS mirror or raidz virtual device (vdev) types for reliability against hard drive failures. For example, a good configuration might be to use a USB memory stick (and a backup stick) for /boot that is plugged into an on-motherboard "Type A" USB connector. Then, use four whole hard drives in a raidz2 vdev as the initial storage space in the root zpool. At a later time, to add more storage space, additional whole four-drive raidz2 vdevs of the same size could be added to the zpool. It is recommended to only add the same vdev type (disk, mirror, or raidz|1|2|3) and size to a zpool since zfs stripes across the vdevs, and vdevs of different types/sizes do not stripe together optimally. After adding a vdev to your zpool, you might need to copy the new /etc/zfs/zpool.cache to your initrd-tree or initramfs-source (and rebuild/reinstall them) if you are using the cachefile to import your zpool. Using mirror vdevs would be similar to a raid10. Using 4-disk raidz2 vdevs would give the same storage space as raid10 while fully reliable against any double-disk failure; however, the raidz2 parity calculations results in higher CPU usage and/or lower performance. Because raidz vdevs cannot be grown by adding hard drives to them, and vdevs in a zpool are striped, it is important with ZFS to decide what type and size of vdev will be used in a zpool as the units of add-on storage space; it could be difficult to alter this decision later. Finally, on a real installation with raidz, data scrub should be scheduled to actively search for "latent defects" on the hard drives so that unknown read/write errors do not become known later during a disk swap/rebuild and result in the zpool becoming faulted (lost). <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc10_3.2.27-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc10_3.2.27-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is most likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Let's use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning (numbers are in MiB): 0 to 4: unused 4 to 516: /dev/sda1 512MiB, type 8300 516 to 520: unused 520 to -96: /dev/sda2, type bf01 </pre> The -96 means to count from the end of the disk so that 96MiB will remain unused at the end of the disk. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> You can also use "legacy" for the mountpoint and the management of mounting and unmounting the pool will be expected to be done using the regular "mount" and "umount" commands: <pre> zfs set mountpoint=legacy zfs-root </pre> Later in the wiki, it is shown how to mount using "zfs mount" for mountpoint=none, and regular "mount" for mountpoint=legacy. Using mountpoint=legacy is probably the preferred setting for the zfs-root because you can use the normal mount and umount commands and do not have to change slackware /etc/rc.d/* scripts much, if any. The normal slackware scripts handle a root filesystem's mounting and remounting using the normal mount command. On creation, the zpool zfs-root is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export zpool commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on or remount read-only and sync disks. To avoid the requirement to import the zfs-root pool at startup, you can keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactivated without need to issue the zpool import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A warning about the zpool.cache file: Having /etc/zfs/zpool.cache present at zfs module load or module init time can be unsafe if the device names in /dev have changed since the last boot. Especially dangerous is if two hard drives have swapped names, like /dev/sda and /dev/sdb have swapped names. It is safer to not have a zpool.cache file on the system at boot and zfs module load/init time to guard against the possibility that the cache file is no longer correct. This wiki will try to show how you can use zpool.cache to import your pool if the regular zpool import command seems to always require you to force it. This wiki will also show how to not need a zpool.cache file to import normally. A zfs filesystem will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> If you are using <code>mountpoint=legacy</code> then the options for the mount command for ro or rw mounting will work as normal also and override whatever the readonly property is set to. The readonly property does serve as a default. Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override the <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how the two methods of mounting interact. When <code>mountpoint=legacy</code> is set, zfs expects the regular mount and umount commands to be used to mount and unmount the dataset with the assistance of the mount.zfs helper. For now, we will continue with <code>mountpoint=none</code>, but using legacy is also a good option. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. You can use <code>mountpoint=legacy"</code> to avoid this small problem if you are preferring to use the regular mount and umount commands on your zfs-root. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process is normal. <pre> # Finish installation and exit setup, but do NOT reboot! # There is still a lot to do before rebooting. umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Although the fstab option for fs_passno is 0 and indicates that root (/) should not be fsck, this fs_passno option in fstab is ignored during system startup for / in rc.S because rc.S explicity runs "fsck /" which does not look at options inside fstab. Fsck doesn't work on a zfs fs, and we will deal with that problem in a moment (see below). Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel: <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We installed spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz label = vmlinuz initrd = /boot/initrd.gz root = /dev/ram0 read-write # alternatively, the root and read-write lines # can be this one line of kernel parameters: # addappend = " root=/dev/ram0 rw " </pre> A note about initrd: The /boot/initrd.gz is a gzipped cpio archive containing a minimal BusyBox-based slackware root system that is sourced from /boot/initrd-tree. The commands "mkinitrd" and "mkinitrd -F" generates /boot/initrd-tree and /boot/initrd.gz. When using a initrd, the initial root device is normally set to root=/dev/ram0 (a ramfs block device) and allowed read-write. The kernel refers to devices in terms of "major" and "minor" numbers, and the ram0 device is assigned the block device major 1 and minor 0. This ram0 major/minor is written in hexadecimal as 0x0100 (256 in decimal). This hexademical number makes an appearance in /boot/initrd-tree/int where it runs: "echo 0x0100 > /proc/sys/kernel/real-root-dev". Echoing a device code to real-root-dev is part of a deprecated initrd mechanism, but is probably harmless to leave alone as slackware has it unless you know otherwise. More information about how initrd works can be found in: <pre> /usr/src/linux/Documentation/devices.txt (info about major:minor device numbers) /usr/src/linux/Documentation/initrd.txt (mostly obsolete info on old initrd) /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt (current info on new initrd, called initramfs) </pre> Advanced note about initrd: Slackware's mkinitrd package does not use the "pivot_root" command as documented in "initrd.txt", but instead uses "switch_root" provided by a project called BusyBox. The switch_root command changes the effective root filesystem from the initrd (unpacked in rootfs at /) to the new root filesystem (zfs-root mounted at /mnt); it overmounts rootfs / with zfs-root /mnt. The switch_root works as follows: delete everything in rootfs / (one filesystem only) that held initrd to free up ram memory, then use mount, chroot, and chdir to make the effective root change. In concept (as a shell script), the command "exec switch_root /mnt $INIT $RUNLEVEL" is performed as follows: <pre> find / -xdev | xargs rm -rf cd "$1" shift mount --move . / exec chroot . "$@" </pre> Here, typically INIT=/sbin/init RUNLEVEL=3. The 'exec' causes switch_root to take the place of the parent process having PID=1. In system calls, the switch_root looks similar to this: <pre> chdir("/mnt"); /* <insert code to unlink/rmdir all initrd files/directories * installed in rootfs / without crossing filesystems > */ mount(".", "/", NULL, MS_MOVE, NULL); chroot("."); chdir("/"); execl("/sbin/init", "3", (char*) NULL ); </pre> The kernel's rootfs / that contained initrd is never actually unmounted (it can't be) because it is built into the kernel and always exists as at least a tiny ramfs or tmpfs, so you can continue to see it in /proc/mounts. When you give lilo root=/dev/ram0 (a ramfs device), the kernel will actually use the internal rootfs, which is an instance of a tmpfs (if your kernel config includes tmpfs) or ramfs. The rootfs that is a tmpfs can by default use up to half of system ram. If rootfs is a ramfs, it can use up to almost all of system ram until the system panics. Typically, tmpfs is built into the kernel, and so depending on how much ram your computer has, the initrd-tree can probably be up to about half that size. Quite a lot of notes... now to continue on... Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:e1000:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module e1000 for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p modules could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit: <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it): <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt: <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage (NAS) where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time (that requires a "cluster" fs). ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. The hostid can also be passed to the SPL module with the module parameter <code>spl.spl_hostid=0xHHHHHHHH</code> where the Hs are a hexadecimal hostid value and this overrides any /etc/hostid or hostname/IP-based hostid value. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsible for configuring your block devices, mounting root at /mnt, and booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short hostname. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> We want to make sure the default is to mount readonly, then it mounts using defaults from /etc/fstab inside the initrd. Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted zfs-root, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for the zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using "zpool import" and "zpool export" commands at startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out the zpool import/export lines. Using zpool import/export is safer than using a zpool.cache, so we try to setup that way preferably. As mentioned, the zpool import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, zfs-root will not get mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually do: <pre> zpool import -f zfs-root mount zfs-root exit </pre> This will force import, overriding the conflict that zfs thinks may be happening. Next is mount. After this, exit to let the init script continue on to boot the system normally. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid (the SPL module actually tries to run the hostid command to get this value or it uses the spl.spl_hostid value that is given to it). In this setup so far, the value is based on the ip assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). This is a ip-based hostid value, a 32bit hexadecimal number. The hostid has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the function sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"): <pre> (on installer or initrd rescue shell) zpool import zfs-root zfs set readonly=off zfs-root mount zfs-root cp /etc/zfs/zpool.cache /mnt/etc/zfs/zpool.cache-initrd cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Words of caution, again: Doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could become invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. As will be spammed all over this wiki, using zpool.cache is not recommended if you can avoid it because it is potentially unsafe for your pool. Save /boot/initrd-tree/init and quit vi. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to remount rw or ro as readonly property changes: In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> If you are using <code>mountpoint=legacy</code> for zfs-root, you do not need to make the above change. In /etc/rc.d/rc.6: <pre> # before: echo "Unmounting local file systems." # add lines: rm -f /etc/zfs/zpool.cache echo "Removed /etc/zfs/zpool.cache" </pre> Remove /etc/zfs/zpool.cache on shutdown. This is recommended because if it is present when you import a pool, it might use this old cache to determine the device filenames in the pool, which may have changed filenames since the last boot, especially the non-persistent /dev/sd* device filenames. It is safest to avoid any usage of the zpool.cache file at boot in initramfs, zfs module load, and at zpool import of other pools. In /etc/rc.d/rc.6: <pre> # comment out the line: # /bin/mount -v -n -o remount,ro / # add the line: /sbin/zfs set readonly=on zfs-root </pre> If you are using <code>mountpoint=legacy</code> for zfs-root, you do not need to make the above change. In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> This attempts to export even though it cannot return success for the root pool. The attempt is still recorded in the zpool history, and even though it fails the pool may actually be marked as exported (not sure). For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem check. The rc.S script will complain a lot in many places about not being able to run fsck on the zfs-root. To disable all attempts to run fsck, we can simply create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! An alternative to using /etc/fastboot is to make the file <code>/sbin/fsck.zfs</code> that always just "does nothing successfully": <pre> #!/bin/sh exec /bin/true </pre> Or, it can be: <pre> #!/bin/sh exit 0 </pre> Or, just do: <pre> ln -s /bin/true /sbin/fsck.zfs </pre> This fsck helper has the advantage that you do not need to alter <code>rc.S</code> as much, or at all if you use zfs property <code>mountpoint=legacy</code> and the regular <code>mount</code> command on your zfs-root. With these ideas, no slackware /etc/rc.d/* files really need editing, but it is up to you how you want to experiment. I prefer to use <code>mountpoint=legacy</code> and edit just the initrd init script as above, and edit rc.6 to remove /etc/zfs/zpool.cache and try to export. We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to umount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrats! If this seems to go badly, and this might happen if the import fails as explained some before, then you will be on the initrd's rescue command line just before the part in init where it wants to mount zfs-root and switch_root to boot up. In this case, you typically got commands like these to do: If you get dumped to rescue because zpool import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zpool import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your zfs-root as readonly=on to /mnt, then "exit" to continue booting. In other emergency command lines, you might need to run the lines at the end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line in init is run like: <code>exec switch_root /mnt /sbin/init 1</code> Warning: the switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. However, the deletes should not cross filesystems, but only delete the contents of initramfs. Also, in rescue command line or anytime you have finished making changes and are about to reboot in some abnormal situation, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. ---- Upgrading: From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuild and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, kernel-headers, and kernel-source. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SPL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.27, if .27 is new kernel upgrade; you currently run on old, maybe .26) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.27 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname -r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. ---- More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> ---- Now available! "ZFS root (builtin)" wiki (aka "ZFS root, part II"): http://slackwiki.com/ZFS_root_(builtin) It is now possible to build the modules and a small initramfs into your kernel to have a fully-contained and bootable ZFS root kernel from a simple lilo entry. Good luck! 9d378ee353c4edefee1b852b230e5ff817581cd5 797 796 2012-09-19T08:42:03Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc11) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc4. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc11.tar.gz and zfs-0.6.0-rc11.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, try changing "order=dc" or hitting F12 at boot prompt and select the CD/DVD boot option. Note: The support for booting drives using if=scsi is not included with current versions of qemu. Booting scsi requires the 8xx_64.rom option-rom, which can be downloaded at [http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip LSI.com]. Unzip it, and then: <pre> cp 8xx_64.rom /usr/share/qemu # then run qemu-kvm with additional command line option: -option-rom 8xx_64.rom,bootindex=1 </pre> Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors inside the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc11_3.2.28-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc11_3.2.28-x86_64-1root.txz depmod cp spl-0.6.0rc11_3.2.28-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc11_3.2.28-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc11_3.2.28-x86_64-1root.txz depmod cp zfs-0.6.0rc11_3.2.28-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations in data storage pools (similar to a LVM volume group) backed by one or more virtual devices (similar to physical disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS mirror or raidz virtual device (vdev) types for reliability against hard drive failures. For example, a good configuration might be to use a USB memory stick (and a backup stick) for /boot that is plugged into an on-motherboard "Type A" USB connector. Then, use four whole hard drives in a raidz2 vdev as the initial storage space in the root zpool. At a later time, to add more storage space, additional whole four-drive raidz2 vdevs of the same size could be added to the zpool. It is recommended to only add the same vdev type (disk, mirror, or raidz|1|2|3) and size to a zpool since zfs stripes across the vdevs, and vdevs of different types/sizes do not stripe together optimally. After adding a vdev to your zpool, you might need to copy the new /etc/zfs/zpool.cache to your initrd-tree or initramfs-source (and rebuild/reinstall them) if you are using the cachefile to import your zpool. Using mirror vdevs would be similar to a raid10. Using 4-disk raidz2 vdevs would give the same storage space as raid10 while fully reliable against any double-disk failure; however, the raidz2 parity calculations results in higher CPU usage and/or lower performance. Because raidz vdevs cannot be grown by adding hard drives to them, and vdevs in a zpool are striped, it is important with ZFS to decide what type and size of vdev will be used in a zpool as the units of add-on storage space; it could be difficult to alter this decision later. Finally, on a real installation with raidz, data scrub should be scheduled to actively search for "latent defects" on the hard drives so that unknown read/write errors do not become known later during a disk swap/rebuild and result in the zpool becoming faulted (lost). If you decide to test raidz in qemu, consider making the qemu disk files on different physical disks on your host to avoid putting all the stress onto a single disk on your host. The raidz qemu disks that are all on a single physical hard drive will cause poor performance and stress on the disk due to the large amount of seek operations to access the stripes/columns in the raidz. Again, we'll keep it simple in this wiki and just make a root zpool that is just holding a single qemu disk that you've given to qemu to avoid stress on the host hard drive. But, if you really want to test raidz, you can do it by just making more qemu disks (with incremented index=X number) and making your zpool a raidz; there's no technical restriction here on the kind of vdevs in your root zpool. Make "slackzfs" guest, and boot it into the slackware installer to begin installation: <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc11_3.2.28-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc11_3.2.28-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc11_3.2.28-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc11_3.2.28-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is most likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Let's use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning: Part. # Size Partition Type Partition Name 4.0 MiB free space 1 512.0 MiB Linux filesystem boot 4.0 MiB free space 2 9.4 GiB Solaris /usr & Mac ZFS root 96.0 MiB free space </pre> The free space is left as a recommendation. The free space has potential uses for data recovery techniques, changing boot configuration, accomodating a replacement disk that is slightly smaller, and avoiding the end of the disk where GPT and other disk labels may need to claim space at the end of a drive to hold metadata. The "partition name" can be blank or any arbitrary name you'd like to give them. If you are going to test a ZFS mirror or raidz configuration, then you can repeat this same partitioning on each disk. For example, for a four-disk raidz2 with /dev/sd[abcd] you might do: <pre> sgdisk -R /dev/sdb /dev/sda sgdisk -G /dev/sdb sgdisk -R /dev/sdc /dev/sda sgdisk -G /dev/sdc sgdisk -R /dev/sdd /dev/sda sgdisk -G /dev/sdd </pre> Then, you could use the boot partitions /dev/sd[abcd]1 in a mdadm raid1 as your boot device: <pre> mdadm --create /dev/md0 -l 1 -n 4 /dev/sd[abcd]1 </pre> In this configuration, /dev/md0 is your 4-way mirror /boot device and is used as explained in the slackware [ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-current/README_RAID.TXT README_RAID.TXT]. The /dev/sd[abcd]2 would be given to ZFS for the raidz2 (instead of to mdadm raid). This is only an example and there are many possible configurations, including using whole un-partitioned disks; however, we will continue in this wiki with a simpler configuration with /dev/sda1 as a non-raid /boot device and /dev/sda2 in a non-raidz/non-mirror zpool. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> You can also use "legacy" for the mountpoint and the management of mounting and unmounting the pool will be expected to be done using the regular "mount" and "umount" commands: <pre> zfs set mountpoint=legacy zfs-root </pre> Later in the wiki, it is shown how to mount using "zfs mount" for mountpoint=none, and regular "mount" for mountpoint=legacy. Using mountpoint=legacy is probably the preferred setting for the zfs-root because you can use the normal mount and umount commands and do not have to change slackware /etc/rc.d/* scripts much, if any. The normal slackware scripts handle a root filesystem's mounting and remounting using the normal mount command. On creation, the zpool zfs-root is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export zpool commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on or remount read-only and sync disks. To avoid the requirement to import the zfs-root pool at startup, you can keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactivated without need to issue the zpool import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A warning about the zpool.cache file: Having /etc/zfs/zpool.cache present at zfs module load or module init time can be unsafe if the device names in /dev have changed since the last boot. Especially dangerous is if two hard drives have swapped names, like /dev/sda and /dev/sdb have swapped names. It is safer to not have a zpool.cache file on the system at boot and zfs module load/init time to guard against the possibility that the cache file is no longer correct. This wiki will try to show how you can use zpool.cache to import your pool if the regular zpool import command seems to always require you to force it. This wiki will also show how to not need a zpool.cache file to import normally. A zfs filesystem will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> If you are using <code>mountpoint=legacy</code> then the options for the mount command for ro or rw mounting will work as normal also and override whatever the readonly property is set to. The readonly property does serve as a default. Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override the <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how the two methods of mounting interact. When <code>mountpoint=legacy</code> is set, zfs expects the regular mount and umount commands to be used to mount and unmount the dataset with the assistance of the mount.zfs helper. For now, we will continue with <code>mountpoint=none</code>, but using legacy is also a good option. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. You can use <code>mountpoint=legacy"</code> to avoid this small problem if you are preferring to use the regular mount and umount commands on your zfs-root. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process is normal. <pre> # Finish installation and exit setup, but do NOT reboot! # There is still a lot to do before rebooting. umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Although the fstab option for fs_passno is 0 and indicates that root (/) should not be fsck, this fs_passno option in fstab is ignored during system startup for / in rc.S because rc.S explicity runs "fsck /" which does not look at options inside fstab. Fsck doesn't work on a zfs fs, and we will deal with that problem in a moment (see below). Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel: <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We installed spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz label = vmlinuz initrd = /boot/initrd.gz root = /dev/ram0 read-write # alternatively, the root and read-write lines # can be this one line of kernel parameters: # addappend = " root=/dev/ram0 rw " </pre> A note about initrd: The /boot/initrd.gz is a gzipped cpio archive containing a minimal BusyBox-based slackware root system that is sourced from /boot/initrd-tree. The commands "mkinitrd" and "mkinitrd -F" generates /boot/initrd-tree and /boot/initrd.gz. When using a initrd, the initial root device is normally set to root=/dev/ram0 (a ramfs block device) and allowed read-write. The kernel refers to devices in terms of "major" and "minor" numbers, and the ram0 device is assigned the block device major 1 and minor 0. This ram0 major/minor is written in hexadecimal as 0x0100 (256 in decimal). This hexademical number makes an appearance in /boot/initrd-tree/int where it runs: "echo 0x0100 > /proc/sys/kernel/real-root-dev". Echoing a device code to real-root-dev is part of a deprecated initrd mechanism, but is probably harmless to leave alone as slackware has it unless you know otherwise. More information about how initrd works can be found in: <pre> /usr/src/linux/Documentation/devices.txt (info about major:minor device numbers) /usr/src/linux/Documentation/initrd.txt (mostly obsolete info on old initrd) /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt (current info on new initrd, called initramfs) </pre> Advanced note about initrd: Slackware's mkinitrd package does not use the "pivot_root" command as documented in "initrd.txt", but instead uses "switch_root" provided by a project called BusyBox. The switch_root command changes the effective root filesystem from the initrd (unpacked in rootfs at /) to the new root filesystem (zfs-root mounted at /mnt); it overmounts rootfs / with zfs-root /mnt. The switch_root works as follows: delete everything in rootfs / (one filesystem only) that held initrd to free up ram memory, then use mount, chroot, and chdir to make the effective root change. In concept (as a shell script), the command "exec switch_root /mnt $INIT $RUNLEVEL" is performed as follows: <pre> find / -xdev | xargs rm -rf cd "$1" shift mount --move . / exec chroot . "$@" </pre> Here, typically INIT=/sbin/init RUNLEVEL=3. The 'exec' causes switch_root to take the place of the parent process having PID=1. In system calls, the switch_root looks similar to this: <pre> chdir("/mnt"); /* <insert code to unlink/rmdir all initrd files/directories * installed in rootfs / without crossing filesystems > */ mount(".", "/", NULL, MS_MOVE, NULL); chroot("."); chdir("/"); execl("/sbin/init", "3", (char*) NULL ); </pre> The kernel's rootfs / that contained initrd is never actually unmounted (it can't be) because it is built into the kernel and always exists as at least a tiny ramfs or tmpfs, so you can continue to see it in /proc/mounts. When you give lilo root=/dev/ram0 (a ramfs device), the kernel will actually use the internal rootfs, which is an instance of a tmpfs (if your kernel config includes tmpfs) or ramfs. The rootfs that is a tmpfs can by default use up to half of system ram. If rootfs is a ramfs, it can use up to almost all of system ram until the system panics. Typically, tmpfs is built into the kernel, and so depending on how much ram your computer has, the initrd-tree can probably be up to about half that size. Quite a lot of notes... now to continue on... Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:e1000:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module e1000 for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p modules could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit: <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it): <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt: <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage (NAS) where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time (that requires a "cluster" fs). ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. The hostid can also be passed to the SPL module with the module parameter <code>spl.spl_hostid=0xHHHHHHHH</code> where the Hs are a hexadecimal hostid value and this overrides any /etc/hostid or hostname/IP-based hostid value. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsible for configuring your block devices, mounting root at /mnt, and booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short hostname. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> We want to make sure the default is to mount readonly, then it mounts using defaults from /etc/fstab inside the initrd. Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted zfs-root, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for the zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using "zpool import" and "zpool export" commands at startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out the zpool import/export lines. Using zpool import/export is safer than using a zpool.cache, so we try to setup that way preferably. As mentioned, the zpool import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, zfs-root will not get mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually do: <pre> zpool import -f zfs-root mount zfs-root exit </pre> This will force import, overriding the conflict that zfs thinks may be happening. Next is mount. After this, exit to let the init script continue on to boot the system normally. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid (the SPL module actually tries to run the hostid command to get this value or it uses the spl.spl_hostid value that is given to it). In this setup so far, the value is based on the ip assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). This is a ip-based hostid value, a 32bit hexadecimal number. The hostid has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the function sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"): <pre> (on installer or initrd rescue shell) zpool import zfs-root zfs set readonly=off zfs-root mount zfs-root cp /etc/zfs/zpool.cache /mnt/etc/zfs/zpool.cache-initrd cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Words of caution, again: Doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could become invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. As will be spammed all over this wiki, using zpool.cache is not recommended if you can avoid it because it is potentially unsafe for your pool. Save /boot/initrd-tree/init and quit vi. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to remount rw or ro as readonly property changes: In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> If you are using <code>mountpoint=legacy</code> for zfs-root, you do not need to make the above change. In /etc/rc.d/rc.6: <pre> # before: echo "Unmounting local file systems." # add lines: rm -f /etc/zfs/zpool.cache echo "Removed /etc/zfs/zpool.cache" </pre> Remove /etc/zfs/zpool.cache on shutdown. This is recommended because if it is present when you import a pool, it might use this old cache to determine the device filenames in the pool, which may have changed filenames since the last boot, especially the non-persistent /dev/sd* device filenames. It is safest to avoid any usage of the zpool.cache file at boot in initramfs, zfs module load, and at zpool import of other pools. In /etc/rc.d/rc.6: <pre> # comment out the line: # /bin/mount -v -n -o remount,ro / # add the line: /sbin/zfs set readonly=on zfs-root </pre> If you are using <code>mountpoint=legacy</code> for zfs-root, you do not need to make the above change. In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> This attempts to export even though it cannot return success for the root pool. The attempt is still recorded in the zpool history, and even though it fails the pool may actually be marked as exported (not sure). For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem check. The rc.S script will complain a lot in many places about not being able to run fsck on the zfs-root. To disable all attempts to run fsck, we can simply create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! An alternative to using /etc/fastboot is to make the file <code>/sbin/fsck.zfs</code> that always just "does nothing successfully": <pre> #!/bin/sh exec /bin/true </pre> Or, it can be: <pre> #!/bin/sh exit 0 </pre> Or, just do: <pre> ln -s /bin/true /sbin/fsck.zfs </pre> This fsck helper has the advantage that you do not need to alter <code>rc.S</code> as much, or at all if you use zfs property <code>mountpoint=legacy</code> and the regular <code>mount</code> command on your zfs-root. With these ideas, no slackware /etc/rc.d/* files really need editing, but it is up to you how you want to experiment. I prefer to use <code>mountpoint=legacy</code> and edit just the initrd init script as above, and edit rc.6 to remove /etc/zfs/zpool.cache and try to export. We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to umount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrats! If this seems to go badly, and this might happen if the import fails as explained some before, then you will be on the initrd's rescue command line just before the part in init where it wants to mount zfs-root and switch_root to boot up. In this case, you typically got commands like these to do: If you get dumped to rescue because zpool import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zpool import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your zfs-root as readonly=on to /mnt, then "exit" to continue booting. In other emergency command lines, you might need to run the lines at the end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line in init is run like: <code>exec switch_root /mnt /sbin/init 1</code> Warning: the switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. However, the deletes should not cross filesystems, but only delete the contents of initramfs. Also, in rescue command line or anytime you have finished making changes and are about to reboot in some abnormal situation, first run: <pre> zfs set readonly=on zfs-root </pre> A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. ---- Upgrading: From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuild and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, kernel-headers, and kernel-source. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SPL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.28, if .28 is new kernel upgrade; you currently run on old, maybe .27) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.28 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname -r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. ---- More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> ---- Now available! "ZFS root (builtin)" wiki (aka "ZFS root, part II"): http://slackwiki.com/ZFS_root_(builtin) It is now possible to build the modules and a small initramfs into your kernel to have a fully-contained and bootable ZFS root kernel from a simple lilo entry. Good luck! 8223c1c539c32e62271f4b0b19d37eac2ceaf3fb 802 797 2012-09-24T08:39:14Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc11) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc4. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc11.tar.gz and zfs-0.6.0-rc11.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, try changing "order=dc" or hitting F12 at boot prompt and select the CD/DVD boot option. Note: The support for booting drives using if=scsi is not included with current versions of qemu. Booting scsi requires the 8xx_64.rom option-rom, which can be downloaded at [http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip LSI.com]. Unzip it, and then: <pre> cp 8xx_64.rom /usr/share/qemu # then run qemu-kvm with additional command line option: -option-rom 8xx_64.rom,bootindex=1 </pre> Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors inside the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc11_3.2.28-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc11_3.2.28-x86_64-1root.txz depmod cp spl-0.6.0rc11_3.2.28-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc11_3.2.28-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc11_3.2.28-x86_64-1root.txz depmod cp zfs-0.6.0rc11_3.2.28-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations in data storage pools (similar to a LVM volume group) backed by one or more virtual devices (similar to physical disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS mirror or raidz virtual device (vdev) types for reliability against hard drive failures. For example, a good configuration might be to use a USB memory stick (and a backup stick) for /boot that is plugged into an on-motherboard "Type A" USB connector. Then, use four whole hard drives in a raidz2 vdev as the initial storage space in the root zpool. At a later time, to add more storage space, additional whole four-drive raidz2 vdevs of the same size could be added to the zpool. It is recommended to only add the same vdev type (disk, mirror, or raidz|1|2|3) and size to a zpool since zfs stripes across the vdevs, and vdevs of different types/sizes do not stripe together optimally. After adding a vdev to your zpool, you might need to copy the new /etc/zfs/zpool.cache to your initrd-tree or initramfs-source (and rebuild/reinstall them) if you are using the cachefile to import your zpool. Using mirror vdevs would be similar to a raid10. Using 4-disk raidz2 vdevs would give the same storage space as raid10 while fully reliable against any double-disk failure; however, the raidz2 parity calculations results in higher CPU usage and/or lower performance. Because raidz vdevs cannot be grown by adding hard drives to them, and vdevs in a zpool are striped, it is important with ZFS to decide what type and size of vdev will be used in a zpool as the units of add-on storage space; it could be difficult to alter this decision later. Finally, on a real installation with raidz, data scrub should be scheduled to actively search for "latent defects" on the hard drives so that unknown read/write errors do not become known later during a disk swap/rebuild and result in the zpool becoming faulted (lost). If you decide to test raidz in qemu, consider making the qemu disk files on different physical disks on your host to avoid putting all the stress onto a single disk on your host. The raidz qemu disks that are all on a single physical hard drive will cause poor performance and stress on the disk due to the large amount of seek operations to access the stripes/columns in the raidz. Again, we'll keep it simple in this wiki and just make a root zpool that is just holding a single qemu disk that you've given to qemu to avoid stress on the host hard drive. But, if you really want to test raidz, you can do it by just making more qemu disks (with incremented index=X number) and making your zpool a raidz; there's no technical restriction here on the kind of vdevs in your root zpool. Make "slackzfs" guest, and boot it into the slackware installer to begin installation: <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc11_3.2.28-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc11_3.2.28-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc11_3.2.28-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc11_3.2.28-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is most likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Let's use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning: Part. # Size Partition Type Partition Name 4.0 MiB free space 1 512.0 MiB Linux filesystem boot 4.0 MiB free space 2 9.4 GiB Solaris /usr & Mac ZFS root 96.0 MiB free space </pre> The free space is left as a recommendation. The free space has potential uses for data recovery techniques, changing boot configuration, accomodating a replacement disk that is slightly smaller, and avoiding the end of the disk where GPT and other disk labels may need to claim space at the end of a drive to hold metadata. The "partition name" can be blank or any arbitrary name you'd like to give them. If you are going to test a ZFS mirror or raidz configuration, then you can repeat this same partitioning on each disk. For example, for a four-disk raidz2 with /dev/sd[abcd] you might do: <pre> sgdisk -R /dev/sdb /dev/sda sgdisk -G /dev/sdb sgdisk -R /dev/sdc /dev/sda sgdisk -G /dev/sdc sgdisk -R /dev/sdd /dev/sda sgdisk -G /dev/sdd </pre> Then, you could use the boot partitions /dev/sd[abcd]1 in a mdadm raid1 as your boot device: <pre> mdadm --create /dev/md0 -l 1 -n 4 /dev/sd[abcd]1 </pre> In this configuration, /dev/md0 is your 4-way mirror /boot device and is used as explained in the slackware [ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-current/README_RAID.TXT README_RAID.TXT]. The /dev/sd[abcd]2 would be given to ZFS for the raidz2 (instead of to mdadm raid). This is only an example and there are many possible configurations, including using whole un-partitioned disks; however, we will continue in this wiki with a simpler configuration with /dev/sda1 as a non-raid /boot device and /dev/sda2 in a non-raidz/non-mirror zpool. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> You can also use "legacy" for the mountpoint and the management of mounting and unmounting the pool will be expected to be done using the regular "mount" and "umount" commands: <pre> zfs set mountpoint=legacy zfs-root </pre> Later in the wiki, it is shown how to mount using "zfs mount" for mountpoint=none, and regular "mount" for mountpoint=legacy. Using mountpoint=legacy is probably the preferred setting for the zfs-root because you can use the normal mount and umount commands and do not have to change slackware /etc/rc.d/* scripts much, if any. The normal slackware scripts handle a root filesystem's mounting and remounting using the normal mount command. On creation, the zpool zfs-root is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export zpool commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on or remount read-only and sync disks. To avoid the requirement to import the zfs-root pool at startup, you can keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactivated without need to issue the zpool import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A warning about the zpool.cache file: Having /etc/zfs/zpool.cache present at zfs module load or module init time can be unsafe if the device names in /dev have changed since the last boot. Especially dangerous is if two hard drives have swapped names, like /dev/sda and /dev/sdb have swapped names. It is safer to not have a zpool.cache file on the system at boot and zfs module load/init time to guard against the possibility that the cache file is no longer correct. This wiki will try to show how you can use zpool.cache to import your pool if the regular zpool import command seems to always require you to force it. This wiki will also show how to not need a zpool.cache file to import normally. A zfs filesystem will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> If you are using <code>mountpoint=legacy</code> then the options for the mount command for ro or rw mounting will work as normal also and override whatever the readonly property is set to. The readonly property does serve as a default. Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override the <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how the two methods of mounting interact. When <code>mountpoint=legacy</code> is set, zfs expects the regular mount and umount commands to be used to mount and unmount the dataset with the assistance of the mount.zfs helper. For now, we will continue with <code>mountpoint=none</code>, but using legacy is also a good option. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. You can use <code>mountpoint=legacy"</code> to avoid this small problem if you are preferring to use the regular mount and umount commands on your zfs-root. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process is normal. <pre> # Finish installation and exit setup, but do NOT reboot! # There is still a lot to do before rebooting. umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Although the fstab option for fs_passno is 0 and indicates that root (/) should not be fsck, this fs_passno option in fstab is ignored during system startup for / in rc.S because rc.S explicity runs "fsck /" which does not look at options inside fstab. Fsck doesn't work on a zfs fs, and we will deal with that problem in a moment (see below). Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel: <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We installed spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz label = vmlinuz initrd = /boot/initrd.gz root = /dev/ram0 read-write # alternatively, the root and read-write lines # can be this one line of kernel parameters: # addappend = " root=/dev/ram0 rw " </pre> A note about initrd: The /boot/initrd.gz is a gzipped cpio archive containing a minimal BusyBox-based slackware root system that is sourced from /boot/initrd-tree. The commands "mkinitrd" and "mkinitrd -F" generates /boot/initrd-tree and /boot/initrd.gz. When using a initrd, the initial root device is normally set to root=/dev/ram0 (a ramfs block device) and allowed read-write. The kernel refers to devices in terms of "major" and "minor" numbers, and the ram0 device is assigned the block device major 1 and minor 0. This ram0 major/minor is written in hexadecimal as 0x0100 (256 in decimal). This hexademical number makes an appearance in /boot/initrd-tree/int where it runs: "echo 0x0100 > /proc/sys/kernel/real-root-dev". Echoing a device code to real-root-dev is part of a deprecated initrd mechanism, but is probably harmless to leave alone as slackware has it unless you know otherwise. More information about how initrd works can be found in: <pre> /usr/src/linux/Documentation/devices.txt (info about major:minor device numbers) /usr/src/linux/Documentation/initrd.txt (mostly obsolete info on old initrd) /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt (current info on new initrd, called initramfs) </pre> Advanced note about initrd: Slackware's mkinitrd package does not use the "pivot_root" command as documented in "initrd.txt", but instead uses "switch_root" provided by a project called BusyBox. The switch_root command changes the effective root filesystem from the initrd (unpacked in rootfs at /) to the new root filesystem (zfs-root mounted at /mnt); it overmounts rootfs / with zfs-root /mnt. The switch_root works as follows: delete everything in rootfs / (one filesystem only) that held initrd to free up ram memory, then use mount, chroot, and chdir to make the effective root change. In concept (as a shell script), the command "exec switch_root /mnt $INIT $RUNLEVEL" is performed as follows: <pre> find / -xdev | xargs rm -rf cd "$1" shift mount --move . / exec chroot . "$@" </pre> Here, typically INIT=/sbin/init RUNLEVEL=3. The 'exec' causes switch_root to take the place of the parent process having PID=1. In system calls, the switch_root looks similar to this: <pre> chdir("/mnt"); /* <insert code to unlink/rmdir all initrd files/directories * installed in rootfs / without crossing filesystems > */ mount(".", "/", NULL, MS_MOVE, NULL); chroot("."); chdir("/"); execl("/sbin/init", "3", (char*) NULL ); </pre> The kernel's rootfs / that contained initrd is never actually unmounted (it can't be) because it is built into the kernel and always exists as at least a tiny ramfs or tmpfs, so you can continue to see it in /proc/mounts. When you give lilo root=/dev/ram0 (a ramfs device), the kernel will actually use the internal rootfs, which is an instance of a tmpfs (if your kernel config includes tmpfs) or ramfs. The rootfs that is a tmpfs can by default use up to half of system ram. If rootfs is a ramfs, it can use up to almost all of system ram until the system panics. Typically, tmpfs is built into the kernel, and so depending on how much ram your computer has, the initrd-tree can probably be up to about half that size. Quite a lot of notes... now to continue on... Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:e1000:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module e1000 for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p modules could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit: <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it): <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt: <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage (NAS) where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time (that requires a "cluster" fs). ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. The hostid can also be passed to the SPL module with the module parameter <code>spl.spl_hostid=0xHHHHHHHH</code> where the Hs are a hexadecimal hostid value and this overrides any /etc/hostid or hostname/IP-based hostid value. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsible for configuring your block devices, mounting root at /mnt, and booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short hostname. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> We want to make sure the default is to mount readonly, then it mounts using defaults from /etc/fstab inside the initrd. Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted zfs-root, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for the zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using "zpool import" and "zpool export" commands at startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out the zpool import/export lines. Using zpool import/export is safer than using a zpool.cache, so we try to setup that way preferably. As mentioned, the zpool import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, zfs-root will not get mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually do: <pre> zpool import -f zfs-root mount zfs-root exit </pre> This will force import, overriding the conflict that zfs thinks may be happening. Next is mount. After this, exit to let the init script continue on to boot the system normally. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid (the SPL module actually tries to run the hostid command to get this value or it uses the spl.spl_hostid value that is given to it). In this setup so far, the value is based on the ip assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). This is a ip-based hostid value, a 32bit hexadecimal number. The hostid has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the function sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"): <pre> (on installer or initrd rescue shell) zpool import zfs-root zfs set readonly=off zfs-root mount zfs-root cp /etc/zfs/zpool.cache /mnt/etc/zfs/zpool.cache-initrd cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Words of caution, again: Doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could become invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. As will be spammed all over this wiki, using zpool.cache is not recommended if you can avoid it because it is potentially unsafe for your pool. Save /boot/initrd-tree/init and quit vi. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to remount rw or ro as readonly property changes: In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> If you are using <code>mountpoint=legacy</code> for zfs-root, you do not need to make the above change. In /etc/rc.d/rc.6: <pre> # before: echo "Unmounting local file systems." # add lines: rm -f /etc/zfs/zpool.cache echo "Removed /etc/zfs/zpool.cache" </pre> Remove /etc/zfs/zpool.cache on shutdown. This is recommended because if it is present when you import a pool, it might use this old cache to determine the device filenames in the pool, which may have changed filenames since the last boot, especially the non-persistent /dev/sd* device filenames. It is safest to avoid any usage of the zpool.cache file at boot in initramfs, zfs module load, and at zpool import of other pools. In /etc/rc.d/rc.6: <pre> # comment out the line: # /bin/mount -v -n -o remount,ro / # add the line: /sbin/zfs set readonly=on zfs-root </pre> If you are using <code>mountpoint=legacy</code> for zfs-root, you do not need to make the above change. In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> This attempts to export even though it cannot return success for the root pool. The attempt is still recorded in the zpool history, and even though it fails the pool may actually be marked as exported (not sure). For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem check. The rc.S script will complain a lot in many places about not being able to run fsck on the zfs-root. To disable all attempts to run fsck, we can simply create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! An alternative to using /etc/fastboot is to make the file <code>/sbin/fsck.zfs</code> that always just "does nothing successfully": <pre> #!/bin/sh exec /bin/true </pre> Or, it can be: <pre> #!/bin/sh exit 0 </pre> Or, just do: <pre> ln -s /bin/true /sbin/fsck.zfs </pre> This fsck helper has the advantage that you do not need to alter <code>rc.S</code> as much, or at all if you use zfs property <code>mountpoint=legacy</code> and the regular <code>mount</code> command on your zfs-root. With these ideas, no slackware /etc/rc.d/* files really need editing, but it is up to you how you want to experiment. I prefer to use <code>mountpoint=legacy</code> and edit just the initrd init script as above, and edit rc.6 to remove /etc/zfs/zpool.cache and try to export. We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to umount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrats! If this seems to go badly, and this might happen if the import fails as explained some before, then you will be on the initrd's rescue command line just before the part in init where it wants to mount zfs-root and switch_root to boot up. In this case, you typically got commands like these to do: If you get dumped to rescue because zpool import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zpool import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your zfs-root as readonly=on to /mnt, then "exit" to continue booting. An alternative rescue shell on the initrd can be started as follows: <pre> boot: vmlinuz rdinit=/bin/sh </pre> This puts you into a sh shell inside the initrd, and the normal /init script is not run at all. In this shell, you can fix problems and then attempt to start the system normally as follows: <pre> exec /init </pre> This runs the normal rdinit program, "execing" it so that it takes process ID (PID) 1 of your sh shell, which is the required PID for the init program. In other emergency command lines, you might need to run the lines at the end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd could fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line in init is run like: <code>exec switch_root /mnt /sbin/init 1</code> Warning: the switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. However, the deletes should not cross filesystems, but only delete the contents of initramfs. Also, in rescue command line or anytime you have finished making changes and are about to reboot in some abnormal situation, first run: <pre> zfs set readonly=on zfs-root </pre> If you are using <code>mountpoint=legacy</code> for zfs-root, then you may want to use <code>readonly=off</code> and use the options to the <code>mount</code> command to control ro|rw mounting. With <code>mountpoint=legacy</code> and <code>readonly=on</code> used together, there can be a contradiction between how the kernel actually mounts zfs-root (ro according to the readonly property) and how the userspace mount command and /etc/mtab attempt to mount the zfs-root (if you give <code>-o rw</code>). The kernel might actually mount ro, even when you have told the mount command to mount rw. The /etc/mtab can erroneously report rw, while the kernel's /proc/mounts file reports the actual mount as ro. Again, the two methods of mounting a zfs fs, either "legacy" <code>mount</code> command or by using the <code>zfs set mountpoint</code> can conflict with each other on the mode of mounting. If you create a zfs filesystem under zfs-root, like <code>zfs create "zfs-root/movies"</code> and then try to mount it, it may have inherited <code>mountpoint=legacy</code> and <code>readonly=on</code> from zfs-root, and it may mount ro even if you use the rw mount option: in this case, you have to do another command <code>mount -o remount,rw "zfs-root/movies"</code> to make it actually switch to rw (kind of weird!). A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. ---- Upgrading: From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuild and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, kernel-headers, and kernel-source. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SPL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.28, if .28 is new kernel upgrade; you currently run on old, maybe .27) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.28 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname -r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. ---- More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> ---- Now available! "ZFS root (builtin)" wiki (aka "ZFS root, part II"): http://slackwiki.com/ZFS_root_(builtin) It is now possible to build the modules and a small initramfs into your kernel to have a fully-contained and bootable ZFS root kernel from a simple lilo entry. Good luck! b69bab17357d2637a89a69670f8d69d582742e68 803 802 2012-09-24T14:44:46Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] If you have heard about the ZFS filesystem and you're curious to try it out, then you can try it on slackware64, thanks to the ZFSonLinux.org project! In this article, an example is shown of how to install slackware64 14.0 onto a ZFS root filesystem (zfs-root) inside a QEMU virtual machine for testing purposes. It is recommended that you install qemu and learn how to use it to test a ZFS installation before you decide to use it on real hardware. A slackbuild for qemu can be found on slackbuilds.org. If you have a processor that supports Intel VT-x or AMD AMD-V virtualization acceleration (try modprobe kvm-intel or modprobe kvm-amd), then use the slackbuild for qemu-kvm. This article isn't going to go into any detail on actually using ZFS or what kinds of installation options and settings might be optimal. This article just presents an example of how to get started with ZFS on slackware. At this time of writing, ZFSonLinux is at "release candidate" (version 0.6.0-rc11) development stage, and many issues can occur. See the ZFSonLinux.org web site and the issues tracker for an idea about the current issues. There is also an irc channel on irc.freenode.net, #zfsonlinux, for discussion of issues and help. Although not required, it is helpful to keep a local mirror of slackware64 on your system. Having a local mirror makes it easier to upgrade to slackware64-current or to patches/* in a release. To help manage your own local slackware mirror and generate your own CD and DVD slackware installers, see http://alien.slackbook.org/blog/local-slackware-mirror/. In this article, we use a slackware64-current DVD image file as the qemu cdrom device media for the installation of the slackware guest. This was tested at slackware64-current = slackware64 14.0rc4. You can obtain a slackware DVD image using a torrent, buy the DVD from slackware.com, or generate your own DVD image file using the mirror script. For an actual DVD, you can pass your DVD device (e.g., /dev/sr0) as the qemu cdrom device. For a DVD image file, pass the image file as the qemu cdrom device. The ZFSonLinux packages are not included in slackware at this time. There are two packages involved: spl and zfs. The first, spl, is "Solaris Porting Layer" and must be installed on the system before zfs can be compiled. The source code tarballs for these are at ZFSonLinux.org. At this time of writing, they are spl-0.6.0-rc11.tar.gz and zfs-0.6.0-rc11.tar.gz. At this point, it is assumed you have qemu installed, have obtained a slackware64-current/14.0 DVD, and have downloaded spl and zfs tarballs to your host system. The first step now is, if your host is not slackware64-current/14.0 (the same as the guest will be), then you need to create a minimal development slackware64 guest system in qemu for just the purpose of compiling and packaging the spl and zfs slackware packages and transferring a copy of these packages back onto your host system to use later to install onto zfs during the slackware install process. From this point onward, instructions become a bit terse and mostly limited to examples of the commands you might use to complete tasks. You are encouraged to examine what each command does by reading the command's man pages. For example, the command "man qemu" can show you most of what you need to know about running qemu on the command line. So, here's an example of how you might build the spl and zfs packages, starting in your home directory: <pre> (on host) cd ~ mkdir qemu cd qemu mkdir slackdevel cd slackdevel mkdir packages cp ~/spl-*.tar.gz packages cp ~/zfs-*.tar.gz packages qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> When you need to change boot to cd or disk, try changing "order=dc" or hitting F12 at boot prompt and select the CD/DVD boot option. Note: The support for booting drives using if=scsi is not included with current versions of qemu. Booting scsi requires the 8xx_64.rom option-rom, which can be downloaded at [http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip LSI.com]. Unzip it, and then: <pre> cp 8xx_64.rom /usr/share/qemu # then run qemu-kvm with additional command line option: -option-rom 8xx_64.rom,bootindex=1 </pre> Qemu should boot into the install-dvd, and now perform a very ordinary slackware64 install onto /dev/sda. Install d package set and most others, but package sets x, kde, xfce not really needed. First note: examples here use tools from the gptfdisk package (gdisk, sgdisk, cgdisk) to partition the disk with GUID partition table (GPT) format. GPT might not be too familiar to everyone, who mostly have only used MBR partitions with fdisk. In the slackware installations this author has tested in qemu, using GPT partitions has caused no problems with lilo or other tools used in slackware. GPT disk labels support creating up to 128 partitions and support disks larger than 2TB (the limit of MBR fdisk). LILO installs into the first 440 bytes on /dev/sda, inside a GPT "protective MBR" that serves to provide compatibility with MBR bootloaders like lilo. LILO uses LBA32 sector addressing and can see all 512-byte sectors inside the first 2TB of a disk. So long as the /boot partition is within the first 2TB of a disk, lilo can work on a disk larger than 2TB. Unlike the common default of fdisk to start the first partition at sector 63, which is not aligned with the 4KiB sector size of Advanced Format hard disks, gdisk's default is to start partitions at 2048 sector (1MiB) boundaries which are also 4KiB aligned. Using gdisk GPT works on all disks and is compatible with using Advanced Format hard disks larger than 2TB. More information about GPT disk label format can be found on wikipedia.org. For those that have used grub instead of lilo, grub installation is different with GPT than with MBR, and grub requires a GPT partition of type grub-bios or 0xEF02 "BIOS Boot Partition" of about 8MiB where it can install it's additional bootloader stages because grub cannot embed in sectors 1-62 on GPT where GPT keeps it's partition tables. On MBR, sectors 1-62 were normally reserved space for bootloaders to keep a 2nd stage. For this purpose of development guest, just create a simple 1-partition system, /dev/sda1, and do a simple slackware install on it. Don't bother with swap or separate /boot unless you want to: <pre> (on install-dvd) cgdisk /dev/sda setup reboot </pre> When this simple development guest boots, login as root, and continue: <pre> (on qemu guest) cd ~ mkdir packages mount hostpackages -t 9p -o trans=virtio packages echo --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share > configure-options mkdir src cd src mkdir install tar xvzf ~/packages/spl-*.tar.gz cd spl-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../spl-0.6.0rc11_3.2.28-x86_64-1root.txz) cd .. rm -r install installpkg spl-0.6.0rc11_3.2.28-x86_64-1root.txz depmod cp spl-0.6.0rc11_3.2.28-x86_64-1root.txz ~/packages mkdir install tar xvzf ~/packages/zfs-*.tar.gz cd zfs-* ./configure $( cat ~/configure-options ) make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-<version>_<kernel_version>-x86_64-<build_id>.txz (e.g., makepkg ../zfs-0.6.0rc11_3.2.28-x86_64-1root.txz) cd .. rm -r install installpkg zfs-0.6.0rc11_3.2.28-x86_64-1root.txz depmod cp zfs-0.6.0rc11_3.2.28-x86_64-1root.txz ~/packages </pre> At this point spl and zfs packages are copied back to the host in the packages directory. Also, spl and zfs are installed in this simple development guest, so one could begin to experiment with zfs pools and datasets but while the root fs is whatever you made it during setup (probably the default, ext4). This development guest isn't really needed anymore, so it can be deleted: <pre> halt (exit qemu: ctrl-alt-2 then enter quit at QEMU command prompt) (on host) rm disk1.raw dvd.iso mv packages .. cd .. rmdir slackdevel </pre> Now that we have the spl and zfs packages on the host, it is possible to copy them into your local slackware64 mirror and then generate your own install DVD image that includes them. For example, change to the directory that contains the slackware README files, and create a "addon" directory and copy the spl and zfs slackware packages into there. Then, generate the DVD image using a command such as $( ./mirror-slackware-current.sh -i ) from where you have this script configured to maintain your local mirror. We can also just continue to access them inside the installer using qemu's virtfs option. When you are going to do a real installation onto real hardware, you need to generate and burn your own DVD that includes the packages. It is time to begin the installation of slackware64 on a ZFS root, assuming either you have regenerated dvd.iso with zfs packages in addon/* or we access the zfs packages while in the installer using qemu's virtfs to the host's packages directory. ZFS supports creating complex data storage configurations in data storage pools (similar to a LVM volume group) backed by one or more virtual devices (similar to physical disks and raid arrays) and containing one or more datasets (similar to mounted filesystems, logical volume devices, or snapshots). But here, we keep it simple and will install on just a single disk device. On a real ZFS installation, users will typically want to use the ZFS mirror or raidz virtual device (vdev) types for reliability against hard drive failures. For example, a good configuration might be to use a USB memory stick (and a backup stick) for /boot that is plugged into an on-motherboard "Type A" USB connector. Then, use four whole hard drives in a raidz2 vdev as the initial storage space in the root zpool. At a later time, to add more storage space, additional whole four-drive raidz2 vdevs of the same size could be added to the zpool. It is recommended to only add the same vdev type (disk, mirror, or raidz|1|2|3) and size to a zpool since zfs stripes across the vdevs, and vdevs of different types/sizes do not stripe together optimally. After adding a vdev to your zpool, you might need to copy the new /etc/zfs/zpool.cache to your initrd-tree or initramfs-source (and rebuild/reinstall them) if you are using the cachefile to import your zpool. Using mirror vdevs would be similar to a raid10. Using 4-disk raidz2 vdevs would give the same storage space as raid10 while fully reliable against any double-disk failure; however, the raidz2 parity calculations results in higher CPU usage and/or lower performance. Because raidz vdevs cannot be grown by adding hard drives to them, and vdevs in a zpool are striped, it is important with ZFS to decide what type and size of vdev will be used in a zpool as the units of add-on storage space; it could be difficult to alter this decision later. Finally, on a real installation with raidz, data scrub should be scheduled to actively search for "latent defects" on the hard drives so that unknown read/write errors do not become known later during a disk swap/rebuild and result in the zpool becoming faulted (lost). If you decide to test raidz in qemu, consider making the qemu disk files on different physical disks on your host to avoid putting all the stress onto a single disk on your host. The raidz qemu disks that are all on a single physical hard drive will cause poor performance and stress on the disk due to the large amount of seek operations to access the stripes/columns in the raidz. Again, we'll keep it simple in this wiki and just make a root zpool that is just holding a single qemu disk that you've given to qemu to avoid stress on the host hard drive. But, if you really want to test raidz, you can do it by just making more qemu disks (with incremented index=X number) and making your zpool a raidz; there's no technical restriction here on the kind of vdevs in your root zpool. Make "slackzfs" guest, and boot it into the slackware installer to begin installation: <pre> (on host) mkdir slackzfs mv packages slackzfs/ cd slackzfs qemu-img create disk1.raw 10G ln -s ~/slackware64-current-install-dvd.iso dvd.iso qemu-kvm \ -option-rom 8xx_64.rom,bootindex=1 \ -no-quit \ -no-shutdown \ -boot order=cd,menu=on \ -m 2G \ -cpu host \ -smp sockets=1,cores=4 \ -net nic,model=e1000 -net user \ -cdrom dvd.iso \ -drive format=raw,media=disk,cache=none,aio=native,if=scsi,index=0,file=disk1.raw \ -virtfs local,path=./packages/,security_model=none,mount_tag=hostpackages </pre> The install-dvd should boot, and then begin installation steps on the installer command line: <pre> (on install-dvd) # mount the install-dvd mkdir /dvd mount /dev/sr0 /dvd # install coreutils, which provides the "hostid" command needed to load the spl module installpkg /dvd/slackware64/a/coreutils-8.17-x86_64-1.txz # install kmod package which includes "depmod" command and others installpkg /dvd/slackware64/a/kmod-9-x86_64-2.txz depmod # install the full kernel modules so you can load 9p filesystem and use it if you want # .. you might keep the zfs modules packages off the dvd and use a plain slack dvd installpkg /dvd/slackware64/a/kernel-modules-*.txz depmod # install bash and libtermcap because udev rules in zfs use bash scripts installpkg /dvd/slackware64/a/bash-*.txz installpkg /dvd/slackware64/l/libtermcap-*.txz # install spl and zfs that you have copied into the mirror before running the DVD creation installpkg /dvd/addon/spl-0.6.0rc11_3.2.28-x86_64-1root.txz depmod installpkg /dvd/addon/zfs-0.6.0rc11_3.2.28-x86_64-1root.txz depmod #Or: mkdir /packages find /lib/modules/ | grep 9p lsmod # check that 9p modules load, mainly 9pnet_virtio modprobe 9pnet_virtio mount hostpackages -t 9p -o trans=virtio /packages installpkg /packages/spl-0.6.0rc11_3.2.28-x86_64-1root.txz depmod installpkg /packages/zfs-0.6.0rc11_3.2.28-x86_64-1root.txz depmod modprobe zfs </pre> Now zfs tools: "zpool" and "zfs" should work in the live installer. On the installer, there can be trouble seeing man pages, so install: <pre> installpkg /dvd/slackware64/ap/man-*.txz installpkg /dvd/slackware64/ap/groff-*.txz installpkg /dvd/slackware64/a/less-*.txz export MANPATH=/usr/man:/usr/share/man </pre> The manual pages should be readable: <pre> man zpool man zfs </pre> After seeing the man pages, we should be fully ready to continue to setup on ZFS. <pre> (still on install-dvd) ls -l /dev/sd* </pre> Make sure the disk devices you expect are there. We'll use sda and make boot (/boot on /dev/sda1) and root (/ on /dev/sda2) partitions. First, some background info: A ZFS filesystem is not supported by lilo as the filesystem containing /boot, which holds lilo's 2nd stage and the linux kernel files. The on-disk format of a ZFS filesystem is often a complex raid configuration where even if lilo understood ZFS it would likely require /boot to reside in only certain simple ZFS configurations to be plainly readable to lilo. As things are, a linux root installed in a partition with ZFS filesystem needs /boot to be on another partition with a filesystem that lilo understands, such as ext4 fs. In addition, because the spl and zfs modules are not built into the kernel, and the zfs startup requires some configuration to mount the zfs root, an initial ram/root filesystem (initrd) is needed. The initrd is a gzip compressed cpio archive file that contains a small linux root operating system that is decompressed into a ramfs block device at boot up and takes initial control of the system. The initrd contains an init script that configures devices in devtmpfs mounted at /dev. For example, if using mdadm, lvm, luks, losetup, and now zfs, this init script runs all the commands to create or start these devices (one of which is the root device), mounts the root device, and then transfers system control to the init script in the mounted root filesystem. The ramfs-based root environment on the booted install-dvd or booted initrd image (in rescue command line) are small slackware installations that exist only in ram and are temporary, but while inside them you can install, upgrade, and remove slackware packages inside them using the regular package management tools; this allows you access to any kernel modules and programs as needed inside these ramfs root. Packages can be installed, upgraded, or removed permanantly in the initrd image file to manage the programs and modules required during the initrd boot stage. Also from within these ramfs initial root environments, once the root device is mounted, chroot can be used to work on the mounted root system as if it were booted; this allows one to fix problems that are occuring in the root fs init scripts that cause normal booting to fail, or to install a kernel and/or modules etc. Now on to partitioning: <pre> cgdisk /dev/sda </pre> Here, cgdisk looks just like cfdisk, but it makes GPT partitions. Make a partition for /boot that is about 512MiB of whatever partition type you like (8300 "Linux filesystem" is fine), or make it type bf07 "Solaris Reserved 1" if you want ZFS to maybe see the disk as if it was given as a whole disk to ZFS. Make a second partition using the remaining space with partition type bf01 "Solaris ZFS". Currently, when ZFSonLinux is given a whole disk device like /dev/sdb to use, it will automatically GPT partition it with a bf01 partition #1 that is the whole disk except a small 8MiB type bf07 partition #9 at the end of the disk (/dev/sdb1 and /dev/sb9). The small 8MiB type bf07 partition #9 is most likely reserved for use by bootloaders, like lilo, to have a /boot or other boot-related files kept there. For example, you might have /dev/sda that is totally non-ZFS for booting and /dev/sdb passed to ZFS whole where it automatically partitions sdb, but you can just use one disk here and make partitions. Let's use type 8300 for /boot to be sure nothing is confused: <pre> We'll continue with this partitioning: Part. # Size Partition Type Partition Name 4.0 MiB free space 1 512.0 MiB Linux filesystem boot 4.0 MiB free space 2 9.4 GiB Solaris /usr & Mac ZFS root 96.0 MiB free space </pre> The free space is left as a recommendation. The free space has potential uses for data recovery techniques, changing boot configuration, accomodating a replacement disk that is slightly smaller, and avoiding the end of the disk where GPT and other disk labels may need to claim space at the end of a drive to hold metadata. The "partition name" can be blank or any arbitrary name you'd like to give them. If you are going to test a ZFS mirror or raidz configuration, then you can repeat this same partitioning on each disk. For example, for a four-disk raidz2 with /dev/sd[abcd] you might do: <pre> sgdisk -R /dev/sdb /dev/sda sgdisk -G /dev/sdb sgdisk -R /dev/sdc /dev/sda sgdisk -G /dev/sdc sgdisk -R /dev/sdd /dev/sda sgdisk -G /dev/sdd </pre> Then, you could use the boot partitions /dev/sd[abcd]1 in a mdadm raid1 as your boot device: <pre> mdadm --create /dev/md0 -l 1 -n 4 /dev/sd[abcd]1 </pre> In this configuration, /dev/md0 is your 4-way mirror /boot device and is used as explained in the slackware [ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-current/README_RAID.TXT README_RAID.TXT]. The /dev/sd[abcd]2 would be given to ZFS for the raidz2 (instead of to mdadm raid). This is only an example and there are many possible configurations, including using whole un-partitioned disks; however, we will continue in this wiki with a simpler configuration with /dev/sda1 as a non-raid /boot device and /dev/sda2 in a non-raidz/non-mirror zpool. Create a zpool called zfs-root: <pre> zpool create -m none zfs-root /dev/sda2 </pre> A zpool created like this, the normal way, is a kernel-internal block device that contains already a zfs filesystem. There is normally no entry in /dev for this device. However, it can still be referenced as a mountable device similar to how devtmpfs, proc, and sysfs are also kernel-internal mountable block devices. The -m option told zpool not to automatically mount it anywhere, and without -m the default is to always automatically mount to /zfs-root. These kinds of details are explained better elsewhere. For this situation, we do not want it automounted. Because a zpool itself is a useable zfs fs, it has a full set of zfs "properties" to set options about the filesystem, perhaps similar to tune2fs. The "mountpoint=<some place to mount>" is one such property. We want it set to the special value "none": <pre> zfs get mountpoint zfs-root zfs set mountpoint=none zfs-root </pre> You can also use "legacy" for the mountpoint and the management of mounting and unmounting the pool will be expected to be done using the regular "mount" and "umount" commands: <pre> zfs set mountpoint=legacy zfs-root </pre> Later in the wiki, it is shown how to mount using "zfs mount" for mountpoint=none, and regular "mount" for mountpoint=legacy. Using mountpoint=legacy is probably the preferred setting for the zfs-root because you can use the normal mount and umount commands and do not have to change slackware /etc/rc.d/* scripts much, if any. The normal slackware scripts handle a root filesystem's mounting and remounting using the normal mount command. On creation, the zpool zfs-root is "imported" and has a zpool status that can be viewed: <pre> zpool status zfs-root zpool export zfs-root zpool status zfs-root # Now there is no status. zpool import zfs-root # Now it is back. </pre> When a zpool is imported, it has it's current configuration cached in a file /etc/zfs/zpool.cache. When a zpool is exported, then it's entries in the cache file are removed and the cache file is deleted if it becomes empty. So long as the zfs kernel modules see this cache file and valid cache data inside it, ZFS considers the described zpools in the cache file to be valid as imported zpools. If the zpool.cache file is present at the time the zfs modules are loaded, then there is no further need to use the import and export zpool commands at system startup and shutdown. With root on a zfs, it is not possible to export the pool that root is on, but this is not a problem. At shutdown, the safe procedure will be to set the zfs-root property readonly=on or remount read-only and sync disks. To avoid the requirement to import the zfs-root pool at startup, you can keep a copy of the zpool.cache file to later copy onto the initrd image to read at modules load time to have the pool reactivated without need to issue the zpool import command: <pre> cp /etc/zfs/zpool.cache /etc/zfs/zpool.cache-initrd </pre> A warning about the zpool.cache file: Having /etc/zfs/zpool.cache present at zfs module load or module init time can be unsafe if the device names in /dev have changed since the last boot. Especially dangerous is if two hard drives have swapped names, like /dev/sda and /dev/sdb have swapped names. It is safer to not have a zpool.cache file on the system at boot and zfs module load/init time to guard against the possibility that the cache file is no longer correct. This wiki will try to show how you can use zpool.cache to import your pool if the regular zpool import command seems to always require you to force it. This wiki will also show how to not need a zpool.cache file to import normally. A zfs filesystem will not normally allow you to mount over any files. The mountpoint is expected to be an empty directory. Remove any junk files inside the installer's /mnt because zfs won't mount over any files: <pre> rm /mnt/README </pre> The directory /mnt is where the slackware setup expects you to mount your root for installation. Controlling whether a zfs fs is to be mounted read-only or read-write is best managed by setting the readonly property while it is not yet mounted: <pre> zfs set readonly=on zfs-root zfs set readonly=off zfs-root </pre> If you are using <code>mountpoint=legacy</code> then the options for the mount command for ro or rw mounting will work as normal also and override whatever the readonly property is set to. The readonly property does serve as a default. Slackware expects root to be mounted readonly when /etc/rc.d/rc.S runs during normal startup, so later this is used to satisfy slackware's expectation to avoid rc.S complaining. The zfs-root can be mounted and unmounted in two different ways: <pre> zfs set mountpoint=/mnt zfs-root zfs set mountpoint=none zfs-root # or mount zfs-root -t zfs /mnt umount /mnt </pre> If it is already mounted and you want to change it to mount somewhere else, it is best to transition it to unmounted first, then mount it in the new place. The mount options <code>-o ro, -o rw, -o remount,ro, and -o remount,rw </code> can also be used and will override the <code>readonly=on|off</code> property without altering the property value. This can be confusing until you are familiar with how the two methods of mounting interact. When <code>mountpoint=legacy</code> is set, zfs expects the regular mount and umount commands to be used to mount and unmount the dataset with the assistance of the mount.zfs helper. For now, we will continue with <code>mountpoint=none</code>, but using legacy is also a good option. Now, let's continue some, and mount to /mnt using the current <code>readonly=off</code> setting (rw mount): <pre> zfs set mountpoint=/mnt zfs-root </pre> This method of mounting will show the most detailed mount options in /etc/mtab. They are the mount options that zfs thinks are proper, and they are probably what should be kept in /etc/fstab for zfs-root until we know better. <pre> cat /etc/mtab >> /etc/fstab </pre> Now edit /etc/fstab to make sure it looks right, and remove the "rw" mount option, because we want to let it use a default for that, which will come from how we set the readonly= property most of the time. Unmount again: <pre> zfs set mountpoint=none zfs-root </pre> Mount again, now using all options from /etc/fstab: <pre> mount zfs-root </pre> It should be mounted at /mnt, and touch /mnt/t should allow you to make the file t. Then rm it: rm /mnt/t For installation, we want to make sure it is mounted read-write. After installation, it should mount readonly inside the initrd. Sometimes there can be problems using the mount command, and then you can try it with the -i option: <pre> mount -i zfs-root mount -i zfs-root -t zfs /mnt </pre> but, you should not have to use -i. When using -i makes it work, it performs an "internal-only" mount and does not use any mount.<fstype> helper scripts that might be on the system. You can use <code>mountpoint=legacy"</code> to avoid this small problem if you are preferring to use the regular mount and umount commands on your zfs-root. Setup the /boot device: <pre> mkfs.ext4 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot </pre> We have both root and boot mounted where the slackware installer expects them. Unmount the dvd so setup can find it normally: <pre> umount /dev/sr0 setup </pre> In the setup, skip straight to TARGET selection for the root device, but the setup doesn't see or understand the zfs-root, so it is not listed. This does not matter because we have mounted it already. Just skip down to a slot that say to continue, and continue on with setup. Because TARGET is skipped, you may not see the ADDITIONAL prompt (or if so, skip it too) where normally you give /dev/sda1 and have it mounted as /boot. This is also okay because we have mounted /mnt/boot already. Because we did not give TARGET the root device or say what device /boot is on, the lilo installation will fail, or you can skip it. Otherwise, this installation process is normal. <pre> # Finish installation and exit setup, but do NOT reboot! # There is still a lot to do before rebooting. umount /dev/sr0 </pre> At this point, it is assumed that the setup has completed installing into /mnt. Congrats! You've installed slackware into a ZFS root! The next steps are to prepare to use "chroot /mnt" and finish up the configuration on the installed root system and then be able to reboot onto the completed installation. Before doing chroot, copy some files from the setup environment into /mnt. Copy the current installer /etc/fstab for later use inside the initrd. This fstab is what is proper inside the initrd, except remove option "rw" (if not done already). <pre> cp /etc/fstab /mnt/etc/fstab.initrd </pre> The fstab.initrd will look like: <pre> proc /proc proc defaults 0 0 zfs-root /mnt zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 </pre> In the initrd, we want zfs-root to mount to /mnt. Create /mnt/etc/fstab: <pre> cat /etc/mtab >> /mnt/etc/fstab vi /mnt/etc/fstab </pre> Using vi started above, edit /mnt/etc/fstab and make it have lines such as: <pre> zfs-root / zfs defaults,atime,dev,exec,suid,xattr,nomand,zfsutil 0 0 /dev/sda1 /boot ext4 defaults 0 2 </pre> These two lines in <code>/mnt/etc/fstab</code> are how the mounts should be looking when root is booted. Although the fstab option for fs_passno is 0 and indicates that root (/) should not be fsck, this fs_passno option in fstab is ignored during system startup for / in rc.S because rc.S explicity runs "fsck /" which does not look at options inside fstab. Fsck doesn't work on a zfs fs, and we will deal with that problem in a moment (see below). Mount some special mounts before chroot: <pre> mount -t devtmpfs none /mnt/dev mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys </pre> Make sure /boot is mounted: <pre> mount /dev/sda1 /mnt/boot </pre> If you had mounted a 9p fs share to access spl and zfs packages, then unmount that now: umount /packages Ready, now: <pre> chroot /mnt </pre> At this point, you should be on the installed system, and now try to configure mkinitrd and lilo. First, switch to use the generic kernel: <pre> cd /boot rm System.map config vmlinuz ln -s System.map-gen* System.map ln -s config-gen* config ln -s vmlinuz-gen* vmlinuz </pre> We installed spl and zfs inside the live ramfs install-dvd environment, but not yet have we installed them into the root system: <pre> mount /dev/sr0 /mnt/cdrom depmod installpkg /mnt/cdrom/addon/spl-*.txz depmod installpkg /mnt/cdrom/addon/zfs-*.txz depmod </pre> If instead, you used a 9p share to access the spl and zfs packages, then repeat that procedure here to install them onto the root system. Setup lilo: edit /etc/lilo.conf so it is like: <pre> lba32 append = " vt.default_utf8=1" boot = /dev/sda message = /boot/boot_message.txt prompt timeout = 1200 change-rules reset vga = normal image = /boot/vmlinuz label = vmlinuz initrd = /boot/initrd.gz root = /dev/ram0 read-write # alternatively, the root and read-write lines # can be this one line of kernel parameters: # addappend = " root=/dev/ram0 rw " </pre> A note about initrd: The /boot/initrd.gz is a gzipped cpio archive containing a minimal BusyBox-based slackware root system that is sourced from /boot/initrd-tree. The commands "mkinitrd" and "mkinitrd -F" generates /boot/initrd-tree and /boot/initrd.gz. When using a initrd, the initial root device is normally set to root=/dev/ram0 (a ramfs block device) and allowed read-write. The kernel refers to devices in terms of "major" and "minor" numbers, and the ram0 device is assigned the block device major 1 and minor 0. This ram0 major/minor is written in hexadecimal as 0x0100 (256 in decimal). This hexademical number makes an appearance in /boot/initrd-tree/int where it runs: "echo 0x0100 > /proc/sys/kernel/real-root-dev". Echoing a device code to real-root-dev is part of a deprecated initrd mechanism, but is probably harmless to leave alone as slackware has it unless you know otherwise. More information about how initrd works can be found in: <pre> /usr/src/linux/Documentation/devices.txt (info about major:minor device numbers) /usr/src/linux/Documentation/initrd.txt (mostly obsolete info on old initrd) /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt (current info on new initrd, called initramfs) </pre> Advanced note about initrd: Slackware's mkinitrd package does not use the "pivot_root" command as documented in "initrd.txt", but instead uses "switch_root" provided by a project called BusyBox. The switch_root command changes the effective root filesystem from the initrd (unpacked in rootfs at /) to the new root filesystem (zfs-root mounted at /mnt); it overmounts rootfs / with zfs-root /mnt. The switch_root works as follows: delete everything in rootfs / (one filesystem only) that held initrd to free up ram memory, then use mount, chroot, and chdir to make the effective root change. In concept (as a shell script), the command "exec switch_root /mnt $INIT $RUNLEVEL" is performed as follows: <pre> find / -xdev | xargs rm -rf cd "$1" shift mount --move . / exec chroot . "$@" </pre> Here, typically INIT=/sbin/init RUNLEVEL=3. The 'exec' causes switch_root to take the place of the parent process having PID=1. In system calls, the switch_root looks similar to this: <pre> chdir("/mnt"); /* <insert code to unlink/rmdir all initrd files/directories * installed in rootfs / without crossing filesystems > */ mount(".", "/", NULL, MS_MOVE, NULL); chroot("."); chdir("/"); execl("/sbin/init", "3", (char*) NULL ); </pre> The kernel's rootfs / that contained initrd is never actually unmounted (it can't be) because it is built into the kernel and always exists as at least a tiny ramfs or tmpfs, so you can continue to see it in /proc/mounts. When you give lilo root=/dev/ram0 (a ramfs device), the kernel will actually use the internal rootfs, which is an instance of a tmpfs (if your kernel config includes tmpfs) or ramfs. The rootfs that is a tmpfs can by default use up to half of system ram. If rootfs is a ramfs, it can use up to almost all of system ram until the system panics. Typically, tmpfs is built into the kernel, and so depending on how much ram your computer has, the initrd-tree can probably be up to about half that size. Quite a lot of notes... now to continue on... Setup mkinitrd: <pre> cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf vi /etc/mkinitrd.conf </pre> Edit it to look like this (other defaults should be ok): <pre> MODULE_LIST="sym53c8xx:ext4:e1000:zfs:9p:9pnet_virtio" ROOTDEV="zfs-root" ROOTFS="zfs" #Module sym53c8xx is the driver for qemu's if=scsi drive device. #Module ext4 for /boot. #Module e1000 for eth0 net device. #Module zfs for ZFSonLinux. #Modules 9p and 9pnet_virtio for mounting qemu -virtfs mount_tag. </pre> These 9p modules could be useful from the rescue command line inside the initrd to get needed files that are on the host. All dependent modules will also be included automatically into /boot/initrd-tree, which is packaged as /boot/initrd.gz. For example, to see the dependent modules of zfs: <pre> modprobe --show-depends zfs </pre> All listed modules will also be in the initrd. Now, make a /boot/initrd-tree that we can begin to look at and edit: <pre> mkinitrd </pre> Create an empty /etc/mtab or else zpool import fails (zfs expects /etc/mtab to exists already, it won't make it): <pre> touch /boot/initrd-tree/etc/mtab </pre> Copy in the fstab.initrd that was made earlier while on the installer. This provides all the mount options for a simple "mount zfs-root" onto /mnt: <pre> cp /etc/fstab.initrd /boot/initrd-tree/etc/fstab </pre> More package installing! This time into an alternate root, the root of the initrd, /boot/initrd-tree. This is how you can put whatever packages you like into your initrd. These installations work independent of your normal installations. You can install, upgrade, and remove packages using an altroot: If spl and zfs are on your customized dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/addon/spl-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/addon/zfs-*.txz </pre> Otherwise, repeat same procedure but you mount your 9p mount_tag and get them installed. More regular packages from the dvd: <pre> installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/kmod-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/coreutils-*.txz installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/gptfdisk-*.txz # A bash script is in /boot/initrd-tree/lib/udev/, so we need it or udev rules have problems: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/a/bash-*.txz # Bash needs this: installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/l/libtermcap-*.txz # Install net-tools to ensure that /etc/HOSTNAME, /etc/hosts, and potentially, /etc/hostid are handled proper. installpkg --root /boot/initrd-tree /mnt/cdrom/slackware64/n/net-tools-*.txz </pre> When ZFS has to import a zpool while the initrd is running (this can be avoided by not exporting and keeping /etc/zfs/zpool.cache inside the initrd), ZFS will refuse to import a pool if it thinks that the pool may be in use by another system. ZFS was designed for network attached storage (NAS) where multiple hosts might have access to the same disks but ZFS cannot support two hosts importing and using a ZFS pool at the same time (that requires a "cluster" fs). ZFS checks a value called "hostid" to determine this kind of conflict, and it can be a tricky issue with an initrd boot process. The value of hostid is returned by the gethostid() function or the hostid command. This function will return the hostid from /etc/hostid if that file exists and has a valid id in it, or else if the file doesn't exist it obtains a hostid number based on the hostname and ip address assigned to hostname found in /etc/hosts or in DNS. If the hostid trying to import a pool is not the same as the hostid that imported it last time, ZFS will not import the pool unless "zpool import -f zfs-root" is used to force the import. This force option is not recommended to use, so it is best to configure your initrd with matching /etc/HOSTNAME and /etc/hosts as on the root installation and ensure what your system looks like on the initrd matches the booted root system. The hostid can also be passed to the SPL module with the module parameter <code>spl.spl_hostid=0xHHHHHHHH</code> where the Hs are a hexadecimal hostid value and this overrides any /etc/hostid or hostname/IP-based hostid value. Edit /boot/initrd-tree/init (this is the main system startup script on the initrd, responsible for configuring your block devices, mounting root at /mnt, and booting root): Inside init, right near the top of the file after the PATH= line, add this: <pre> /bin/hostname -F /etc/HOSTNAME /bin/hostname $( /bin/hostname -s ) #/sbin/chhostid 13371400 # you can make your hostid whatever, but this didn't work right with ZFS, so it is commented out </pre> This sets the name reported by the hostname command (the default is "darkstar") to be what is contained in /etc/HOSTNAME. The hostname is modified in the next line to be the short hostname. These lines will help ZFS to properly identify your host when importing pools. Inside init, right after it runs "mdadm" commands as used for raid setup, we like it to setup ZFS, so add: <pre> /sbin/zpool import zfs-root /sbin/zfs set readonly=on zfs-root mount zfs-root </pre> We want to make sure the default is to mount readonly, then it mounts using defaults from /etc/fstab inside the initrd. Inside init, close to the bottom, where it "Switch to real root partition", comment out 1 line that normally does the mount: <pre> # mount -o ro -t $ROOTFS $ROOTDEV /mnt </pre> We have already mounted zfs-root, and we don't want to use any mount options because we should be using a properly set /etc/fstab inside the initrd for the zfs-root mount options onto /mnt. During a normal startup we want a readonly mount. Note: we are going to setup with using "zpool import" and "zpool export" commands at startup and shutdown. But later, you can experiment having /etc/zfs/zpool.cache stored in the initrd and commenting out the zpool import/export lines. Using zpool import/export is safer than using a zpool.cache, so we try to setup that way preferably. As mentioned, the zpool import command may sometimes fail, and give the message: "pool may be in use from another system". This is nothing serious in this test situation. When this happens, zfs-root will not get mounted to /mnt and the init script will detect this and drop you into a rescue command line where you may manually do: <pre> zpool import -f zfs-root mount zfs-root exit </pre> This will force import, overriding the conflict that zfs thinks may be happening. Next is mount. After this, exit to let the init script continue on to boot the system normally. To avoid this problem we copy some files in (assuming you first edit /etc/HOSTNAME to hold the hostname you like to see on your command prompts, and edited /etc/hosts to have hostname on your loopback or other local ip address): <pre> cp /etc/HOSTNAME /etc/hosts /boot/initrd-tree/etc </pre> The value reported by the hostid command is what ZFS sees as your hostid (the SPL module actually tries to run the hostid command to get this value or it uses the spl.spl_hostid value that is given to it). In this setup so far, the value is based on the ip assigned to your hostname. If your hostname is on the line in /etc/hosts for ip address 192.168.13.37, then your hostid will be hex numbers C0.A8.0D.25 rearranged as A8C0250D (pairs of bytes are swapped). This is a ip-based hostid value, a 32bit hexadecimal number. The hostid has to be the same each boot or import will need a -f option to force it. Simply setting the hostid using the function sethostid() which writes a /etc/hostid file doesn't seem to agree with ZFS and you'd have to force the import, so this setup now assumes that you do not have or have deleted /etc/hostid. You can sometimes see what has been happening to a zpool by using the command "zpool history -li zfs-root" to see a log of commands. Once again, you can do away with the import and export commands by trying to have /etc/zfs/zpool.cache inside your initrd. To create zpool.cache, while on the installer or in the rescue shell of the initrd (at lilo "boot: vmlinuz rescue"): <pre> (on installer or initrd rescue shell) zpool import zfs-root zfs set readonly=off zfs-root mount zfs-root cp /etc/zfs/zpool.cache /mnt/etc/zfs/zpool.cache-initrd cp /mnt/etc/zfs/zpool.cache-initrd /mnt/boot/initrd-tree/etc/zfs/zpool.cache umount /mnt zfs set readonly=on zfs-root #mount zfs-root #exit (to continue boot process onto rootfs mounted at /mnt) </pre> Words of caution, again: Doing this zpool.cache approach is not necessary, and some talk suggests this is deprecated or discouraged. Although /etc/hostid setup fails to import without -f option, ip-based (hosts|dns) hostid works on booting and import works without -f option and may be the more proper way to do shutdown and startup rather than using a cache file which could become invalid and cause a problem that is difficult to understand. The contents and exact function of the cache file are not well understood by many people. As will be spammed all over this wiki, using zpool.cache is not recommended if you can avoid it because it is potentially unsafe for your pool. Save /boot/initrd-tree/init and quit vi. Now, edit /etc/rc.d/rc.S and rc.6 to understand how to remount rw or ro as readonly property changes: In /etc/rc.d/rc.S: <pre> # comment out the line # /sbin/mount -w -v -n -o remount / #add the line /sbin/zfs set readonly=off zfs-root </pre> If you are using <code>mountpoint=legacy</code> for zfs-root, you do not need to make the above change. In /etc/rc.d/rc.6: <pre> # before: echo "Unmounting local file systems." # add lines: rm -f /etc/zfs/zpool.cache echo "Removed /etc/zfs/zpool.cache" </pre> Remove /etc/zfs/zpool.cache on shutdown. This is recommended because if it is present when you import a pool, it might use this old cache to determine the device filenames in the pool, which may have changed filenames since the last boot, especially the non-persistent /dev/sd* device filenames. It is safest to avoid any usage of the zpool.cache file at boot in initramfs, zfs module load, and at zpool import of other pools. It is also possible to prevent <code>/etc/zfs/zpool.cache</code> from ever being created by using the zfs module option 'spa_config_path=' to tell the zfs module not to use any zpool.cache file (a blank filename). To set this zfs module option, do the following: <pre> echo options zfs spa_config_path= > /etc/modprobe.d/zfs.conf cp -a /etc/modprobe.d /boot/initrd-tree/etc </pre> If zfs is built into the kernel (see [http://slackwiki.com/ZFS_root_%28builtin%29 ZFS root (builtin)]), then this zfs module option is set as a kernel parameter: <code>zfs.spa_config_path=</code> In /etc/rc.d/rc.6: <pre> # comment out the line: # /bin/mount -v -n -o remount,ro / # add the line: /sbin/zfs set readonly=on zfs-root </pre> If you are using <code>mountpoint=legacy</code> for zfs-root, you do not need to make the above change. In /etc/rc.d/rc.6, near the bottom just before poweroff|reboot, add the following block of lines: <pre> ######################## # Try to export zfs-root /sbin/zpool export zfs-root if [ $? -gt 0 ] ; then echo "ZFS export failed." echo "Notice: if root fs is busy, then this is normal fail." else echo "ZFS export successful." echo "Warning: successful export is abnormal for root fs." fi /bin/sleep 5 ######################## </pre> This attempts to export even though it cannot return success for the root pool. The attempt is still recorded in the zpool history, and even though it fails the pool may actually be marked as exported (not sure). For ZFS, you cannot run fsck on it. It doesn't support that kind of filesystem check. The rc.S script will complain a lot in many places about not being able to run fsck on the zfs-root. To disable all attempts to run fsck, we can simply create a file that acts as a flag in /etc/rc.d/rc.S to tell it to skip fsck: <pre> touch /etc/fastboot </pre> This fastboot file is normally a run-once temporary file, and it is deleted near the bottom inside rc.S. Edit rc.S and stop it from deleting /etc/fastboot. We would like it to always skip all fsck. Edit /etc/rc.d/rc.S, and find the "rm" of fastboot, and do not have it removed! An alternative to using /etc/fastboot is to make the file <code>/sbin/fsck.zfs</code> that always just "does nothing successfully": <pre> #!/bin/sh exec /bin/true </pre> Or, it can be: <pre> #!/bin/sh exit 0 </pre> Or, just do: <pre> ln -s /bin/true /sbin/fsck.zfs </pre> This fsck helper has the advantage that you do not need to alter <code>rc.S</code> as much, or at all if you use zfs property <code>mountpoint=legacy</code> and the regular <code>mount</code> command on your zfs-root. With these ideas, no slackware /etc/rc.d/* files really need editing, but it is up to you how you want to experiment. I prefer to use <code>mountpoint=legacy</code> and edit just the initrd init script as above, and edit rc.6 to remove /etc/zfs/zpool.cache and try to export. We are getting close, and have finished all editing, so make /boot/initrd.gz and install lilo: <pre> mkinitrd -F lilo </pre> We finished! All that's left to do is clean up. Exit the chroot. <pre> exit </pre> Try to umount everything: <pre> umount /mnt/proc umount /mnt/sys umount /mnt/dev umount /mnt/boot umount /mnt/mnt/cdrom umount /mnt/root/packages umount /mnt zpool export zfs-root </pre> Note, that export stops a pool and frees devices, while import binds devices and starts a pool. It is somewhat like mdadm -A -s and mdadm -S -s, while /etc/zfs/zpool.cache might be somewhat like mdadm -E -s > /etc/mdadm.conf. <pre> # Remove the DVD or change boot order reboot </pre> When you reboot, if all is good, you are booting properly onto a slackware installed on a ZFS root! Congrats! If this seems to go badly, and this might happen if the import fails as explained some before, then you will be on the initrd's rescue command line just before the part in init where it wants to mount zfs-root and switch_root to boot up. In this case, you typically got commands like these to do: If you get dumped to rescue because zpool import will not work and requires -f (force), then: <pre> zpool import -f zfs-root zpool export zfs-root zpool import zfs-root mount zfs-root exit </pre> This can happen if hostname, hostid, or uname changes. If you get into a jam and need to boot into the initrd and skip zpool import etc, use the lilo prompt (or, boot the install-dvd): <pre> boot: vmlinuz rescue </pre> In the rescue mode of the initrd, after you have mounted your zfs-root as readonly=on to /mnt, then "exit" to continue booting. An alternative rescue shell on the initrd can be started as follows: <pre> boot: vmlinuz rdinit=/bin/sh </pre> This puts you into a sh shell inside the initrd, and the normal /init script is not run at all. In this shell, you can fix problems and then attempt to start the system normally as follows: <pre> exec /init </pre> This runs the normal rdinit program, "execing" it so that it takes process ID (PID) 1 of your sh shell, which is the required PID for the init program. In other emergency command lines, you might need to run the lines at the end of init starting from: <code>udevadm info --cleanup-db; udevadm control --exit</code> If you don't run those udevadm commands, two runs of udevd could fight each other and it is slow; you have to wait 2 minutes twice for timeouts (4 minutes). The last line in init is run like: <code>exec switch_root /mnt /sbin/init 1</code> Warning: the switch_root command is kind of dangerous, so read the manual page about it. From what I can tell, everything except the new root "/mnt" is deleted, so you are giving a command that says what NOT to delete! Make sure nothing got mounted outside of "/mnt" before you run it. However, the deletes should not cross filesystems, but only delete the contents of initramfs. Also, in rescue command line or anytime you have finished making changes and are about to reboot in some abnormal situation, first run: <pre> zfs set readonly=on zfs-root </pre> If you are using <code>mountpoint=legacy</code> for zfs-root, then you may want to use <code>readonly=off</code> and use the options to the <code>mount</code> command to control ro|rw mounting. With <code>mountpoint=legacy</code> and <code>readonly=on</code> used together, there can be a contradiction between how the kernel actually mounts zfs-root (ro according to the readonly property) and how the userspace mount command and /etc/mtab attempt to mount the zfs-root (if you give <code>-o rw</code>). The kernel might actually mount ro, even when you have told the mount command to mount rw. The /etc/mtab can erroneously report rw, while the kernel's /proc/mounts file reports the actual mount as ro. Again, the two methods of mounting a zfs fs, either "legacy" <code>mount</code> command or by using the <code>zfs set mountpoint</code> can conflict with each other on the mode of mounting. If you create a zfs filesystem under zfs-root, like <code>zfs create "zfs-root/movies"</code> and then try to mount it, it may have inherited <code>mountpoint=legacy</code> and <code>readonly=on</code> from zfs-root, and it may mount ro even if you use the rw mount option: in this case, you have to do another command <code>mount -o remount,rw "zfs-root/movies"</code> to make it actually switch to rw (kind of weird!). A bug in unpatched grep 2.13 build 1, found slackware 14.0rc1, causes problems when processing files stored on ZFS but rarely shows problems on other filesystems; the bug does not handle sparse files on zfs and btrfs correctly and results in chaos with slackpkg, compiling kernel modules, and possibly many other things. You must downgrade grep to 2.12 or use the patched grep 2.13 build 2 in slackware 14.0rc2 or later. ---- Upgrading: From time to time you will want to upgrade the kernel to the new kernel in slackware64-current or in patches/. This will also necessitate a rebuild and reinstall or upgrade of spl and zfs. Below is an example of when both kernel and spl/zfs are being upgraded, to give an idea of the process: Using slackpkg, that is configured to use your local slackware mirror is a good option but you can also configure it to use a remote mirror. <pre> slackpkg upgrade-all </pre> Assume slackpkg just upgraded your kernel, kernel-modules, kernel-headers, and kernel-source. Note: the first time you try to run on kernel-generic, setup kernel-huge in lilo as 2nd choice. Huge has all the hard drive controllers builtin, but generic has them all as modules. For example, run "modinfo mptsas" to see module options (maybe you have a LSISAS1068) for your hard drive controller. Add file /etc/modprobe.d/mptsas.conf to set options you want with a line: options mptsas ... Do this for all the device driver modules for your hardware. Do this setup while you are on the huge kernel, then setup to reboot to generic. Include all these modules you need into mkinitrd.conf MODULES_LIST. Check that /boot/initrd-tree/etc/modprobe.d/ has a copy of your customized module conf files because it is on the initrd where the modules will load and use the conf files. mkinitrd probably copies all /etc/modprobe.d/* files into the initrd-tree, but check it. Pay attention to /etc/modprobe.d/README and /lib/modprobe.d/* /lib/modprobe.d/* maybe not copied to initrd-tree but you might want to copy some of it into your initrd-tree yourself to use them. Check that upgraded kernel-source is symlinked to /usr/src/linux (zfs build looks here). SPL/ZFS modules will install to the kernel version in /lib/modules/</usr/src/linux kernel version> <pre> cd /usr/local/src tar xvzf ~/spl-*.tar.gz tar xvzf ~/zfs-*.tar.gz ###### upgrade spl 1st mkdir install cd spl-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../spl-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod <new kernel version> (e.g. depmod 3.2.28, if .28 is new kernel upgrade; you currently run on old, maybe .27) # this builds the module dependencies in /lib/modules/<new kernel version> ###### upgrade zfs 2nd mkdir install cd zfs-* ./configure --prefix=/ --libexecdir=/usr/libexec --libdir=/lib64 --includedir=/usr/include --datarootdir=/usr/share make make install DESTDIR=/usr/local/src/install cd ../install makepkg ../zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz cd .. rm -r install upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz depmod 3.2.28 ####### upgrade spl/zfs inside altroot /boot/initrd-tree ROOT=/boot/initrd-tree upgradepkg spl-<version>rcX_<kernel version>-x86_64-Xroot.txz ROOT=/boot/initrd-tree upgradepkg zfs-<version>rcX_<kernel version>-x86_64-Xroot.txz # note: ROOT is an environment variable, not a command line option to upgradepkg! # note: do not worry about depmod inside initrd-tree, mkinitrd -F actually installs the modules # note: this upgrade here is really to just upgrade the command line tools zpool, zfs etc ####### rebuild /boot/initrd.gz and reinstall lilo vi /etc/mkinitrd.conf # temporarily set KERNEL_VERSION to new version, but you are still running on old version mkinitrd -F lilo vi /etc/mkinitrd.conf # you can set KERNEL_VERSION back to $(uname -r) now reboot </pre> After reboot you can remove any old /lib/modules/<old kernel version> directory. ---- More about /etc/hostid. If you want to experiment changing your /etc/hostid file and seeing if you can use it and make zpool import work normally, here is a tool that might be helpful: <pre> /* software product name: foobarz-chhostid.c * suggested binary name: chhostid * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_CHHOSTID_VERSION "1.0.5" #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <endian.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <sysexits.h> /* note: if include stdlib then sethostid fails even with _BSD_SOURCE defined */ long swapbytes(long abcd) { long badc; unsigned char addr_a; unsigned char addr_b; unsigned char addr_c; unsigned char addr_d; addr_a = (unsigned char) (abcd >> 24); addr_b = (unsigned char) (abcd >> 16); addr_c = (unsigned char) (abcd >> 8); addr_d = (unsigned char) (abcd); return badc = ( (addr_b << 24) | (addr_a << 16) | (addr_d << 8) | addr_c ); } int main(int argc, char* argv[]) { long newhostid; struct in_addr addr; char* invalidchar; /*********** check command line */ if(!( ((argc==3) && ( (strcmp(argv[1],"-h")==0) || (strcmp(argv[1],"-i")==0) || (strcmp(argv[1],"-l")==0) )) || ((argc==2) && ( (strcmp(argv[1],"-s")==0) )) ) ) { /*01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(stderr, "foobarz-chhostid, version %s. License: BSD.\n", FOOBARZ_CHHOSTID_VERSION); fprintf(stderr, "foobarz-chhostid, (c) 2012, foobarz; all rights reserved.\n"); fprintf(stderr, "descr: %s change system hostid (in /etc/hostid).\n", argv[0]); fprintf(stderr, "usage: %s -h <new hostid>\n" " Change system hostid to <new hostid>;\n" " <new hostid> must be 32bit 8-digit hex number xxxxxxxx, each x in 0-f|F.\n" " The ip corresponding to <new hostid> is also listed for reference only.\n", argv[0]); fprintf(stderr, "usage: %s -i <dotted ip address>\n" " Change system hostid to hostid corresponding to <dotted ip address>.\n", argv[0]); fprintf(stderr, "usage: %s -l <dotted ip address>\n" " List hostid corresponding to <dotted ip address>;\n" " no change to system hostid.\n", argv[0]); fprintf(stderr, "usage: %s -s\n" " List current system hostid and corresponding ip address;\n" " no change to system hostid.\n", argv[0]); return EX_USAGE; } /*********** -h <hostid> */ if( strcmp(argv[1],"-h") == 0 ) { if(strlen(argv[2]) != 8) { fprintf(stderr, "new hostid must be 8-digit hex number xxxxxxxx, each x in 0-f|F\n"); return EX_USAGE; } newhostid = strtol(argv[2],&invalidchar,16); if( newhostid==LONG_MIN ) { perror("strtol (underflow)"); return EX_USAGE; } if( newhostid==LONG_MAX ) { perror("strtol (overflow)"); return EX_USAGE; } if(*invalidchar != '\0') { fprintf(stderr, "invalid hex number %c; must be in 0-f|F\n", *invalidchar); return EX_USAGE; } if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); } /*********** -i or -l, then find hostid for <dotted ip address> */ if( (strcmp(argv[1],"-i") == 0) || (strcmp(argv[1],"-l") == 0) ) { if( inet_aton(argv[2], &addr) == 0 ) { fprintf(stderr, "inet_aton: invalid dotted ip address: %s\n", argv[2]); return EX_USAGE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get hostid by swapping bytes of ip a.b.c.d */ newhostid = swapbytes(ntohl(addr.s_addr)); } /*********** -i <dotted ip address> */ if( strcmp(argv[1],"-i") == 0 ) { if( sethostid(newhostid) != 0 ) { perror("sethostid"); if( errno == EPERM ) return EX_NOPERM; return EX_UNAVAILABLE; } printf("System hostid changed.\n"); } /*********** -l <dotted ip address> */ if(strcmp(argv[1],"-l") == 0 ) { printf("Listing hostid for ip. (no changes)\n"); } /*********** -s */ if(strcmp(argv[1],"-s") == 0 ) { /* see if /etc/hostid exists and print info */ if( access("/etc/hostid", F_OK) != 0 ) { printf("Notice: /etc/hostid does not exist.\n"); perror("Reason"); printf("System hostid derived from ip of hostname found in hosts file or dns.\n"); } else { printf("Notice: /etc/hostid exists.\n" "System hostid is obtained from hostid file.\n"); } errno=0; newhostid = gethostid(); if(errno!=0) { perror("gethostid"); return EX_UNAVAILABLE; } /* hostid is a byte-swapped ip like b.a.d.c */ /* get ip by swapping to correct order a.b.c.d and save into in_addr struct */ addr.s_addr = htonl(swapbytes(newhostid)); printf("Listing current system hostid. (no changes)\n"); } /*********** print info and return */ printf("ip dot: %s\n", inet_ntoa(addr) ); printf("ip hex: %.8x\n", ntohl(addr.s_addr) ); printf("hostid: %.8x\n", newhostid ); return EX_OK; } </pre> ---- Now available! "ZFS root (builtin)" wiki (aka "ZFS root, part II"): http://slackwiki.com/ZFS_root_(builtin) It is now possible to build the modules and a small initramfs into your kernel to have a fully-contained and bootable ZFS root kernel from a simple lilo entry. Good luck! a552a5e8d00ffd26453f69c6801f2dd23d0f6f44 ZFS root (builtin) 0 291 784 779 2012-09-09T04:31:02Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command # You might think to set bootfs property like this: # zpool set bootfs=zfs-root zfs-root # however, this will result in ZFS placing many restrictions on zfs-root as per how that option # is used on Solaris systems: # * zfs-root must be VTOC (SMI) label, not GPT (EFI) label # * zfs-root can only contain 1 vdev: either a plain disk, or a mirror # so, do not set that property! # If bootfs is set, you would find that you cannot add vdevs to your zfs-root. # If it is set already, then unset it like this: # zpool set bootfs= zfs-root mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS ### prepare contents of initramfs cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 # this should be enough device nodes initially # once devtmpfs mounts over /dev, a lot more is available in it by default cat > /init <<"EOF" <some initial program PID=1 for the system to start on> EOF # an initramfs-source/init program is required to mount and boot a root linux system # the common way to make /init is using busybox with files like this: # /bin/busybox # /bin/ash -> busybox # /bin/sh -> busybox # # run busybox to see what other "applets" can be symlinked to it # # when busybox is run as a different symlinked applet name, it runs the applet # /init # # init is ash script, see slackware's /boot/initrd-tree/init for example # Inside this script: # 1) parse kernel parameters passed into it and set variables based on them # 2) start udevd and trigger rules for block devices to setup initial /dev devices # 3) load kernel modules and keyboard map # 4) run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices # (any udev rules for them should do more /dev setup in the background) # 5) mount the root filesystem read-only at /mnt # 6) stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh # 7) shutdown udevd so it can be restarted by root system when booted # 8) mount --move {proc,sys,run,dev} to under /mnt # 9) run: exec switch_root /mnt /sbin/init $RUNLEVEL # The slackware mkinitrd package is fully configured busybox installation # for an extern file initramfs initrd.gz image outside the kernel. # It could be changed to be inside the kernel easily by just using initrd-tree # as target of INITRAMFS_SOURCE in the kernel config and removing initrd in lilo. # Because the zfs modules are builtin, we really don't need busybox and the whole # mkinitrd package. All we need to do is mount the zfs that is already imported # because the zpool.cache is present in rootfs when the zfs module initializes, and # then we do the switch root procedure to boot up on the mounted system. # udevd rules will still be run when the root system starts udevd. # So, let's make a simple /init c program that will be all that we really need: cat > init.c <<"EOF" /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define FOOBARZ_INIT_VERSION "1.0.10rc1" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 /* Your initramfs-source should contain the following * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 */ void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, ilastparam }; /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = ""; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific informative checks */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init gcc --static init.c -o init strip init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notes on the spl and zfs packages to install: If you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console of booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 5f0baa89e97746676b8d8d5b0d3f04066ae4282b 785 784 2012-09-11T03:41:19Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. <pre> zfs set mountpoint=legacy zfs-root # use legacy so zfs will not expect zfs mount, but instead expect standard mount for this fs # edit /etc/rc.d/rc.S and rc.6 to use regular "mount" commands, remove "zfs" commands # edit rc.6 and remove or comment out zfs export command # You might think to set bootfs property like this: # zpool set bootfs=zfs-root zfs-root # however, this will result in ZFS placing many restrictions on zfs-root as per how that option # is used on Solaris systems: # * zfs-root must be VTOC (SMI) label, not GPT (EFI) label # * zfs-root can only contain 1 vdev: either a plain disk, or a mirror # so, do not set that property! # If bootfs is set, you would find that you cannot add vdevs to your zfs-root. # If it is set already, then unset it like this: # zpool set bootfs= zfs-root mkdir /boot/initramfs-source # this will hold some files for rootfs inside kernel cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source # make usre you made this directory or the kernel build fails Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support # for qemu if=scsi -option-rom 8xx_64.rom,bootindex=1 hard disks # buildin any hard drive controllers etc that you need File systems -> <*> The Extended 4 (ext4) filesystem # /boot may use this ext4 fs make prepare scripts # this make command is what the spl and zfs copy-builtin scripts expect to be done before they are run cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install ### move zfs and spl modules inside kernel source to be at end of drivers: ### the order builtin modules init is the order they link into the kernel ### and we need zfs to init after all hard drive controllers ### zfs is more like a device driver layer over the lower-level hba drivers cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF ### move complete cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS ### prepare contents of initramfs cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 # this should be enough device nodes initially # once devtmpfs mounts over /dev, a lot more is available in it by default cat > /init <<"EOF" <some initial program PID=1 for the system to start on> EOF # an initramfs-source/init program is required to mount and boot a root linux system # the common way to make /init is using busybox with files like this: # /bin/busybox # /bin/ash -> busybox # /bin/sh -> busybox # # run busybox to see what other "applets" can be symlinked to it # # when busybox is run as a different symlinked applet name, it runs the applet # /init # # init is ash script, see slackware's /boot/initrd-tree/init for example # Inside this script: # 1) parse kernel parameters passed into it and set variables based on them # 2) start udevd and trigger rules for block devices to setup initial /dev devices # 3) load kernel modules and keyboard map # 4) run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices # (any udev rules for them should do more /dev setup in the background) # 5) mount the root filesystem read-only at /mnt # 6) stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh # 7) shutdown udevd so it can be restarted by root system when booted # 8) mount --move {proc,sys,run,dev} to under /mnt # 9) run: exec switch_root /mnt /sbin/init $RUNLEVEL # The slackware mkinitrd package is fully configured busybox installation # for an extern file initramfs initrd.gz image outside the kernel. # It could be changed to be inside the kernel easily by just using initrd-tree # as target of INITRAMFS_SOURCE in the kernel config and removing initrd in lilo. # Because the zfs modules are builtin, we really don't need busybox and the whole # mkinitrd package. All we need to do is mount the zfs that is already imported # because the zpool.cache is present in rootfs when the zfs module initializes, and # then we do the switch root procedure to boot up on the mounted system. # udevd rules will still be run when the root system starts udevd. # So, let's make a simple /init c program that will be all that we really need: cat > init.c <<"EOF" /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * and this program compiled to /boot/initramfs-source/init * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.1" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { "zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } EOF ## end of rootfs /init # If foobarz-init is updated, you can find the latest version at: # https://github.com/foobarz/foobarz-init # The foobarz-init program can be compiled two ways as of v1.1.1: # First, the simple compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: gcc --static init.c -o init strip init # The second way to compile it adds support for zpool_import so that you do not have to include a /etc/zfs/zpool.cache file, but instead # would add a kernel parameter: zpool_import_name=zfs-root, or zpool_import_guid=<guid of zfs-root>. # You can import the root pool with a different name by also using zpool_import_newname=rpool. # However you import, kernel param root=<your root pool name or newname> needs to be given also. # The zpool_import only imports, it does not mount. What to mount is still told using root= and rootfstype=. # # If the import is not working, zpool_import_force=1 can be used to force it. # # This second way also requires you to install libtirpc first. Now here is an example gcc line: gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init cp init /boot/initramfs-source/init ## build and install kernel cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notes on the spl and zfs packages to install: If you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console of booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 2781c3acba1637fdb4b0413de5f50a5e944a7612 786 785 2012-09-12T03:44:07Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first "ZFS root" wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. Use mountpoint=legacy so that zfs will not expect <code>zfs mount</code>, but instead expect standard <code>mount</code> for mounting zfs-root: <pre> zfs set mountpoint=legacy zfs-root </pre> Edit <code>/etc/rc.d/rc.S</code> and <code>rc.6</code> to use regular <code>mount</code> commands, remove <code>zfs</code> commands. Edit <code>rc.6</code> and remove or comment out <code>zfs export</code> command. These edits undo changes made in the "ZFS root" wiki, but it shows the two different ways of mounting a zfs filesystem. You <i>might</i> think to set <code>bootfs</code> property like this: <pre> zpool set bootfs=zfs-root zfs-root </pre> However, this will result in ZFS placing many restrictions on zfs-root as per how that option is used on Solaris systems: <ol> <li> zfs-root must be VTOC (SMI) label, not GPT (EFI) label</li> <li> zfs-root can only contain 1 vdev: either a plain disk, or a mirror</li> </ol> So, do <b>NOT</b> set that property! If <code>bootfs</code> is set, you would find that you cannot add vdevs to your zfs-root. If it is set already, then unset it like this: <pre> zpool set bootfs= zfs-root </pre> Make a directory to store files to be inside the initramfs: <pre> mkdir /boot/initramfs-source </pre> This directory will hold some files for the initial rootfs inside the kernel. Your <code>/boot</code> should be on a small ext4 partition or on a mounted USB stick that you use to boot. Extract the slackware kernel-source package to obtain a copy of the kernel source, and make an initial kernel config for it: <pre> cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support File systems -> <*> The Extended 4 (ext4) filesystem # build in any hard drive controllers and filesystems that you need for booting # then save the config make prepare scripts </pre> The kernel source has been set to have a "Local version" <code>b</code>. This will result in modules installed to <code>/lib/modules/3.2.27b</code> and keeps this kernel's source and modules seperate from slackware's kernel-generic package installation. The <code>make prepare scripts</code> command readies the kernel source as needed before we can install a copy of spl and zfs modules into the kernel source tree. Now proceed to configure and copy spl and zfs into the kernel source tree: <pre> cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install </pre> At this point, the <code>copy-builtin</code> scripts have installed the configured spl and zfs modules source into the kernel source. The regular <code>make menuconfig</code> in the kernel source should now show options for spl and zfs in the kernel config. As of this writing, the copy-builtin script places the spl and zfs modules into the kernel source in places where the modules may not initialize in the best order, <i>after</i> all lower-level storage drivers are initialized. If spl and zfs initialize too soon, there is a chance they may not be able to see all of the storage devices. The order of initialization (as seen in dmesg) of modules that are builtin to the kernel is the order that the modules are linked into the kernel during kernel compilation. The order of link depends on where the module source files are located in the kernel source tree. To ensure that spl and zfs will initialize after all hardware drivers, we move them into the <code>drivers</code> tree and after all other drivers: <pre> cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF </pre> This completes the move of the spl and zfs modules in the kernel source tree to be under <code>drivers/zfsonlinux</code>. Now, in kernel configuration, you can build in the modules as follows: <pre> cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS </pre> In the kernel config, we set <code>/boot/initramfs-source</code> as source location of the contents to be linked into kernel's builtin initramfs (rootfs). Now, we create some files that are needed to be in the initramfs: <pre> cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 </pre> This should be enough device nodes initially in the initramfs. Once devtmpfs mounts over /dev inside initramfs, a lot more devices are available in it by default. The initramfs needs an <code>/init</code> program that will be run automatically by the kernel as process id 1, the first program to run on the system. This program's task is to mount a root filesystem, switch it to be the new root (/), and then exec the init (<code>/sbin/init</code>) program that is on the new root so that the new root system is booted. The common way to make /init is using busybox with files like these in /boot/initrd-tree or /boot/initramfs-source: <pre> bin/busybox bin/ash -> busybox bin/sh -> busybox # run busybox to see what other "applets" can be symlinked to it # when busybox is run as a different symlinked applet name, it runs as the applet init # init can be an ash script, see slackware's /boot/initrd-tree/init for example </pre> For example, as an ash script, slackware's init does the following: <ol> <li>parse kernel parameters passed into it and set variables based on them</li> <li>start udevd and trigger rules for block devices to setup initial /dev devices</li> <li>load kernel modules and keyboard map</li> <li>run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices (any udev rules for them should do more /dev setup in the background)</li> <li>mount the root filesystem read-only at /mnt</li> <li>stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh</li> <li>shutdown udevd so it can be restarted by root system when booted</li> <li>mount --move {proc,sys,run,dev} to under /mnt</li> <li>run: exec switch_root /mnt /sbin/init $RUNLEVEL</li> </ol> The slackware mkinitrd package is a fully configured BusyBox installation that makes an external initramfs image file, initrd.gz, that is passed to the kernel by the bootloader (lilo). It could be changed to be internal to the kernel by just using initrd-tree as the CONFIG_INITRAMFS_SOURCE in the kernel config and removing initrd in the lilo.conf. The main purpose of most initramfs/initrd is to load and configure kernel modules and devices needed to mount a root filesystem. Because the spl/zfs modules are builtin, there isn't really a lot that needs to be done by an initramfs. What remains to be done is import the zfs-root pool, mount it, and exec the system /sbin/init. The kernel's "legacy" parameters <code>root=</code> and <code>rootfstype=</code> that are able to directly boot a root disk do not work with ZFS at this time because ZFS pools always need to be imported before it is possible to mount and boot on them. The automatic import that ZFS can do by using a cachefile (/etc/zfs/zpool.cache) stored in initramfs still does not work with the legacy boot parameters because at an eariler stage of the boot process, the kernel ignores a rootfs that does not contain an </code>/init</code> program, and/or the device type of an imported pool is not the device types recognized by the legacy boot as valid root devices. You could just continue to use slackware's mkinitrd package as in the "ZFS root" wiki and it works the same whether the modules are builtin or not. But, by building the spl/zfs modules in, aren't we really wanting to get rid of using the mkinitrd/initrd.gz? We'd like to have a kernel with everything in it to boot, and use a simple lilo image entry that has no initrd. We can do this, and not use the mkinitrd package, but we still need to finish our own initramfs <code>/init</code> program to import, mount, switch root, and boot. Save the following c program to "foobarz-init.c": <pre> /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * and this program compiled to /boot/initramfs-source/init * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.1" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { "zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } </pre> If foobarz-init is updated, you can find the latest version at [https://github.com/foobarz/foobarz-init github]. The foobarz-init program can be compiled two ways as of v1.1.1. First, the simpler compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: <pre> gcc --static init.c -o init strip init </pre> The second way to compile it adds support for zpool_import so that you do not have to include a <code>/etc/zfs/zpool.cache</code> file in the initramfs: <pre> gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init </pre> Note: the zpool_import support requires that you install [http://sourceforge.net/projects/libtirpc/ libtirpc] first. Read the foobarz-init source code to see how it uses kernel parameters. The params <code>root</code> and <code>rootfstype</code> are always required to tell init what root pool name to mount and the filesystem type (e.g. zfs). For the zpool_import support: <code>zpool_import_name=poolname</code>, or <code>zpool_import_guid=<guid of a pool></code> tells what pool to import. You can also import the pool with a new different name by also using <code>zpool_import_newname=newpoolname</code>. If the import is not working, <code>zpool_import_force=1</code> can be used to force import even if ZFS thinks the pool may be in use by another system. However you import the pool, either using zpool.cache or zpool_import support, the kernel param <code>root=<your poolname or newpoolname></code> and <code>rootfstype=zfs</code> needs to be given also. The zpool_import only imports, it does not say what to mount. What to mount is still told using root= and rootfstype=. Now copy the compiled static program into the initramfs: <pre> cp init /boot/initramfs-source/init </pre> Build and install kernel: <pre> cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Congrats! If this works, you can select the "vm3.2.27b" lilo entry to boot. If you are using the zpool_import support in the init program, you need to add at least the <code>zpool_import_name=zfs-root</code> param to the addappend line in lilo.conf. Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notice the <code>spl.spl_hostid=0x007f0100</code> param that works around the hostid mismatch problem while trying to import a pool; this param and hostname/ip set to use local loopback 127.0.0.1 in etc/hosts etc/HOSTNAME in initramfs will work most of the time, and if not the pool import needs to be forced. Notes on the spl and zfs packages to install: <i>If</i> you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console of booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 98a9e7ada0c67ded5d64fa1da2623ce88334e2de 787 786 2012-09-12T03:47:29Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first [http://slackwiki.com/ZFS_root "ZFS root"] wiki explains the details of running ZFS at your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternatve kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. Use mountpoint=legacy so that zfs will not expect <code>zfs mount</code>, but instead expect standard <code>mount</code> for mounting zfs-root: <pre> zfs set mountpoint=legacy zfs-root </pre> Edit <code>/etc/rc.d/rc.S</code> and <code>rc.6</code> to use regular <code>mount</code> commands, remove <code>zfs</code> commands. Edit <code>rc.6</code> and remove or comment out <code>zfs export</code> command. These edits undo changes made in the "ZFS root" wiki, but it shows the two different ways of mounting a zfs filesystem. You <i>might</i> think to set <code>bootfs</code> property like this: <pre> zpool set bootfs=zfs-root zfs-root </pre> However, this will result in ZFS placing many restrictions on zfs-root as per how that option is used on Solaris systems: <ol> <li> zfs-root must be VTOC (SMI) label, not GPT (EFI) label</li> <li> zfs-root can only contain 1 vdev: either a plain disk, or a mirror</li> </ol> So, do <b>NOT</b> set that property! If <code>bootfs</code> is set, you would find that you cannot add vdevs to your zfs-root. If it is set already, then unset it like this: <pre> zpool set bootfs= zfs-root </pre> Make a directory to store files to be inside the initramfs: <pre> mkdir /boot/initramfs-source </pre> This directory will hold some files for the initial rootfs inside the kernel. Your <code>/boot</code> should be on a small ext4 partition or on a mounted USB stick that you use to boot. Extract the slackware kernel-source package to obtain a copy of the kernel source, and make an initial kernel config for it: <pre> cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support File systems -> <*> The Extended 4 (ext4) filesystem # build in any hard drive controllers and filesystems that you need for booting # then save the config make prepare scripts </pre> The kernel source has been set to have a "Local version" <code>b</code>. This will result in modules installed to <code>/lib/modules/3.2.27b</code> and keeps this kernel's source and modules seperate from slackware's kernel-generic package installation. The <code>make prepare scripts</code> command readies the kernel source as needed before we can install a copy of spl and zfs modules into the kernel source tree. Now proceed to configure and copy spl and zfs into the kernel source tree: <pre> cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install </pre> At this point, the <code>copy-builtin</code> scripts have installed the configured spl and zfs modules source into the kernel source. The regular <code>make menuconfig</code> in the kernel source should now show options for spl and zfs in the kernel config. As of this writing, the copy-builtin script places the spl and zfs modules into the kernel source in places where the modules may not initialize in the best order, <i>after</i> all lower-level storage drivers are initialized. If spl and zfs initialize too soon, there is a chance they may not be able to see all of the storage devices. The order of initialization (as seen in dmesg) of modules that are builtin to the kernel is the order that the modules are linked into the kernel during kernel compilation. The order of link depends on where the module source files are located in the kernel source tree. To ensure that spl and zfs will initialize after all hardware drivers, we move them into the <code>drivers</code> tree and after all other drivers: <pre> cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF </pre> This completes the move of the spl and zfs modules in the kernel source tree to be under <code>drivers/zfsonlinux</code>. Now, in kernel configuration, you can build in the modules as follows: <pre> cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS </pre> In the kernel config, we set <code>/boot/initramfs-source</code> as source location of the contents to be linked into kernel's builtin initramfs (rootfs). Now, we create some files that are needed to be in the initramfs: <pre> cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 </pre> This should be enough device nodes initially in the initramfs. Once devtmpfs mounts over /dev inside initramfs, a lot more devices are available in it by default. The initramfs needs an <code>/init</code> program that will be run automatically by the kernel as process id 1, the first program to run on the system. This program's task is to mount a root filesystem, switch it to be the new root (/), and then exec the init (<code>/sbin/init</code>) program that is on the new root so that the new root system is booted. The common way to make /init is using busybox with files like these in /boot/initrd-tree or /boot/initramfs-source: <pre> bin/busybox bin/ash -> busybox bin/sh -> busybox # run busybox to see what other "applets" can be symlinked to it # when busybox is run as a different symlinked applet name, it runs as the applet init # init can be an ash script, see slackware's /boot/initrd-tree/init for example </pre> For example, as an ash script, slackware's init does the following: <ol> <li>parse kernel parameters passed into it and set variables based on them</li> <li>start udevd and trigger rules for block devices to setup initial /dev devices</li> <li>load kernel modules and keyboard map</li> <li>run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices (any udev rules for them should do more /dev setup in the background)</li> <li>mount the root filesystem read-only at /mnt</li> <li>stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh</li> <li>shutdown udevd so it can be restarted by root system when booted</li> <li>mount --move {proc,sys,run,dev} to under /mnt</li> <li>run: exec switch_root /mnt /sbin/init $RUNLEVEL</li> </ol> The slackware mkinitrd package is a fully configured BusyBox installation that makes an external initramfs image file, initrd.gz, that is passed to the kernel by the bootloader (lilo). It could be changed to be internal to the kernel by just using initrd-tree as the CONFIG_INITRAMFS_SOURCE in the kernel config and removing initrd in the lilo.conf. The main purpose of most initramfs/initrd is to load and configure kernel modules and devices needed to mount a root filesystem. Because the spl/zfs modules are builtin, there isn't really a lot that needs to be done by an initramfs. What remains to be done is import the zfs-root pool, mount it, and exec the system /sbin/init. The kernel's "legacy" parameters <code>root=</code> and <code>rootfstype=</code> that are able to directly boot a root disk do not work with ZFS at this time because ZFS pools always need to be imported before it is possible to mount and boot on them. The automatic import that ZFS can do by using a cachefile (/etc/zfs/zpool.cache) stored in initramfs still does not work with the legacy boot parameters because at an eariler stage of the boot process, the kernel ignores a rootfs that does not contain an </code>/init</code> program, and/or the device type of an imported pool is not the device types recognized by the legacy boot as valid root devices. You could just continue to use slackware's mkinitrd package as in the "ZFS root" wiki and it works the same whether the modules are builtin or not. But, by building the spl/zfs modules in, aren't we really wanting to get rid of using the mkinitrd/initrd.gz? We'd like to have a kernel with everything in it to boot, and use a simple lilo image entry that has no initrd. We can do this, and not use the mkinitrd package, but we still need to finish our own initramfs <code>/init</code> program to import, mount, switch root, and boot. Save the following c program to "foobarz-init.c": <pre> /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * and this program compiled to /boot/initramfs-source/init * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.1" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { "zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } </pre> If foobarz-init is updated, you can find the latest version at [https://github.com/foobarz/foobarz-init github]. The foobarz-init program can be compiled two ways as of v1.1.1. First, the simpler compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: <pre> gcc --static init.c -o init strip init </pre> The second way to compile it adds support for zpool_import so that you do not have to include a <code>/etc/zfs/zpool.cache</code> file in the initramfs: <pre> gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init </pre> Note: the zpool_import support requires that you install [http://sourceforge.net/projects/libtirpc/ libtirpc] first. Read the foobarz-init source code to see how it uses kernel parameters. The params <code>root</code> and <code>rootfstype</code> are always required to tell init what root pool name to mount and the filesystem type (e.g. zfs). For the zpool_import support: <code>zpool_import_name=poolname</code>, or <code>zpool_import_guid=<guid of a pool></code> tells what pool to import. You can also import the pool with a new different name by also using <code>zpool_import_newname=newpoolname</code>. If the import is not working, <code>zpool_import_force=1</code> can be used to force import even if ZFS thinks the pool may be in use by another system. However you import the pool, either using zpool.cache or zpool_import support, the kernel param <code>root=<your poolname or newpoolname></code> and <code>rootfstype=zfs</code> needs to be given also. The zpool_import only imports, it does not say what to mount. What to mount is still told using root= and rootfstype=. Now copy the compiled static program into the initramfs: <pre> cp init /boot/initramfs-source/init </pre> Build and install kernel: <pre> cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Congrats! If this works, you can select the "vm3.2.27b" lilo entry to boot. If you are using the zpool_import support in the init program, you need to add at least the <code>zpool_import_name=zfs-root</code> param to the addappend line in lilo.conf. Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notice the <code>spl.spl_hostid=0x007f0100</code> param that works around the hostid mismatch problem while trying to import a pool; this param and hostname/ip set to use local loopback 127.0.0.1 in etc/hosts etc/HOSTNAME in initramfs will work most of the time, and if not the pool import needs to be forced. Notes on the spl and zfs packages to install: <i>If</i> you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console of booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 2312365a575698f07510de837b1d409fce053bb5 788 787 2012-09-12T07:24:49Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first [http://slackwiki.com/ZFS_root "ZFS root"] wiki explains the details of running ZFS as your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create a kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternative kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. Use mountpoint=legacy so that zfs will not expect <code>zfs mount</code>, but instead expect standard <code>mount</code> for mounting zfs-root: <pre> zfs set mountpoint=legacy zfs-root </pre> Edit <code>/etc/rc.d/rc.S</code> and <code>rc.6</code> to use regular <code>mount</code> commands, remove <code>zfs</code> commands. Edit <code>rc.6</code> and remove or comment out <code>zfs export</code> command. These edits undo changes made in the "ZFS root" wiki, but it shows the two different ways of mounting a zfs filesystem. You <i>might</i> think to set <code>bootfs</code> property like this: <pre> zpool set bootfs=zfs-root zfs-root </pre> However, this will result in ZFS placing many restrictions on zfs-root as per how that option is used on Solaris systems: <ol> <li> zfs-root must be VTOC (SMI) label, not GPT (EFI) label</li> <li> zfs-root can only contain 1 vdev: either a plain disk, or a mirror</li> </ol> So, do <b>NOT</b> set that property! If <code>bootfs</code> is set, you would find that you cannot add vdevs to your zfs-root. If it is set already, then unset it like this: <pre> zpool set bootfs= zfs-root </pre> Make a directory to store files to be inside the initramfs: <pre> mkdir /boot/initramfs-source </pre> This directory will hold some files for the initial rootfs inside the kernel. Your <code>/boot</code> should be on a small ext4 partition or on a mounted USB stick that you use to boot. Extract the slackware kernel-source package to obtain a copy of the kernel source, and make an initial kernel config for it: <pre> cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support File systems -> <*> The Extended 4 (ext4) filesystem # build in any hard drive controllers and filesystems that you need for booting # then save the config make prepare scripts </pre> The kernel source has been set to have a "Local version" <code>b</code>. This will result in modules installed to <code>/lib/modules/3.2.27b</code> and keeps this kernel's source and modules seperate from slackware's kernel-generic package installation. The <code>make prepare scripts</code> command readies the kernel source as needed before we can install a copy of spl and zfs modules into the kernel source tree. Now proceed to configure and copy spl and zfs into the kernel source tree: <pre> cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install </pre> At this point, the <code>copy-builtin</code> scripts have installed the configured spl and zfs modules source into the kernel source. The regular <code>make menuconfig</code> in the kernel source should now show options for spl and zfs in the kernel config. As of this writing, the copy-builtin script places the spl and zfs modules into the kernel source in places where the modules may not initialize in the best order, <i>after</i> all lower-level storage drivers are initialized. If spl and zfs initialize too soon, there is a chance they may not be able to see all of the storage devices. The order of initialization (as seen in dmesg) of modules that are builtin to the kernel is the order that the modules are linked into the kernel during kernel compilation. The order of link depends on where the module source files are located in the kernel source tree. To ensure that spl and zfs will initialize after all hardware drivers, we move them into the <code>drivers</code> tree and after all other drivers: <pre> cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF </pre> This completes the move of the spl and zfs modules in the kernel source tree to be under <code>drivers/zfsonlinux</code>. Now, in kernel configuration, you can build in the modules as follows: <pre> cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS </pre> In the kernel config, we set <code>/boot/initramfs-source</code> as source location of the contents to be linked into kernel's builtin initramfs (rootfs). Now, we create some files that are needed to be in the initramfs: <pre> cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 </pre> This should be enough device nodes initially in the initramfs. Once devtmpfs mounts over /dev inside initramfs, a lot more devices are available in it by default. The initramfs needs an <code>/init</code> program that will be run automatically by the kernel as process id 1, the first program to run on the system. This program's task is to mount a root filesystem, switch it to be the new root (/), and then exec the init (<code>/sbin/init</code>) program that is on the new root so that the new root system is booted. The common way to make /init is using busybox with files like these in /boot/initrd-tree or /boot/initramfs-source: <pre> bin/busybox bin/ash -> busybox bin/sh -> busybox # run busybox to see what other "applets" can be symlinked to it # when busybox is run as a different symlinked applet name, it runs as the applet init # init can be an ash script, see slackware's /boot/initrd-tree/init for example </pre> For example, as an ash script, slackware's init does the following: <ol> <li>parse kernel parameters passed into it and set variables based on them</li> <li>start udevd and trigger rules for block devices to setup initial /dev devices</li> <li>load kernel modules and keyboard map</li> <li>run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices (any udev rules for them should do more /dev setup in the background)</li> <li>mount the root filesystem read-only at /mnt</li> <li>stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh</li> <li>shutdown udevd so it can be restarted by root system when booted</li> <li>mount --move {proc,sys,run,dev} to under /mnt</li> <li>run: exec switch_root /mnt /sbin/init $RUNLEVEL</li> </ol> The slackware mkinitrd package is a fully configured BusyBox installation that makes an external initramfs image file, initrd.gz, that is passed to the kernel by the bootloader (lilo). It could be changed to be internal to the kernel by just using initrd-tree as the CONFIG_INITRAMFS_SOURCE in the kernel config and removing initrd in the lilo.conf. The main purpose of most initramfs/initrd is to load and configure kernel modules and devices needed to mount a root filesystem. Because the spl/zfs modules are builtin, there isn't really a lot that needs to be done by an initramfs. What remains to be done is import the zfs-root pool, mount it, and exec the system /sbin/init. The kernel's "legacy" parameters <code>root=</code> and <code>rootfstype=</code> that are able to directly boot a root disk do not work with ZFS at this time because ZFS pools always need to be imported before it is possible to mount and boot on them. The automatic import that ZFS can do by using a cachefile (/etc/zfs/zpool.cache) stored in initramfs still does not work with the legacy boot parameters because at an eariler stage of the boot process, the kernel ignores a rootfs that does not contain an <code>/init</code> program, and/or the device type of an imported pool is not the device types recognized by the legacy boot as valid root devices. You could just continue to use slackware's mkinitrd package as in the "ZFS root" wiki and it works the same whether the modules are builtin or not. But, by building the spl/zfs modules in, aren't we really wanting to get rid of using the mkinitrd/initrd.gz? We'd like to have a kernel with everything in it to boot, and use a simple lilo image entry that has no initrd. We can do this, and not use the mkinitrd package, but we still need to finish our own initramfs <code>/init</code> program to import, mount, switch root, and boot. Save the following c program to "foobarz-init.c": <pre> /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * and this program compiled to /boot/initramfs-source/init * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.1" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { "zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } </pre> If foobarz-init is updated, you can find the latest version at [https://github.com/foobarz/foobarz-init github]. The foobarz-init program can be compiled two ways as of v1.1.1. First, the simpler compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: <pre> gcc --static init.c -o init strip init </pre> The second way to compile it adds support for zpool_import so that you do not have to include a <code>/etc/zfs/zpool.cache</code> file in the initramfs: <pre> gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init </pre> Note: the zpool_import support requires that you install [http://sourceforge.net/projects/libtirpc/ libtirpc] first. Read the foobarz-init source code to see how it uses kernel parameters. The params <code>root</code> and <code>rootfstype</code> are always required to tell init what root pool name to mount and the filesystem type (e.g. zfs). For the zpool_import support: <code>zpool_import_name=poolname</code>, or <code>zpool_import_guid=<guid of a pool></code> tells what pool to import. You can also import the pool with a new different name by also using <code>zpool_import_newname=newpoolname</code>. If the import is not working, <code>zpool_import_force=1</code> can be used to force import even if ZFS thinks the pool may be in use by another system. However you import the pool, either using zpool.cache or zpool_import support, the kernel param <code>root=<your poolname or newpoolname></code> and <code>rootfstype=zfs</code> needs to be given also. The zpool_import only imports, it does not say what to mount. What to mount is still told using root= and rootfstype=. Now copy the compiled static program into the initramfs: <pre> cp init /boot/initramfs-source/init </pre> Build and install kernel: <pre> cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Congrats! If this works, you can select the "vm3.2.27b" lilo entry to boot. If you are using the zpool_import support in the init program, you need to add at least the <code>zpool_import_name=zfs-root</code> param to the addappend line in lilo.conf. Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notice the <code>spl.spl_hostid=0x007f0100</code> param that works around the hostid mismatch problem while trying to import a pool; this param and hostname/ip set to use local loopback 127.0.0.1 in etc/hosts etc/HOSTNAME in initramfs will work most of the time, and if not the pool import needs to be forced. Notes on the spl and zfs packages to install: <i>If</i> you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console if booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 51c62d7bee8d99df3dce64fb7dd67968d071fdf9 789 788 2012-09-12T19:57:57Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first [http://slackwiki.com/ZFS_root "ZFS root"] wiki explains the details of running ZFS as your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create a kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternative kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. Use mountpoint=legacy so that zfs will not expect <code>zfs mount</code>, but instead expect standard <code>mount</code> for mounting zfs-root: <pre> zfs set mountpoint=legacy zfs-root </pre> Edit <code>/etc/rc.d/rc.S</code> and <code>rc.6</code> to use regular <code>mount</code> commands, remove <code>zfs</code> commands. Edit <code>rc.6</code> and remove or comment out <code>zfs export</code> command. These edits undo changes made in the "ZFS root" wiki, but it shows the two different ways of mounting a zfs filesystem. You <i>might</i> think to set <code>bootfs</code> property like this: <pre> zpool set bootfs=zfs-root zfs-root </pre> However, this will result in ZFS placing many restrictions on zfs-root as per how that option is used on Solaris systems: <ol> <li> zfs-root must be VTOC (SMI) label, not GPT (EFI) label</li> <li> zfs-root can only contain 1 vdev: either a plain disk, or a mirror</li> </ol> So, do <b>NOT</b> set that property! If <code>bootfs</code> is set, you would find that you cannot add vdevs to your zfs-root. If it is set already, then unset it like this: <pre> zpool set bootfs= zfs-root </pre> Make a directory to store files to be inside the initramfs: <pre> mkdir /boot/initramfs-source </pre> This directory will hold some files for the initial rootfs inside the kernel. Your <code>/boot</code> should be on a small ext4 partition or on a mounted USB stick that you use to boot. Extract the slackware kernel-source package to obtain a copy of the kernel source, and make an initial kernel config for it: <pre> cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support File systems -> <*> The Extended 4 (ext4) filesystem # build in any hard drive controllers and filesystems that you need for booting # then save the config make prepare scripts </pre> The kernel source has been set to have a "Local version" <code>b</code>. This will result in modules installed to <code>/lib/modules/3.2.27b</code> and keeps this kernel's source and modules seperate from slackware's kernel-generic package installation. The <code>make prepare scripts</code> command readies the kernel source as needed before we can install a copy of spl and zfs modules into the kernel source tree. Now proceed to configure and copy spl and zfs into the kernel source tree: <pre> cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install </pre> At this point, the <code>copy-builtin</code> scripts have installed the configured spl and zfs modules source into the kernel source. The regular <code>make menuconfig</code> in the kernel source should now show options for spl and zfs in the kernel config. As of this writing, the copy-builtin script places the spl and zfs modules into the kernel source in places where the modules may not initialize in the best order, <i>after</i> all lower-level storage drivers are initialized. If spl and zfs initialize too soon, there is a chance they may not be able to see all of the storage devices. The order of initialization (as seen in dmesg) of modules that are builtin to the kernel is the order that the modules are linked into the kernel during kernel compilation. The order of link depends on where the module source files are located in the kernel source tree. To ensure that spl and zfs will initialize after all hardware drivers, we move them into the <code>drivers</code> tree and after all other drivers: <pre> cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF </pre> This completes the move of the spl and zfs modules in the kernel source tree to be under <code>drivers/zfsonlinux</code>. Now, in kernel configuration, you can build in the modules as follows: <pre> cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS </pre> In the kernel config, we set <code>/boot/initramfs-source</code> as source location of the contents to be linked into kernel's builtin initramfs (rootfs). Now, we create some files that are needed to be in the initramfs: <pre> cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 </pre> This should be enough device nodes initially in the initramfs. Once devtmpfs mounts over /dev inside initramfs, a lot more devices are available in it by default. The initramfs needs an <code>/init</code> program that will be run automatically by the kernel as process id 1, the first program to run on the system. This program's task is to mount a root filesystem, switch it to be the new root (/), and then exec the init (<code>/sbin/init</code>) program that is on the new root so that the new root system is booted. The common way to make /init is using busybox with files like these in /boot/initrd-tree or /boot/initramfs-source: <pre> bin/busybox bin/ash -> busybox bin/sh -> busybox # run busybox to see what other "applets" can be symlinked to it # when busybox is run as a different symlinked applet name, it runs as the applet init # init can be an ash script, see slackware's /boot/initrd-tree/init for example </pre> For example, as an ash script, slackware's init does the following: <ol> <li>parse kernel parameters passed into it and set variables based on them</li> <li>start udevd and trigger rules for block devices to setup initial /dev devices</li> <li>load kernel modules and keyboard map</li> <li>run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices (any udev rules for them should do more /dev setup in the background)</li> <li>mount the root filesystem read-only at /mnt</li> <li>stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh</li> <li>shutdown udevd so it can be restarted by root system when booted</li> <li>mount --move {proc,sys,run,dev} to under /mnt</li> <li>run: exec switch_root /mnt /sbin/init $RUNLEVEL</li> </ol> The slackware mkinitrd package is a fully configured BusyBox installation that makes an external initramfs image file, initrd.gz, that is passed to the kernel by the bootloader (lilo). It could be changed to be internal to the kernel by just using initrd-tree as the CONFIG_INITRAMFS_SOURCE in the kernel config and removing initrd in the lilo.conf. The main purpose of most initramfs/initrd is to load and configure kernel modules and devices needed to mount a root filesystem. Because the spl/zfs modules are builtin, there isn't really a lot that needs to be done by an initramfs. What remains to be done is import the zfs-root pool, mount it, and exec the system /sbin/init. The kernel's "legacy" parameters <code>root=</code> and <code>rootfstype=</code> that are able to directly boot a root disk do not work with ZFS at this time because ZFS pools always need to be imported before it is possible to mount and boot on them. The automatic import that ZFS can do by using a cachefile (/etc/zfs/zpool.cache) stored in initramfs still does not work with the legacy boot parameters because at an eariler stage of the boot process, the kernel ignores a rootfs that does not contain an <code>/init</code> program, and/or the device type of an imported pool is not the device types recognized by the legacy boot as valid root devices. You could just continue to use slackware's mkinitrd package as in the "ZFS root" wiki and it works the same whether the modules are builtin or not. But, by building the spl/zfs modules in, aren't we really wanting to get rid of using the mkinitrd/initrd.gz? We'd like to have a kernel with everything in it to boot, and use a simple lilo image entry that has no initrd. We can do this, and not use the mkinitrd package, but we still need to finish our own initramfs <code>/init</code> program to import, mount, switch root, and boot. Save the following c program to "foobarz-init.c": <pre> /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * and this program compiled to /boot/initramfs-source/init * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.1" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { "zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } </pre> If foobarz-init is updated, you can find the latest version at [https://github.com/foobarz/foobarz-init github]. The foobarz-init program can be compiled two ways as of v1.1.1. First, the simpler compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: <pre> gcc --static init.c -o init strip init </pre> The second way to compile it adds support for zpool_import so that you do not have to include a <code>/etc/zfs/zpool.cache</code> file in the initramfs: <pre> gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init </pre> Dependencies required before you can compile this second way: <ul> <li> Install [http://sourceforge.net/projects/libtirpc/ libtirpc]. The glibc package has removed the RPC-related functions from the static libc. The libtirpc is the new replacement as a separate library. You can make your own libtirpc package and install it to resolve these RPC-related functions. Without this, the compile fails because it cannot find many "xdr" functions.</li> <li> Reinstall the [ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-current/source/a/util-linux/ util-linux] package with static libraries enabled. Edit the <code>util-linux.SlackBuild</code> and remove the line <code>--disable-static</code>, then build it and use upgradepkg to install the new package. This resolves linking static to libuuid.</li> </ul> With these dependencies, you can probably compile static with the zpool_import support. The exact location of "zfs_config.h" may vary depending on your zfs and kernel versions, so adjust accordingly. Read the foobarz-init source code to see how it uses kernel parameters. The params <code>root</code> and <code>rootfstype</code> are always required to tell init what root pool name to mount and the filesystem type (e.g. zfs). For the zpool_import support: <code>zpool_import_name=poolname</code>, or <code>zpool_import_guid=<guid of a pool></code> tells what pool to import. You can also import the pool with a new different name by also using <code>zpool_import_newname=newpoolname</code>. If the import is not working, <code>zpool_import_force=1</code> can be used to force import even if ZFS thinks the pool may be in use by another system. However you import the pool, either using zpool.cache or zpool_import support, the kernel param <code>root=<your poolname or newpoolname></code> and <code>rootfstype=zfs</code> needs to be given also. The zpool_import only imports, it does not say what to mount. What to mount is still told using root= and rootfstype=. Now copy the compiled static program into the initramfs: <pre> cp init /boot/initramfs-source/init </pre> Build and install kernel: <pre> cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Congrats! If this works, you can select the "vm3.2.27b" lilo entry to boot. If you are using the zpool_import support in the init program, you need to add at least the <code>zpool_import_name=zfs-root</code> param to the addappend line in lilo.conf. Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notice the <code>spl.spl_hostid=0x007f0100</code> param that works around the hostid mismatch problem while trying to import a pool; this param and hostname/ip set to use local loopback 127.0.0.1 in etc/hosts etc/HOSTNAME in initramfs will work most of the time, and if not the pool import needs to be forced. Notes on the spl and zfs packages to install: <i>If</i> you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console if booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! ffa83d5e54949551d9bb2a74f798941a8d627adf 790 789 2012-09-12T22:31:37Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first [http://slackwiki.com/ZFS_root "ZFS root"] wiki explains the details of running ZFS as your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create a kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternative kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. Use mountpoint=legacy so that zfs will not expect <code>zfs mount</code>, but instead expect standard <code>mount</code> for mounting zfs-root: <pre> zfs set mountpoint=legacy zfs-root </pre> Edit <code>/etc/rc.d/rc.S</code> and <code>rc.6</code> to use regular <code>mount</code> commands, remove <code>zfs</code> commands. Edit <code>rc.6</code> and remove or comment out <code>zfs export</code> command. These edits undo changes made in the "ZFS root" wiki, but it shows the two different ways of mounting a zfs filesystem. You <i>might</i> think to set <code>bootfs</code> property like this: <pre> zpool set bootfs=zfs-root zfs-root </pre> However, this will result in ZFS placing many restrictions on zfs-root as per how that option is used on Solaris systems: <ol> <li> zfs-root must be VTOC (SMI) label, not GPT (EFI) label</li> <li> zfs-root can only contain 1 vdev: either a plain disk, or a mirror</li> </ol> So, do <b>NOT</b> set that property! If <code>bootfs</code> is set, you would find that you cannot add vdevs to your zfs-root. If it is set already, then unset it like this: <pre> zpool set bootfs= zfs-root </pre> Make a directory to store files to be inside the initramfs: <pre> mkdir /boot/initramfs-source </pre> This directory will hold some files for the initial rootfs inside the kernel. Your <code>/boot</code> should be on a small ext4 partition or on a mounted USB stick that you use to boot. Extract the slackware kernel-source package to obtain a copy of the kernel source, and make an initial kernel config for it: <pre> cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support File systems -> <*> The Extended 4 (ext4) filesystem # build in any hard drive controllers and filesystems that you need for booting # then save the config make prepare scripts </pre> The kernel source has been set to have a "Local version" <code>b</code>. This will result in modules installed to <code>/lib/modules/3.2.27b</code> and keeps this kernel's source and modules seperate from slackware's kernel-generic package installation. The <code>make prepare scripts</code> command readies the kernel source as needed before we can install a copy of spl and zfs modules into the kernel source tree. Now proceed to configure and copy spl and zfs into the kernel source tree: <pre> cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install </pre> At this point, the <code>copy-builtin</code> scripts have installed the configured spl and zfs modules source into the kernel source. The regular <code>make menuconfig</code> in the kernel source should now show options for spl and zfs in the kernel config. As of this writing, the copy-builtin script places the spl and zfs modules into the kernel source in places where the modules may not initialize in the best order, <i>after</i> all lower-level storage drivers are initialized. If spl and zfs initialize too soon, there is a chance they may not be able to see all of the storage devices. The order of initialization (as seen in dmesg) of modules that are builtin to the kernel is the order that the modules are linked into the kernel during kernel compilation. The order of link depends on where the module source files are located in the kernel source tree. To ensure that spl and zfs will initialize after all hardware drivers, we move them into the <code>drivers</code> tree and after all other drivers: <pre> cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF </pre> This completes the move of the spl and zfs modules in the kernel source tree to be under <code>drivers/zfsonlinux</code>. Now, in kernel configuration, you can build in the modules as follows: <pre> cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS </pre> In the kernel config, we set <code>/boot/initramfs-source</code> as source location of the contents to be linked into kernel's builtin initramfs (rootfs). Now, we create some files that are needed to be in the initramfs: <pre> cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 </pre> This should be enough device nodes initially in the initramfs. Once devtmpfs mounts over /dev inside initramfs, a lot more devices are available in it by default. The initramfs needs an <code>/init</code> program that will be run automatically by the kernel as process id 1, the first program to run on the system. This program's task is to mount a root filesystem, switch it to be the new root (/), and then exec the init (<code>/sbin/init</code>) program that is on the new root so that the new root system is booted. The common way to make /init is using busybox with files like these in /boot/initrd-tree or /boot/initramfs-source: <pre> bin/busybox bin/ash -> busybox bin/sh -> busybox # run busybox to see what other "applets" can be symlinked to it # when busybox is run as a different symlinked applet name, it runs as the applet init # init can be an ash script, see slackware's /boot/initrd-tree/init for example </pre> For example, as an ash script, slackware's init does the following: <ol> <li>parse kernel parameters passed into it and set variables based on them</li> <li>start udevd and trigger rules for block devices to setup initial /dev devices</li> <li>load kernel modules and keyboard map</li> <li>run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices (any udev rules for them should do more /dev setup in the background)</li> <li>mount the root filesystem read-only at /mnt</li> <li>stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh</li> <li>shutdown udevd so it can be restarted by root system when booted</li> <li>mount --move {proc,sys,run,dev} to under /mnt</li> <li>run: exec switch_root /mnt /sbin/init $RUNLEVEL</li> </ol> The slackware mkinitrd package is a fully configured BusyBox installation that makes an external initramfs image file, initrd.gz, that is passed to the kernel by the bootloader (lilo). It could be changed to be internal to the kernel by just using initrd-tree as the CONFIG_INITRAMFS_SOURCE in the kernel config and removing initrd in the lilo.conf. The main purpose of most initramfs/initrd is to load and configure kernel modules and devices needed to mount a root filesystem. Because the spl/zfs modules are builtin, there isn't really a lot that needs to be done by an initramfs. What remains to be done is import the zfs-root pool, mount it, and exec the system /sbin/init. The kernel's "legacy" parameters <code>root=</code> and <code>rootfstype=</code> that are able to directly boot a root disk do not work with ZFS at this time because ZFS pools always need to be imported before it is possible to mount and boot on them. The automatic import that ZFS can do by using a cachefile (/etc/zfs/zpool.cache) stored in initramfs still does not work with the legacy boot parameters because at an eariler stage of the boot process, the kernel ignores a rootfs that does not contain an <code>/init</code> program, and/or the device type of an imported pool is not the device types recognized by the legacy boot as valid root devices. You could just continue to use slackware's mkinitrd package as in the "ZFS root" wiki and it works the same whether the modules are builtin or not. But, by building the spl/zfs modules in, aren't we really wanting to get rid of using the mkinitrd/initrd.gz? We'd like to have a kernel with everything in it to boot, and use a simple lilo image entry that has no initrd. We can do this, and not use the mkinitrd package, but we still need to finish our own initramfs <code>/init</code> program to import, mount, switch root, and boot. Save the following c program to "foobarz-init.c": <pre> /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * and this program compiled to /boot/initramfs-source/init * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.1" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { "zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } </pre> If foobarz-init is updated, you can find the latest version at [https://github.com/foobarz/foobarz-init github]. The foobarz-init program can be compiled two ways as of v1.1.1. First, the simpler compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: <pre> gcc --static init.c -o init strip init </pre> The second way to compile it adds support for zpool_import so that you do not have to include a <code>/etc/zfs/zpool.cache</code> file in the initramfs: <pre> gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init </pre> Dependencies required before you can compile this second way: <ul> <li> Install [http://sourceforge.net/projects/libtirpc/ libtirpc]. The glibc package has removed the RPC-related functions from the static libc. The libtirpc is the new replacement as a separate library. You can make your own libtirpc package and install it to resolve these RPC-related functions. Without this, the compile fails because it cannot find many "xdr" functions.</li> <li> Reinstall the [ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-current/source/a/util-linux/ util-linux] package with static libraries enabled. Edit the <code>util-linux.SlackBuild</code> and remove the line <code>--disable-static</code>, then build it and use upgradepkg to install the new package. This resolves linking static to libuuid.</li> <li>You may need to install the spl and zfs packages configured for --enable-linux-builtin=yes before compiling and linking to libzfs to make sure you are using the version of libzfs intended for builtin modules in case a difference between the two configurations exists. Currently, there seems to be no difference in the libzfs for either modular or builtin modules, but later there could be at least a small difference for detection of modules to load or builtin already. You may see a message that the ZFS modules stack load failed, but it can be ignored since the modules are builtin; this is just libzfs trying to load the modules even though they are builtin.</li> </ul> With these dependencies, you can probably compile static with the zpool_import support. The exact location of "zfs_config.h" may vary depending on your zfs and kernel versions, so adjust accordingly. Read the foobarz-init source code to see how it uses kernel parameters. The params <code>root</code> and <code>rootfstype</code> are always required to tell init what root pool name to mount and the filesystem type (e.g. zfs). For the zpool_import support: <code>zpool_import_name=poolname</code>, or <code>zpool_import_guid=<guid of a pool></code> tells what pool to import. You can also import the pool with a new different name by also using <code>zpool_import_newname=newpoolname</code>. If the import is not working, <code>zpool_import_force=1</code> can be used to force import even if ZFS thinks the pool may be in use by another system. However you import the pool, either using zpool.cache or zpool_import support, the kernel param <code>root=<your poolname or newpoolname></code> and <code>rootfstype=zfs</code> needs to be given also. The zpool_import only imports, it does not say what to mount. What to mount is still told using root= and rootfstype=. Now copy the compiled static program into the initramfs: <pre> cp init /boot/initramfs-source/init </pre> Build and install kernel: <pre> cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Congrats! If this works, you can select the "vm3.2.27b" lilo entry to boot. If you are using the zpool_import support in the init program, you need to add at least the <code>zpool_import_name=zfs-root</code> param to the addappend line in lilo.conf. Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notice the <code>spl.spl_hostid=0x007f0100</code> param that works around the hostid mismatch problem while trying to import a pool; this param and hostname/ip set to use local loopback 127.0.0.1 in etc/hosts etc/HOSTNAME in initramfs will work most of the time, and if not the pool import needs to be forced. Notes on the spl and zfs packages to install: <i>If</i> you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console if booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 5d2793d13874cfbec7f2bba565efaada233c30ba 791 790 2012-09-12T22:50:19Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first [http://slackwiki.com/ZFS_root "ZFS root"] wiki explains the details of running ZFS as your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create a kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternative kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. Use mountpoint=legacy so that zfs will not expect <code>zfs mount</code>, but instead expect standard <code>mount</code> for mounting zfs-root: <pre> zfs set mountpoint=legacy zfs-root </pre> Edit <code>/etc/rc.d/rc.S</code> and <code>rc.6</code> to use regular <code>mount</code> commands, remove <code>zfs</code> commands. Edit <code>rc.6</code> and remove or comment out <code>zfs export</code> command. These edits undo changes made in the "ZFS root" wiki, but it shows the two different ways of mounting a zfs filesystem. You <i>might</i> think to set <code>bootfs</code> property like this: <pre> zpool set bootfs=zfs-root zfs-root </pre> However, this will result in ZFS placing many restrictions on zfs-root as per how that option is used on Solaris systems: <ol> <li> zfs-root must be VTOC (SMI) label, not GPT (EFI) label</li> <li> zfs-root can only contain 1 vdev: either a plain disk, or a mirror</li> </ol> So, do <b>NOT</b> set that property! If <code>bootfs</code> is set, you would find that you cannot add vdevs to your zfs-root. If it is set already, then unset it like this: <pre> zpool set bootfs= zfs-root </pre> Make a directory to store files to be inside the initramfs: <pre> mkdir /boot/initramfs-source </pre> This directory will hold some files for the initial rootfs inside the kernel. Your <code>/boot</code> should be on a small ext4 partition or on a mounted USB stick that you use to boot. Extract the slackware kernel-source package to obtain a copy of the kernel source, and make an initial kernel config for it: <pre> cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support File systems -> <*> The Extended 4 (ext4) filesystem # build in any hard drive controllers and filesystems that you need for booting # then save the config make prepare scripts </pre> The kernel source has been set to have a "Local version" <code>b</code>. This will result in modules installed to <code>/lib/modules/3.2.27b</code> and keeps this kernel's source and modules seperate from slackware's kernel-generic package installation. The <code>make prepare scripts</code> command readies the kernel source as needed before we can install a copy of spl and zfs modules into the kernel source tree. Now proceed to configure and copy spl and zfs into the kernel source tree: <pre> cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install </pre> At this point, the <code>copy-builtin</code> scripts have installed the configured spl and zfs modules source into the kernel source. The regular <code>make menuconfig</code> in the kernel source should now show options for spl and zfs in the kernel config. As of this writing, the copy-builtin script places the spl and zfs modules into the kernel source in places where the modules may not initialize in the best order, <i>after</i> all lower-level storage drivers are initialized. If spl and zfs initialize too soon, there is a chance they may not be able to see all of the storage devices. The order of initialization (as seen in dmesg) of modules that are builtin to the kernel is the order that the modules are linked into the kernel during kernel compilation. The order of link depends on where the module source files are located in the kernel source tree. To ensure that spl and zfs will initialize after all hardware drivers, we move them into the <code>drivers</code> tree and after all other drivers: <pre> cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF </pre> This completes the move of the spl and zfs modules in the kernel source tree to be under <code>drivers/zfsonlinux</code>. Now, in kernel configuration, you can build in the modules as follows: <pre> cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS </pre> In the kernel config, we set <code>/boot/initramfs-source</code> as source location of the contents to be linked into kernel's builtin initramfs (rootfs). Now, we create some files that are needed to be in the initramfs: <pre> cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 </pre> This should be enough device nodes initially in the initramfs. Once devtmpfs mounts over /dev inside initramfs, a lot more devices are available in it by default. The initramfs needs an <code>/init</code> program that will be run automatically by the kernel as process id 1, the first program to run on the system. This program's task is to mount a root filesystem, switch it to be the new root (/), and then exec the init (<code>/sbin/init</code>) program that is on the new root so that the new root system is booted. The common way to make /init is using busybox with files like these in /boot/initrd-tree or /boot/initramfs-source: <pre> bin/busybox bin/ash -> busybox bin/sh -> busybox # run busybox to see what other "applets" can be symlinked to it # when busybox is run as a different symlinked applet name, it runs as the applet init # init can be an ash script, see slackware's /boot/initrd-tree/init for example </pre> For example, as an ash script, slackware's init does the following: <ol> <li>parse kernel parameters passed into it and set variables based on them</li> <li>start udevd and trigger rules for block devices to setup initial /dev devices</li> <li>load kernel modules and keyboard map</li> <li>run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices (any udev rules for them should do more /dev setup in the background)</li> <li>mount the root filesystem read-only at /mnt</li> <li>stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh</li> <li>shutdown udevd so it can be restarted by root system when booted</li> <li>mount --move {proc,sys,run,dev} to under /mnt</li> <li>run: exec switch_root /mnt /sbin/init $RUNLEVEL</li> </ol> The slackware mkinitrd package is a fully configured BusyBox installation that makes an external initramfs image file, initrd.gz, that is passed to the kernel by the bootloader (lilo). It could be changed to be internal to the kernel by just using initrd-tree as the CONFIG_INITRAMFS_SOURCE in the kernel config and removing initrd in the lilo.conf. The main purpose of most initramfs/initrd is to load and configure kernel modules and devices needed to mount a root filesystem. Because the spl/zfs modules are builtin, there isn't really a lot that needs to be done by an initramfs. What remains to be done is import the zfs-root pool, mount it, and exec the system /sbin/init. The kernel's "legacy" parameters <code>root=</code> and <code>rootfstype=</code> that are able to directly boot a root disk do not work with ZFS at this time because ZFS pools always need to be imported before it is possible to mount and boot on them. The automatic import that ZFS can do by using a cachefile (/etc/zfs/zpool.cache) stored in initramfs still does not work with the legacy boot parameters because at an eariler stage of the boot process, the kernel ignores a rootfs that does not contain an <code>/init</code> program, and/or the device type of an imported pool is not the device types recognized by the legacy boot as valid root devices. You could just continue to use slackware's mkinitrd package as in the "ZFS root" wiki and it works the same whether the modules are builtin or not. But, by building the spl/zfs modules in, aren't we really wanting to get rid of using the mkinitrd/initrd.gz? We'd like to have a kernel with everything in it to boot, and use a simple lilo image entry that has no initrd. We can do this, and not use the mkinitrd package, but we still need to finish our own initramfs <code>/init</code> program to import, mount, switch root, and boot. Save the following c program to "foobarz-init.c": <pre> /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * and this program compiled to /boot/initramfs-source/init * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.1" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { "zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } </pre> If foobarz-init is updated, you can find the latest version at [https://github.com/foobarz/foobarz-init github]. The foobarz-init program can be compiled two ways as of v1.1.1. First, the simpler compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: <pre> gcc --static init.c -o init strip init </pre> The second way to compile it adds support for zpool_import so that you do not have to include a <code>/etc/zfs/zpool.cache</code> file in the initramfs: <pre> gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init </pre> Dependencies required before you can compile this second way: <ul> <li> Install [http://sourceforge.net/projects/libtirpc/ libtirpc]. The glibc package has removed the RPC-related functions from the static libc. The libtirpc is the new replacement as a separate library. You can make your own libtirpc package and install it to resolve these RPC-related functions. Without this, the compile fails because it cannot find many "xdr" functions.</li> <li> Reinstall the [ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-current/source/a/util-linux/ util-linux] package with static libraries enabled. Edit the <code>util-linux.SlackBuild</code> and remove the line <code>--disable-static</code>, then build it and use upgradepkg to install the new package. This resolves linking static to libuuid.</li> <li><code>zfs_config.h</code> can be found in the kernel source when you have installed the builtin spl/zfs configuration; for example at <code>/usr/src/linux-3.2.27b/zfs_config.h</code>. If you currently have installed the modular spl/zfs configuration, <code>zfs_config.h</code> is found where the zfs module headers are installed; for example at <code>/usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h</code>. Wherever it is, <code>-include</code> it as shown in the example gcc line above. zfs_config.h seems misplaced because it would seem that using libzfs shouldn't depend on modules header files.</li> <li>You may need to install the spl and zfs packages configured for --enable-linux-builtin=yes before compiling and linking to libzfs to make sure you are using the version of libzfs intended for builtin modules in case a difference between the two configurations exists. Currently, there seems to be no difference in the libzfs for either modular or builtin modules, but later there could be at least a small difference for detection of modules to load or builtin already. You may see a message that the ZFS modules stack load failed, but it can be ignored since the modules are builtin; this is just libzfs trying to load the modules even though they are builtin.</li> </ul> With these dependencies, you can probably compile static with the zpool_import support. The exact location of "zfs_config.h" may vary depending on your zfs and kernel versions, so adjust accordingly. Read the foobarz-init source code to see how it uses kernel parameters. The params <code>root</code> and <code>rootfstype</code> are always required to tell init what root pool name to mount and the filesystem type (e.g. zfs). For the zpool_import support: <code>zpool_import_name=poolname</code>, or <code>zpool_import_guid=<guid of a pool></code> tells what pool to import. You can also import the pool with a new different name by also using <code>zpool_import_newname=newpoolname</code>. If the import is not working, <code>zpool_import_force=1</code> can be used to force import even if ZFS thinks the pool may be in use by another system. However you import the pool, either using zpool.cache or zpool_import support, the kernel param <code>root=<your poolname or newpoolname></code> and <code>rootfstype=zfs</code> needs to be given also. The zpool_import only imports, it does not say what to mount. What to mount is still told using root= and rootfstype=. Now copy the compiled static program into the initramfs: <pre> cp init /boot/initramfs-source/init </pre> Build and install kernel: <pre> cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Congrats! If this works, you can select the "vm3.2.27b" lilo entry to boot. If you are using the zpool_import support in the init program, you need to add at least the <code>zpool_import_name=zfs-root</code> param to the addappend line in lilo.conf. Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notice the <code>spl.spl_hostid=0x007f0100</code> param that works around the hostid mismatch problem while trying to import a pool; this param and hostname/ip set to use local loopback 127.0.0.1 in etc/hosts etc/HOSTNAME in initramfs will work most of the time, and if not the pool import needs to be forced. Notes on the spl and zfs packages to install: <i>If</i> you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console if booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 5fd81aa60eef8f863fcbcd7b88acd908d845bd66 794 791 2012-09-14T14:29:31Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first [http://slackwiki.com/ZFS_root "ZFS root"] wiki explains the details of running ZFS as your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create a kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternative kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. Use mountpoint=legacy so that zfs will not expect <code>zfs mount</code>, but instead expect standard <code>mount</code> for mounting zfs-root: <pre> zfs set mountpoint=legacy zfs-root </pre> Edit <code>/etc/rc.d/rc.S</code> and <code>rc.6</code> to use regular <code>mount</code> commands, remove <code>zfs</code> commands. Edit <code>rc.6</code> and remove or comment out <code>zpool export</code> command. These edits undo changes made in the "ZFS root" wiki, but it shows the two different ways of mounting a zfs filesystem. You <i>might</i> think to set <code>bootfs</code> property like this: <pre> zpool set bootfs=zfs-root zfs-root </pre> However, this will result in ZFS placing many restrictions on zfs-root as per how that option is used on Solaris systems: <ol> <li> zfs-root must be VTOC (SMI) label, not GPT (EFI) label</li> <li> zfs-root can only contain 1 vdev: either a plain disk, or a mirror</li> </ol> So, do <b>NOT</b> set that property! If <code>bootfs</code> is set, you would find that you cannot add vdevs to your zfs-root. If it is set already, then unset it like this: <pre> zpool set bootfs= zfs-root </pre> Make a directory to store files to be inside the initramfs: <pre> mkdir /boot/initramfs-source </pre> This directory will hold some files for the initial rootfs inside the kernel. Your <code>/boot</code> should be on a small ext4 partition or on a mounted USB stick that you use to boot. Extract the slackware kernel-source package to obtain a copy of the kernel source, and make an initial kernel config for it: <pre> cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.27 /usr/src/linux-3.2.27b rm -r install cd /usr/src/linux-3.2.27b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support File systems -> <*> The Extended 4 (ext4) filesystem # build in any hard drive controllers and filesystems that you need for booting # then save the config make prepare scripts </pre> The kernel source has been set to have a "Local version" <code>b</code>. This will result in modules installed to <code>/lib/modules/3.2.27b</code> and keeps this kernel's source and modules seperate from slackware's kernel-generic package installation. The <code>make prepare scripts</code> command readies the kernel source as needed before we can install a copy of spl and zfs modules into the kernel source tree. Now proceed to configure and copy spl and zfs into the kernel source tree: <pre> cd ~/src tar xvzf ~/spl-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc10.tar.gz mkdir install cd spl-0.6.0-rc10 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.27b \ --with-linux-obj=/usr/src/linux-3.2.27b \ --with-spl=/root/src/spl-0.6.0-rc10 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.27b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc10_3.2.27b-x86_64-1root.txz cd .. rm -r install </pre> At this point, the <code>copy-builtin</code> scripts have installed the configured spl and zfs modules source into the kernel source. The regular <code>make menuconfig</code> in the kernel source should now show options for spl and zfs in the kernel config. As of this writing, the copy-builtin script places the spl and zfs modules into the kernel source in places where the modules may not initialize in the best order, <i>after</i> all lower-level storage drivers are initialized. If spl and zfs initialize too soon, there is a chance they may not be able to see all of the storage devices. The order of initialization (as seen in dmesg) of modules that are builtin to the kernel is the order that the modules are linked into the kernel during kernel compilation. The order of link depends on where the module source files are located in the kernel source tree. To ensure that spl and zfs will initialize after all hardware drivers, we move them into the <code>drivers</code> tree and after all other drivers: <pre> cd /usr/src/linux-3.2.27b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.27b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.27b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.27b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.27b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.27b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF </pre> This completes the move of the spl and zfs modules in the kernel source tree to be under <code>drivers/zfsonlinux</code>. Now, in kernel configuration, you can build in the modules as follows: <pre> cd /usr/src/linux-3.2.27b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS </pre> In the kernel config, we set <code>/boot/initramfs-source</code> as source location of the contents to be linked into kernel's builtin initramfs (rootfs). Now, we create some files that are needed to be in the initramfs: <pre> cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 </pre> This should be enough device nodes initially in the initramfs. Once devtmpfs mounts over /dev inside initramfs, a lot more devices are available in it by default. The initramfs needs an <code>/init</code> program that will be run automatically by the kernel as process id 1, the first program to run on the system. This program's task is to mount a root filesystem, switch it to be the new root (/), and then exec the init (<code>/sbin/init</code>) program that is on the new root so that the new root system is booted. The common way to make /init is using busybox with files like these in /boot/initrd-tree or /boot/initramfs-source: <pre> bin/busybox bin/ash -> busybox bin/sh -> busybox # run busybox to see what other "applets" can be symlinked to it # when busybox is run as a different symlinked applet name, it runs as the applet init # init can be an ash script, see slackware's /boot/initrd-tree/init for example </pre> For example, as an ash script, slackware's init does the following: <ol> <li>parse kernel parameters passed into it and set variables based on them</li> <li>start udevd and trigger rules for block devices to setup initial /dev devices</li> <li>load kernel modules and keyboard map</li> <li>run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices (any udev rules for them should do more /dev setup in the background)</li> <li>mount the root filesystem read-only at /mnt</li> <li>stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh</li> <li>shutdown udevd so it can be restarted by root system when booted</li> <li>mount --move {proc,sys,run,dev} to under /mnt</li> <li>run: exec switch_root /mnt /sbin/init $RUNLEVEL</li> </ol> The slackware mkinitrd package is a fully configured BusyBox installation that makes an external initramfs image file, initrd.gz, that is passed to the kernel by the bootloader (lilo). It could be changed to be internal to the kernel by just using initrd-tree as the CONFIG_INITRAMFS_SOURCE in the kernel config and removing initrd in the lilo.conf. The main purpose of most initramfs/initrd is to load and configure kernel modules and devices needed to mount a root filesystem. Because the spl/zfs modules are builtin, there isn't really a lot that needs to be done by an initramfs. What remains to be done is import the zfs-root pool, mount it, and exec the system /sbin/init. The kernel's "legacy" parameters <code>root=</code> and <code>rootfstype=</code> that are able to directly boot a root disk do not work with ZFS at this time because ZFS pools always need to be imported before it is possible to mount and boot on them. The automatic import that ZFS can do by using a cachefile (/etc/zfs/zpool.cache) stored in initramfs still does not work with the legacy boot parameters because at an earlier stage of the boot process, the kernel ignores a rootfs that does not contain an <code>/init</code> program, and/or the device type of an imported pool is not the device types recognized by the legacy boot as valid root devices. You could just continue to use slackware's mkinitrd package as in the "ZFS root" wiki and it works the same whether the modules are builtin or not. But, by building the spl/zfs modules in, aren't we really wanting to get rid of using the mkinitrd/initrd.gz? We'd like to have a kernel with everything in it to boot, and use a simple lilo image entry that has no initrd. We can do this, and not use the mkinitrd package, but we still need to finish our own initramfs <code>/init</code> program to import, mount, switch root, and boot. Save the following c program to "foobarz-init.c": <pre> /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * and this program compiled to /boot/initramfs-source/init * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.1" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { "zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } </pre> If foobarz-init is updated, you can find the latest version at [https://github.com/foobarz/foobarz-init github]. The foobarz-init program can be compiled two ways as of v1.1.1. First, the simpler compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: <pre> gcc --static init.c -o init strip init </pre> The second way to compile it adds support for zpool_import so that you do not have to include a <code>/etc/zfs/zpool.cache</code> file in the initramfs: <pre> gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init </pre> Dependencies required before you can compile this second way: <ul> <li> Install [http://sourceforge.net/projects/libtirpc/ libtirpc]. The glibc package has removed the RPC-related functions from the static libc. The libtirpc is the new replacement as a separate library. You can make your own libtirpc package and install it to resolve these RPC-related functions. Without this, the compile fails because it cannot find many "xdr" functions.</li> <li> Reinstall the [ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-current/source/a/util-linux/ util-linux] package with static libraries enabled. Edit the <code>util-linux.SlackBuild</code> and remove the line <code>--disable-static</code>, then build it and use upgradepkg to install the new package. This resolves linking static to libuuid.</li> <li><code>zfs_config.h</code> can be found in the kernel source when you have installed the builtin spl/zfs configuration; for example at <code>/usr/src/linux-3.2.27b/zfs_config.h</code>. If you currently have installed the modular spl/zfs configuration, <code>zfs_config.h</code> is found where the zfs module headers are installed; for example at <code>/usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h</code>. Wherever it is, <code>-include</code> it as shown in the example gcc line above. zfs_config.h seems misplaced because it would seem that using libzfs shouldn't depend on modules header files.</li> <li>You may need to install the spl and zfs packages configured for --enable-linux-builtin=yes before compiling and linking to libzfs to make sure you are using the version of libzfs intended for builtin modules in case a difference between the two configurations exists. Currently, there seems to be no difference in the libzfs for either modular or builtin modules, but later there could be at least a small difference for detection of modules to load or builtin already. You may see a message that the ZFS modules stack load failed, but it can be ignored since the modules are builtin; this is just libzfs trying to load the modules even though they are builtin.</li> </ul> With these dependencies, you can probably compile static with the zpool_import support. The exact location of "zfs_config.h" may vary depending on your zfs and kernel versions, so adjust accordingly. Read the foobarz-init source code to see how it uses kernel parameters. The params <code>root</code> and <code>rootfstype</code> are always required to tell init what root pool name to mount and the filesystem type (e.g. zfs). For the zpool_import support: <code>zpool_import_name=poolname</code>, or <code>zpool_import_guid=<guid of a pool></code> tells what pool to import. You can also import the pool with a new different name by also using <code>zpool_import_newname=newpoolname</code>. If the import is not working, <code>zpool_import_force=1</code> can be used to force import even if ZFS thinks the pool may be in use by another system. However you import the pool, either using zpool.cache or zpool_import support, the kernel param <code>root=<your poolname or newpoolname></code> and <code>rootfstype=zfs</code> needs to be given also. The zpool_import only imports, it does not say what to mount. What to mount is still told using root= and rootfstype=. Now copy the compiled static program into the initramfs: <pre> cp init /boot/initramfs-source/init </pre> Build and install kernel: <pre> cd /usr/src/linux-3.2.27b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.27b cp System.map /boot/System.map-vm3.2.27b # add new lilo menu entry for vm3.2.27b kernel vi /etc/lilo.conf image = /boot/vm3.2.27b label = vm3.2.27b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Note: If <code>spl.spl_hostid=0x007f0100</code> is not included in addappend, then during boot SPL module will attempt to read /etc/hostid or run a user-space helper to write the <code>hostid</code> into <code>/proc/sys/kernel/spl/hostid</code>. Reading /etc/hostid fails unless you use foobarz-chhostid and make the file and copy it into /boot/initramfs-source/etc/hostid. The helper will fail because no <code>sh</code> shell and no <code>hostid</code> command are installed in the initramfs. The default hostid becomes 0xffffffff, which is considered an invalid hostid. Congrats! If this works, you can select the "vm3.2.27b" lilo entry to boot. If you are using the zpool_import support in the init program, you need to add at least the <code>zpool_import_name=zfs-root</code> param to the addappend line in lilo.conf. Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notice the <code>spl.spl_hostid=0x007f0100</code> param that works around the hostid mismatch problem while trying to import a pool; this param and hostname/ip set to use local loopback 127.0.0.1 in etc/hosts etc/HOSTNAME in initramfs will work most of the time, and if not the pool import needs to be forced. Notes on the spl and zfs packages to install: <i>If</i> you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc10_3.2.27b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.27b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console if booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 312c5aed942f06c568d1cf9e6f5674693073767d 798 794 2012-09-19T10:49:36Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first [http://slackwiki.com/ZFS_root "ZFS root"] wiki explains the details of running ZFS as your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create a kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternative kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. Use mountpoint=legacy so that zfs will not expect <code>zfs mount</code>, but instead expect standard <code>mount</code> for mounting zfs-root: <pre> zfs set mountpoint=legacy zfs-root </pre> Edit <code>/etc/rc.d/rc.S</code> and <code>rc.6</code> to use regular <code>mount</code> commands, remove <code>zfs</code> commands. Edit <code>rc.6</code> and remove or comment out <code>zpool export</code> command. These edits undo changes made in the "ZFS root" wiki, but it shows the two different ways of mounting a zfs filesystem. You <i>might</i> think to set <code>bootfs</code> property like this: <pre> zpool set bootfs=zfs-root zfs-root </pre> However, this will result in ZFS placing many restrictions on zfs-root as per how that option is used on Solaris systems: <ol> <li> zfs-root must be VTOC (SMI) label, not GPT (EFI) label</li> <li> zfs-root can only contain 1 vdev: either a plain disk, or a mirror</li> </ol> So, do <b>NOT</b> set that property! If <code>bootfs</code> is set, you would find that you cannot add vdevs to your zfs-root. If it is set already, then unset it like this: <pre> zpool set bootfs= zfs-root </pre> Make a directory to store files to be inside the initramfs: <pre> mkdir /boot/initramfs-source </pre> This directory will hold some files for the initial rootfs inside the kernel. Your <code>/boot</code> should be on a small ext4 partition or on a mounted USB stick that you use to boot. Extract the slackware kernel-source package to obtain a copy of the kernel source, and make an initial kernel config for it: <pre> cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.28 /usr/src/linux-3.2.28b rm -r install cd /usr/src/linux-3.2.28b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support File systems -> <*> The Extended 4 (ext4) filesystem # build in any hard drive controllers and filesystems that you need for booting # then save the config make prepare scripts </pre> The kernel source has been set to have a "Local version" <code>b</code>. This will result in modules installed to <code>/lib/modules/3.2.28b</code> and keeps this kernel's source and modules seperate from slackware's kernel-generic package installation. The <code>make prepare scripts</code> command readies the kernel source as needed before we can install a copy of spl and zfs modules into the kernel source tree. Now proceed to configure and copy spl and zfs into the kernel source tree: <pre> cd ~/src tar xvzf ~/spl-0.6.0-rc11.tar.gz mkdir install cd spl-0.6.0-rc11 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.28b \ --with-linux-obj=/usr/src/linux-3.2.28b wget https://raw.github.com/zfsonlinux/spl/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.28b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc11_3.2.28b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc11.tar.gz mkdir install cd spl-0.6.0-rc11 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.28b \ --with-linux-obj=/usr/src/linux-3.2.28b \ --with-spl=/root/src/spl-0.6.0-rc11 wget https://raw.github.com/zfsonlinux/zfs/master/copy-builtin chmod +x copy-builtin ./copy-builtin /usr/src/linux-3.2.28b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc11_3.2.28b-x86_64-1root.txz cd .. rm -r install </pre> At this point, the <code>copy-builtin</code> scripts have installed the configured spl and zfs modules source into the kernel source. The regular <code>make menuconfig</code> in the kernel source should now show options for spl and zfs in the kernel config. As of this writing, the copy-builtin script places the spl and zfs modules into the kernel source in places where the modules may not initialize in the best order, <i>after</i> all lower-level storage drivers are initialized. If spl and zfs initialize too soon, there is a chance they may not be able to see all of the storage devices. The order of initialization (as seen in dmesg) of modules that are builtin to the kernel is the order that the modules are linked into the kernel during kernel compilation. The order of link depends on where the module source files are located in the kernel source tree. To ensure that spl and zfs will initialize after all hardware drivers, we move them into the <code>drivers</code> tree and after all other drivers: <pre> cd /usr/src/linux-3.2.28b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.28b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.28b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.28b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.28b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.28b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF </pre> This completes the move of the spl and zfs modules in the kernel source tree to be under <code>drivers/zfsonlinux</code>. Now, in kernel configuration, you can build in the modules as follows: <pre> cd /usr/src/linux-3.2.28b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS </pre> In the kernel config, we set <code>/boot/initramfs-source</code> as source location of the contents to be linked into kernel's builtin initramfs (rootfs). Now, we create some files that are needed to be in the initramfs: <pre> cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache It is time to pause for a moment here and talk about zpool.cache: Using it is actually dangerous. We are not using udev and it's persistent block device filenames (/dev/disk/by-*), but are using the default kernel block device names (/dev/sd*) in devtmpfs. Device names for a hard drive in /dev can potentially change on boot depending on disk controller initialization order and disk drive response time. Adding another disk controller or hard disk on a controller can result in device name assignment changes to all the hard disks. A zpool.cache file holds all the zfs_member device filenames /dev/sd* for a pool configuration, but the zpool.cache configuration will be incorrect if device filenames have been changed or swapped around and this could result in a faulted pool that may or may not be recoverable. Using zpool.cache to import pools at boot, even with udev persistent device filenames, is potentially destructive if devices have been changed around. The proper thing to do is zpool_import and do not include zpool.cache in the initramfs. # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 </pre> This should be enough device nodes initially in the initramfs. Once devtmpfs mounts over /dev inside initramfs, a lot more devices are available in it by default. The initramfs needs an <code>/init</code> program that will be run automatically by the kernel as process id 1, the first program to run on the system. This program's task is to mount a root filesystem, switch it to be the new root (/), and then exec the init (<code>/sbin/init</code>) program that is on the new root so that the new root system is booted. The common way to make /init is using busybox with files like these in /boot/initrd-tree or /boot/initramfs-source: <pre> bin/busybox bin/ash -> busybox bin/sh -> busybox # run busybox to see what other "applets" can be symlinked to it # when busybox is run as a different symlinked applet name, it runs as the applet init # init can be an ash script, see slackware's /boot/initrd-tree/init for example </pre> For example, as an ash script, slackware's init does the following: <ol> <li>parse kernel parameters passed into it and set variables based on them</li> <li>start udevd and trigger rules for block devices to setup initial /dev devices</li> <li>load kernel modules and keyboard map</li> <li>run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices (any udev rules for them should do more /dev setup in the background)</li> <li>mount the root filesystem read-only at /mnt</li> <li>stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh</li> <li>shutdown udevd so it can be restarted by root system when booted</li> <li>mount --move {proc,sys,run,dev} to under /mnt</li> <li>run: exec switch_root /mnt /sbin/init $RUNLEVEL</li> </ol> The slackware mkinitrd package is a fully configured BusyBox installation that makes an external initramfs image file, initrd.gz, that is passed to the kernel by the bootloader (lilo). It could be changed to be internal to the kernel by just using initrd-tree as the CONFIG_INITRAMFS_SOURCE in the kernel config and removing initrd in the lilo.conf. The main purpose of most initramfs/initrd is to load and configure kernel modules and devices needed to mount a root filesystem. Because the spl/zfs modules are builtin, there isn't really a lot that needs to be done by an initramfs. What remains to be done is import the zfs-root pool, mount it, and exec the system /sbin/init. The kernel's "legacy" parameters <code>root=</code> and <code>rootfstype=</code> that are able to directly boot a root disk do not work with ZFS at this time because ZFS pools always need to be imported before it is possible to mount and boot on them. The automatic import that ZFS can do by using a cachefile (/etc/zfs/zpool.cache) stored in initramfs still does not work with the legacy boot parameters because at an earlier stage of the boot process, the kernel ignores a rootfs that does not contain an <code>/init</code> program, and/or the device type of an imported pool is not the device types recognized by the legacy boot as valid root devices. You could just continue to use slackware's mkinitrd package as in the "ZFS root" wiki and it works the same whether the modules are builtin or not. But, by building the spl/zfs modules in, aren't we really wanting to get rid of using the mkinitrd/initrd.gz? We'd like to have a kernel with everything in it to boot, and use a simple lilo image entry that has no initrd. We can do this, and not use the mkinitrd package, but we still need to finish our own initramfs <code>/init</code> program to import, mount, switch root, and boot. Save the following c program to "foobarz-init.c": <pre> /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * and this program compiled to /boot/initramfs-source/init * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.1" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc11/3.2.28/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { "zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } </pre> If foobarz-init is updated, you can find the latest version at [https://github.com/foobarz/foobarz-init github]. The foobarz-init program can be compiled two ways as of v1.1.1. First, the simpler compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: <pre> gcc --static init.c -o init strip init </pre> The second way to compile it adds support for zpool_import so that you do not have to include a <code>/etc/zfs/zpool.cache</code> file in the initramfs: <pre> gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/zfs-0.6.0-rc11/3.2.28/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init </pre> Dependencies required before you can compile this second way: <ul> <li> Install [http://sourceforge.net/projects/libtirpc/ libtirpc]. The glibc package has removed the RPC-related functions from the static libc. The libtirpc is the new replacement as a separate library. You can make your own libtirpc package and install it to resolve these RPC-related functions. Without this, the compile fails because it cannot find many "xdr" functions.</li> <li> Reinstall the [ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-current/source/a/util-linux/ util-linux] package with static libraries enabled. Edit the <code>util-linux.SlackBuild</code> and remove the line <code>--disable-static</code>, then build it and use upgradepkg to install the new package. This resolves linking static to libuuid.</li> <li><code>zfs_config.h</code> can be found in the kernel source when you have installed the builtin spl/zfs configuration; for example at <code>/usr/src/linux-3.2.28b/zfs_config.h</code>. If you currently have installed the modular spl/zfs configuration, <code>zfs_config.h</code> is found where the zfs module headers are installed; for example at <code>/usr/src/zfs-0.6.0-rc11/3.2.28/zfs_config.h</code>. Wherever it is, <code>-include</code> it as shown in the example gcc line above. zfs_config.h seems misplaced because it would seem that using libzfs shouldn't depend on modules header files.</li> <li>You may need to install the spl and zfs packages configured for --enable-linux-builtin=yes before compiling and linking to libzfs to make sure you are using the version of libzfs intended for builtin modules in case a difference between the two configurations exists. Currently, there seems to be no difference in the libzfs for either modular or builtin modules, but later there could be at least a small difference for detection of modules to load or builtin already. You may see a message that the ZFS modules stack load failed, but it can be ignored since the modules are builtin; this is just libzfs trying to load the modules even though they are builtin.</li> </ul> With these dependencies, you can probably compile static with the zpool_import support. The exact location of "zfs_config.h" may vary depending on your zfs and kernel versions, so adjust accordingly. Read the foobarz-init source code to see how it uses kernel parameters. The params <code>root</code> and <code>rootfstype</code> are always required to tell init what root pool name to mount and the filesystem type (e.g. zfs). For the zpool_import support: <code>zpool_import_name=poolname</code>, or <code>zpool_import_guid=<guid of a pool></code> tells what pool to import. You can also import the pool with a new different name by also using <code>zpool_import_newname=newpoolname</code>. If the import is not working, <code>zpool_import_force=1</code> can be used to force import even if ZFS thinks the pool may be in use by another system. However you import the pool, either using zpool.cache or zpool_import support, the kernel param <code>root=<your poolname or newpoolname></code> and <code>rootfstype=zfs</code> needs to be given also. The zpool_import only imports, it does not say what to mount. What to mount is still told using root= and rootfstype=. Now copy the compiled static program into the initramfs: <pre> cp init /boot/initramfs-source/init </pre> Build and install kernel: <pre> cd /usr/src/linux-3.2.28b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.28b cp System.map /boot/System.map-vm3.2.28b # add new lilo menu entry for vm3.2.28b kernel vi /etc/lilo.conf image = /boot/vm3.2.28b label = vm3.2.28b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Note: If <code>spl.spl_hostid=0x007f0100</code> is not included in addappend, then during boot SPL module will attempt to read /etc/hostid or run a user-space helper to write the <code>hostid</code> into <code>/proc/sys/kernel/spl/hostid</code>. Reading /etc/hostid fails unless you use foobarz-chhostid and make the file and copy it into /boot/initramfs-source/etc/hostid. The helper will fail because no <code>sh</code> shell and no <code>hostid</code> command are installed in the initramfs. The default hostid becomes 0xffffffff, which is considered an invalid hostid. Congrats! If this works, you can select the "vm3.2.28b" lilo entry to boot. If you are using the zpool_import support in the init program, you need to add at least the <code>zpool_import_name=zfs-root</code> param to the addappend line in lilo.conf. Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notice the <code>spl.spl_hostid=0x007f0100</code> param that works around the hostid mismatch problem while trying to import a pool; this param and hostname/ip set to use local loopback 127.0.0.1 in etc/hosts etc/HOSTNAME in initramfs will work most of the time, and if not the pool import needs to be forced. Notes on the spl and zfs packages to install: <i>If</i> you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc11_3.2.28b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.28b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console if booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! aef6529f2ca0f2592a21cd771dc178a812552485 799 798 2012-09-19T13:26:56Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first [http://slackwiki.com/ZFS_root "ZFS root"] wiki explains the details of running ZFS as your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create a kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternative kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. Use mountpoint=legacy so that zfs will not expect <code>zfs mount</code>, but instead expect standard <code>mount</code> for mounting zfs-root: <pre> zfs set mountpoint=legacy zfs-root </pre> Edit <code>/etc/rc.d/rc.S</code> and <code>rc.6</code> to use regular <code>mount</code> commands, remove <code>zfs</code> commands. Edit <code>rc.6</code> and remove or comment out <code>zpool export</code> command. These edits undo changes made in the "ZFS root" wiki, but it shows the two different ways of mounting a zfs filesystem. You <i>might</i> think to set <code>bootfs</code> property like this: <pre> zpool set bootfs=zfs-root zfs-root </pre> However, this will result in ZFS placing many restrictions on zfs-root as per how that option is used on Solaris systems: <ol> <li> zfs-root must be VTOC (SMI) label, not GPT (EFI) label</li> <li> zfs-root can only contain 1 vdev: either a plain disk, or a mirror</li> </ol> So, do <b>NOT</b> set that property! If <code>bootfs</code> is set, you would find that you cannot add vdevs to your zfs-root. If it is set already, then unset it like this: <pre> zpool set bootfs= zfs-root </pre> Make a directory to store files to be inside the initramfs: <pre> mkdir /boot/initramfs-source </pre> This directory will hold some files for the initial rootfs inside the kernel. Your <code>/boot</code> should be on a small ext4 partition or on a mounted USB stick that you use to boot. Extract the slackware kernel-source package to obtain a copy of the kernel source, and make an initial kernel config for it: <pre> cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.28 /usr/src/linux-3.2.28b rm -r install cd /usr/src/linux-3.2.28b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support File systems -> <*> The Extended 4 (ext4) filesystem # build in any hard drive controllers and filesystems that you need for booting # then save the config make prepare scripts </pre> The kernel source has been set to have a "Local version" <code>b</code>. This will result in modules installed to <code>/lib/modules/3.2.28b</code> and keeps this kernel's source and modules seperate from slackware's kernel-generic package installation. The <code>make prepare scripts</code> command readies the kernel source as needed before we can install a copy of spl and zfs modules into the kernel source tree. Now proceed to configure and copy spl and zfs into the kernel source tree: <pre> cd ~/src tar xvzf ~/spl-0.6.0-rc11.tar.gz mkdir install cd spl-0.6.0-rc11 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.28b \ --with-linux-obj=/usr/src/linux-3.2.28b ./copy-builtin /usr/src/linux-3.2.28b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc11_3.2.28b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc11.tar.gz mkdir install cd zfs-0.6.0-rc11 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.28b \ --with-linux-obj=/usr/src/linux-3.2.28b \ --with-spl=/root/src/spl-0.6.0-rc11 --with-spl-obj=/root/src/spl-0.6.0-rc11 ./copy-builtin /usr/src/linux-3.2.28b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc11_3.2.28b-x86_64-1root.txz cd .. rm -r install </pre> At this point, the <code>copy-builtin</code> scripts have installed the configured spl and zfs modules source into the kernel source. The regular <code>make menuconfig</code> in the kernel source should now show options for spl and zfs in the kernel config. As of this writing, the copy-builtin script places the spl and zfs modules into the kernel source in places where the modules may not initialize in the best order, <i>after</i> all lower-level storage drivers are initialized. If spl and zfs initialize too soon, there is a chance they may not be able to see all of the storage devices. The order of initialization (as seen in dmesg) of modules that are builtin to the kernel is the order that the modules are linked into the kernel during kernel compilation. The order of link depends on where the module source files are located in the kernel source tree. To ensure that spl and zfs will initialize after all hardware drivers, we can move them into the <code>drivers</code> tree and after all other drivers. This move is <bold>optional</bold> and you can skip doing this and everything will probably work fine, but it is shown here how to move the modules to under drivers in case you prefer them there: <pre> cd /usr/src/linux-3.2.28b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.28b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.28b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.28b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.28b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.28b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF </pre> This completes the move of the spl and zfs modules in the kernel source tree to be under <code>drivers/zfsonlinux</code>. Now, in kernel configuration, you can build in the modules as follows: <pre> cd /usr/src/linux-3.2.28b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS </pre> In the kernel config, we set <code>/boot/initramfs-source</code> as source location of the contents to be linked into kernel's builtin initramfs (rootfs). Now, we create some files that are needed to be in the initramfs: <pre> cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache It is time to pause for a moment here and talk about zpool.cache: Using it is actually dangerous. We are not using udev and it's persistent block device filenames (/dev/disk/by-*), but are using the default kernel block device names (/dev/sd*) in devtmpfs. Device names for a hard drive in /dev can potentially change on boot depending on disk controller initialization order and disk drive response time. Adding another disk controller or hard disk on a controller can result in device name assignment changes to all the hard disks. A zpool.cache file holds all the zfs_member device filenames /dev/sd* for a pool configuration, but the zpool.cache configuration will be incorrect if device filenames have been changed or swapped around and this could result in a faulted pool that may or may not be recoverable. Using zpool.cache to import pools at boot, even with udev persistent device filenames, is potentially destructive if devices have been changed around. The proper thing to do is zpool_import and do not include zpool.cache in the initramfs. # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 </pre> This should be enough device nodes initially in the initramfs. Once devtmpfs mounts over /dev inside initramfs, a lot more devices are available in it by default. The initramfs needs an <code>/init</code> program that will be run automatically by the kernel as process id 1, the first program to run on the system. This program's task is to mount a root filesystem, switch it to be the new root (/), and then exec the init (<code>/sbin/init</code>) program that is on the new root so that the new root system is booted. The common way to make /init is using busybox with files like these in /boot/initrd-tree or /boot/initramfs-source: <pre> bin/busybox bin/ash -> busybox bin/sh -> busybox # run busybox to see what other "applets" can be symlinked to it # when busybox is run as a different symlinked applet name, it runs as the applet init # init can be an ash script, see slackware's /boot/initrd-tree/init for example </pre> For example, as an ash script, slackware's init does the following: <ol> <li>parse kernel parameters passed into it and set variables based on them</li> <li>start udevd and trigger rules for block devices to setup initial /dev devices</li> <li>load kernel modules and keyboard map</li> <li>run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices (any udev rules for them should do more /dev setup in the background)</li> <li>mount the root filesystem read-only at /mnt</li> <li>stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh</li> <li>shutdown udevd so it can be restarted by root system when booted</li> <li>mount --move {proc,sys,run,dev} to under /mnt</li> <li>run: exec switch_root /mnt /sbin/init $RUNLEVEL</li> </ol> The slackware mkinitrd package is a fully configured BusyBox installation that makes an external initramfs image file, initrd.gz, that is passed to the kernel by the bootloader (lilo). It could be changed to be internal to the kernel by just using initrd-tree as the CONFIG_INITRAMFS_SOURCE in the kernel config and removing initrd in the lilo.conf. The main purpose of most initramfs/initrd is to load and configure kernel modules and devices needed to mount a root filesystem. Because the spl/zfs modules are builtin, there isn't really a lot that needs to be done by an initramfs. What remains to be done is import the zfs-root pool, mount it, and exec the system /sbin/init. The kernel's "legacy" parameters <code>root=</code> and <code>rootfstype=</code> that are able to directly boot a root disk do not work with ZFS at this time because ZFS pools always need to be imported before it is possible to mount and boot on them. The automatic import that ZFS can do by using a cachefile (/etc/zfs/zpool.cache) stored in initramfs still does not work with the legacy boot parameters because at an earlier stage of the boot process, the kernel ignores a rootfs that does not contain an <code>/init</code> program, and/or the device type of an imported pool is not the device types recognized by the legacy boot as valid root devices. You could just continue to use slackware's mkinitrd package as in the "ZFS root" wiki and it works the same whether the modules are builtin or not. But, by building the spl/zfs modules in, aren't we really wanting to get rid of using the mkinitrd/initrd.gz? We'd like to have a kernel with everything in it to boot, and use a simple lilo image entry that has no initrd. We can do this, and not use the mkinitrd package, but we still need to finish our own initramfs <code>/init</code> program to import, mount, switch root, and boot. Save the following c program to "foobarz-init.c": <pre> /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * and this program compiled to /boot/initramfs-source/init * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.1" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc11/3.2.28/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { "zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } </pre> If foobarz-init is updated, you can find the latest version at [https://github.com/foobarz/foobarz-init github]. The foobarz-init program can be compiled two ways as of v1.1.1. First, the simpler compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: <pre> gcc --static init.c -o init strip init </pre> The second way to compile it adds support for zpool_import so that you do not have to include a <code>/etc/zfs/zpool.cache</code> file in the initramfs: <pre> gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/linux-3.2.28b/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init </pre> Dependencies required before you can compile this second way: <ul> <li> Install [http://sourceforge.net/projects/libtirpc/ libtirpc]. The glibc package has removed the RPC-related functions from the static libc. The libtirpc is the new replacement as a separate library. You can make your own libtirpc package and install it to resolve these RPC-related functions. Without this, the compile fails because it cannot find many "xdr" functions.</li> <li> Reinstall the [ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-current/source/a/util-linux/ util-linux] package with static libraries enabled. Edit the <code>util-linux.SlackBuild</code> and remove the line <code>--disable-static</code>, then build it and use upgradepkg to install the new package. This resolves linking static to libuuid.</li> <li><code>zfs_config.h</code> can be found in the kernel source when you have installed the builtin spl/zfs configuration; for example at <code>/usr/src/linux-3.2.28b/zfs_config.h</code>. If you currently have installed the modular spl/zfs configuration, <code>zfs_config.h</code> is found where the zfs module headers are installed; for example at <code>/usr/src/zfs-0.6.0-rc11/3.2.28/zfs_config.h</code>. Wherever it is, <code>-include</code> it as shown in the example gcc line above. zfs_config.h seems misplaced because it would seem that using libzfs shouldn't depend on modules header files.</li> <li>You may need to install the spl and zfs packages configured for --enable-linux-builtin=yes before compiling and linking to libzfs to make sure you are using the version of libzfs intended for builtin modules in case a difference between the two configurations exists. Currently, there seems to be no difference in the libzfs for either modular or builtin modules, but later there could be at least a small difference for detection of modules to load or builtin already. You may see a message that the ZFS modules stack load failed, but it can be ignored since the modules are builtin; this is just libzfs trying to load the modules even though they are builtin.</li> </ul> With these dependencies, you can probably compile static with the zpool_import support. The exact location of "zfs_config.h" may vary depending on your zfs and kernel versions, so adjust accordingly. Read the foobarz-init source code to see how it uses kernel parameters. The params <code>root</code> and <code>rootfstype</code> are always required to tell init what root pool name to mount and the filesystem type (e.g. zfs). For the zpool_import support: <code>zpool_import_name=poolname</code>, or <code>zpool_import_guid=<guid of a pool></code> tells what pool to import. You can also import the pool with a new different name by also using <code>zpool_import_newname=newpoolname</code>. If the import is not working, <code>zpool_import_force=1</code> can be used to force import even if ZFS thinks the pool may be in use by another system. However you import the pool, either using zpool.cache or zpool_import support, the kernel param <code>root=<your poolname or newpoolname></code> and <code>rootfstype=zfs</code> needs to be given also. The zpool_import only imports, it does not say what to mount. What to mount is still told using root= and rootfstype=. Now copy the compiled static program into the initramfs: <pre> cp init /boot/initramfs-source/init </pre> Build and install kernel: <pre> cd /usr/src/linux-3.2.28b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.28b cp System.map /boot/System.map-vm3.2.28b # add new lilo menu entry for vm3.2.28b kernel vi /etc/lilo.conf image = /boot/vm3.2.28b label = vm3.2.28b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Note: If <code>spl.spl_hostid=0x007f0100</code> is not included in addappend, then during boot SPL module will attempt to read /etc/hostid or run a user-space helper to write the <code>hostid</code> into <code>/proc/sys/kernel/spl/hostid</code>. Reading /etc/hostid fails unless you use foobarz-chhostid and make the file and copy it into /boot/initramfs-source/etc/hostid. The helper will fail because no <code>sh</code> shell and no <code>hostid</code> command are installed in the initramfs. The default hostid becomes 0xffffffff, which is considered an invalid hostid. Congrats! If this works, you can select the "vm3.2.28b" lilo entry to boot. If you are using the zpool_import support in the init program, you need to add at least the <code>zpool_import_name=zfs-root</code> param to the addappend line in lilo.conf. Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notice the <code>spl.spl_hostid=0x007f0100</code> param that works around the hostid mismatch problem while trying to import a pool; this param and hostname/ip set to use local loopback 127.0.0.1 in etc/hosts etc/HOSTNAME in initramfs will work most of the time, and if not the pool import needs to be forced. Notes on the spl and zfs packages to install: <i>If</i> you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc11_3.2.28b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.28b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console if booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 8a22a71d66f1e40dc618031f34f97ac80c355170 800 799 2012-09-19T13:28:18Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first [http://slackwiki.com/ZFS_root "ZFS root"] wiki explains the details of running ZFS as your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create a kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternative kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. Use mountpoint=legacy so that zfs will not expect <code>zfs mount</code>, but instead expect standard <code>mount</code> for mounting zfs-root: <pre> zfs set mountpoint=legacy zfs-root </pre> Edit <code>/etc/rc.d/rc.S</code> and <code>rc.6</code> to use regular <code>mount</code> commands, remove <code>zfs</code> commands. Edit <code>rc.6</code> and remove or comment out <code>zpool export</code> command. These edits undo changes made in the "ZFS root" wiki, but it shows the two different ways of mounting a zfs filesystem. You <i>might</i> think to set <code>bootfs</code> property like this: <pre> zpool set bootfs=zfs-root zfs-root </pre> However, this will result in ZFS placing many restrictions on zfs-root as per how that option is used on Solaris systems: <ol> <li> zfs-root must be VTOC (SMI) label, not GPT (EFI) label</li> <li> zfs-root can only contain 1 vdev: either a plain disk, or a mirror</li> </ol> So, do <b>NOT</b> set that property! If <code>bootfs</code> is set, you would find that you cannot add vdevs to your zfs-root. If it is set already, then unset it like this: <pre> zpool set bootfs= zfs-root </pre> Make a directory to store files to be inside the initramfs: <pre> mkdir /boot/initramfs-source </pre> This directory will hold some files for the initial rootfs inside the kernel. Your <code>/boot</code> should be on a small ext4 partition or on a mounted USB stick that you use to boot. Extract the slackware kernel-source package to obtain a copy of the kernel source, and make an initial kernel config for it: <pre> cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.28 /usr/src/linux-3.2.28b rm -r install cd /usr/src/linux-3.2.28b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support File systems -> <*> The Extended 4 (ext4) filesystem # build in any hard drive controllers and filesystems that you need for booting # then save the config make prepare scripts </pre> The kernel source has been set to have a "Local version" <code>b</code>. This will result in modules installed to <code>/lib/modules/3.2.28b</code> and keeps this kernel's source and modules seperate from slackware's kernel-generic package installation. The <code>make prepare scripts</code> command readies the kernel source as needed before we can install a copy of spl and zfs modules into the kernel source tree. Now proceed to configure and copy spl and zfs into the kernel source tree: <pre> cd ~/src tar xvzf ~/spl-0.6.0-rc11.tar.gz mkdir install cd spl-0.6.0-rc11 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.28b \ --with-linux-obj=/usr/src/linux-3.2.28b ./copy-builtin /usr/src/linux-3.2.28b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc11_3.2.28b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc11.tar.gz mkdir install cd zfs-0.6.0-rc11 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.28b \ --with-linux-obj=/usr/src/linux-3.2.28b \ --with-spl=/root/src/spl-0.6.0-rc11 --with-spl-obj=/root/src/spl-0.6.0-rc11 ./copy-builtin /usr/src/linux-3.2.28b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc11_3.2.28b-x86_64-1root.txz cd .. rm -r install </pre> At this point, the <code>copy-builtin</code> scripts have installed the configured spl and zfs modules source into the kernel source. The regular <code>make menuconfig</code> in the kernel source should now show options for spl and zfs in the kernel config. As of this writing, the copy-builtin script places the spl and zfs modules into the kernel source in places where the modules may not initialize in the best order, <i>after</i> all lower-level storage drivers are initialized. If spl and zfs initialize too soon, there is a chance they may not be able to see all of the storage devices. The order of initialization (as seen in dmesg) of modules that are builtin to the kernel is the order that the modules are linked into the kernel during kernel compilation. The order of link depends on where the module source files are located in the kernel source tree. To ensure that spl and zfs will initialize after all hardware drivers, we can move them into the <code>drivers</code> tree and after all other drivers. This move is <b>optional</b> and you can skip doing this and everything will probably work fine, but it is shown here how to move the modules to under drivers in case you prefer them there: <pre> cd /usr/src/linux-3.2.28b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.28b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.28b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.28b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.28b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.28b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF </pre> This completes the move of the spl and zfs modules in the kernel source tree to be under <code>drivers/zfsonlinux</code>. Now, in kernel configuration, you can build in the modules as follows: <pre> cd /usr/src/linux-3.2.28b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS </pre> In the kernel config, we set <code>/boot/initramfs-source</code> as source location of the contents to be linked into kernel's builtin initramfs (rootfs). Now, we create some files that are needed to be in the initramfs: <pre> cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache It is time to pause for a moment here and talk about zpool.cache: Using it is actually dangerous. We are not using udev and it's persistent block device filenames (/dev/disk/by-*), but are using the default kernel block device names (/dev/sd*) in devtmpfs. Device names for a hard drive in /dev can potentially change on boot depending on disk controller initialization order and disk drive response time. Adding another disk controller or hard disk on a controller can result in device name assignment changes to all the hard disks. A zpool.cache file holds all the zfs_member device filenames /dev/sd* for a pool configuration, but the zpool.cache configuration will be incorrect if device filenames have been changed or swapped around and this could result in a faulted pool that may or may not be recoverable. Using zpool.cache to import pools at boot, even with udev persistent device filenames, is potentially destructive if devices have been changed around. The proper thing to do is zpool_import and do not include zpool.cache in the initramfs. # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 </pre> This should be enough device nodes initially in the initramfs. Once devtmpfs mounts over /dev inside initramfs, a lot more devices are available in it by default. The initramfs needs an <code>/init</code> program that will be run automatically by the kernel as process id 1, the first program to run on the system. This program's task is to mount a root filesystem, switch it to be the new root (/), and then exec the init (<code>/sbin/init</code>) program that is on the new root so that the new root system is booted. The common way to make /init is using busybox with files like these in /boot/initrd-tree or /boot/initramfs-source: <pre> bin/busybox bin/ash -> busybox bin/sh -> busybox # run busybox to see what other "applets" can be symlinked to it # when busybox is run as a different symlinked applet name, it runs as the applet init # init can be an ash script, see slackware's /boot/initrd-tree/init for example </pre> For example, as an ash script, slackware's init does the following: <ol> <li>parse kernel parameters passed into it and set variables based on them</li> <li>start udevd and trigger rules for block devices to setup initial /dev devices</li> <li>load kernel modules and keyboard map</li> <li>run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices (any udev rules for them should do more /dev setup in the background)</li> <li>mount the root filesystem read-only at /mnt</li> <li>stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh</li> <li>shutdown udevd so it can be restarted by root system when booted</li> <li>mount --move {proc,sys,run,dev} to under /mnt</li> <li>run: exec switch_root /mnt /sbin/init $RUNLEVEL</li> </ol> The slackware mkinitrd package is a fully configured BusyBox installation that makes an external initramfs image file, initrd.gz, that is passed to the kernel by the bootloader (lilo). It could be changed to be internal to the kernel by just using initrd-tree as the CONFIG_INITRAMFS_SOURCE in the kernel config and removing initrd in the lilo.conf. The main purpose of most initramfs/initrd is to load and configure kernel modules and devices needed to mount a root filesystem. Because the spl/zfs modules are builtin, there isn't really a lot that needs to be done by an initramfs. What remains to be done is import the zfs-root pool, mount it, and exec the system /sbin/init. The kernel's "legacy" parameters <code>root=</code> and <code>rootfstype=</code> that are able to directly boot a root disk do not work with ZFS at this time because ZFS pools always need to be imported before it is possible to mount and boot on them. The automatic import that ZFS can do by using a cachefile (/etc/zfs/zpool.cache) stored in initramfs still does not work with the legacy boot parameters because at an earlier stage of the boot process, the kernel ignores a rootfs that does not contain an <code>/init</code> program, and/or the device type of an imported pool is not the device types recognized by the legacy boot as valid root devices. You could just continue to use slackware's mkinitrd package as in the "ZFS root" wiki and it works the same whether the modules are builtin or not. But, by building the spl/zfs modules in, aren't we really wanting to get rid of using the mkinitrd/initrd.gz? We'd like to have a kernel with everything in it to boot, and use a simple lilo image entry that has no initrd. We can do this, and not use the mkinitrd package, but we still need to finish our own initramfs <code>/init</code> program to import, mount, switch root, and boot. Save the following c program to "foobarz-init.c": <pre> /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * and this program compiled to /boot/initramfs-source/init * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.1" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc11/3.2.28/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { "root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { "mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { "zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { "zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } </pre> If foobarz-init is updated, you can find the latest version at [https://github.com/foobarz/foobarz-init github]. The foobarz-init program can be compiled two ways as of v1.1.1. First, the simpler compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: <pre> gcc --static init.c -o init strip init </pre> The second way to compile it adds support for zpool_import so that you do not have to include a <code>/etc/zfs/zpool.cache</code> file in the initramfs: <pre> gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/linux-3.2.28b/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init </pre> Dependencies required before you can compile this second way: <ul> <li> Install [http://sourceforge.net/projects/libtirpc/ libtirpc]. The glibc package has removed the RPC-related functions from the static libc. The libtirpc is the new replacement as a separate library. You can make your own libtirpc package and install it to resolve these RPC-related functions. Without this, the compile fails because it cannot find many "xdr" functions.</li> <li> Reinstall the [ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-current/source/a/util-linux/ util-linux] package with static libraries enabled. Edit the <code>util-linux.SlackBuild</code> and remove the line <code>--disable-static</code>, then build it and use upgradepkg to install the new package. This resolves linking static to libuuid.</li> <li><code>zfs_config.h</code> can be found in the kernel source when you have installed the builtin spl/zfs configuration; for example at <code>/usr/src/linux-3.2.28b/zfs_config.h</code>. If you currently have installed the modular spl/zfs configuration, <code>zfs_config.h</code> is found where the zfs module headers are installed; for example at <code>/usr/src/zfs-0.6.0-rc11/3.2.28/zfs_config.h</code>. Wherever it is, <code>-include</code> it as shown in the example gcc line above. zfs_config.h seems misplaced because it would seem that using libzfs shouldn't depend on modules header files.</li> <li>You may need to install the spl and zfs packages configured for --enable-linux-builtin=yes before compiling and linking to libzfs to make sure you are using the version of libzfs intended for builtin modules in case a difference between the two configurations exists. Currently, there seems to be no difference in the libzfs for either modular or builtin modules, but later there could be at least a small difference for detection of modules to load or builtin already. You may see a message that the ZFS modules stack load failed, but it can be ignored since the modules are builtin; this is just libzfs trying to load the modules even though they are builtin.</li> </ul> With these dependencies, you can probably compile static with the zpool_import support. The exact location of "zfs_config.h" may vary depending on your zfs and kernel versions, so adjust accordingly. Read the foobarz-init source code to see how it uses kernel parameters. The params <code>root</code> and <code>rootfstype</code> are always required to tell init what root pool name to mount and the filesystem type (e.g. zfs). For the zpool_import support: <code>zpool_import_name=poolname</code>, or <code>zpool_import_guid=<guid of a pool></code> tells what pool to import. You can also import the pool with a new different name by also using <code>zpool_import_newname=newpoolname</code>. If the import is not working, <code>zpool_import_force=1</code> can be used to force import even if ZFS thinks the pool may be in use by another system. However you import the pool, either using zpool.cache or zpool_import support, the kernel param <code>root=<your poolname or newpoolname></code> and <code>rootfstype=zfs</code> needs to be given also. The zpool_import only imports, it does not say what to mount. What to mount is still told using root= and rootfstype=. Now copy the compiled static program into the initramfs: <pre> cp init /boot/initramfs-source/init </pre> Build and install kernel: <pre> cd /usr/src/linux-3.2.28b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.28b cp System.map /boot/System.map-vm3.2.28b # add new lilo menu entry for vm3.2.28b kernel vi /etc/lilo.conf image = /boot/vm3.2.28b label = vm3.2.28b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Note: If <code>spl.spl_hostid=0x007f0100</code> is not included in addappend, then during boot SPL module will attempt to read /etc/hostid or run a user-space helper to write the <code>hostid</code> into <code>/proc/sys/kernel/spl/hostid</code>. Reading /etc/hostid fails unless you use foobarz-chhostid and make the file and copy it into /boot/initramfs-source/etc/hostid. The helper will fail because no <code>sh</code> shell and no <code>hostid</code> command are installed in the initramfs. The default hostid becomes 0xffffffff, which is considered an invalid hostid. Congrats! If this works, you can select the "vm3.2.28b" lilo entry to boot. If you are using the zpool_import support in the init program, you need to add at least the <code>zpool_import_name=zfs-root</code> param to the addappend line in lilo.conf. Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notice the <code>spl.spl_hostid=0x007f0100</code> param that works around the hostid mismatch problem while trying to import a pool; this param and hostname/ip set to use local loopback 127.0.0.1 in etc/hosts etc/HOSTNAME in initramfs will work most of the time, and if not the pool import needs to be forced. Notes on the spl and zfs packages to install: <i>If</i> you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc11_3.2.28b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.28b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console if booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 8b8bc64cc0f21702f52778f3f0adc6a121b60c0c 801 800 2012-09-22T09:30:40Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first [http://slackwiki.com/ZFS_root "ZFS root"] wiki explains the details of running ZFS as your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create a kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternative kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. Use mountpoint=legacy so that zfs will not expect <code>zfs mount</code>, but instead expect standard <code>mount</code> for mounting zfs-root: <pre> zfs set mountpoint=legacy zfs-root </pre> Edit <code>/etc/rc.d/rc.S</code> and <code>rc.6</code> to use regular <code>mount</code> commands, remove <code>zfs</code> commands. Edit <code>rc.6</code> and remove or comment out <code>zpool export</code> command. These edits undo changes made in the "ZFS root" wiki, but it shows the two different ways of mounting a zfs filesystem. You <i>might</i> think to set <code>bootfs</code> property like this: <pre> zpool set bootfs=zfs-root zfs-root </pre> However, this will result in ZFS placing many restrictions on zfs-root as per how that option is used on Solaris systems: <ol> <li> zfs-root must be VTOC (SMI) label, not GPT (EFI) label</li> <li> zfs-root can only contain 1 vdev: either a plain disk, or a mirror</li> </ol> So, do <b>NOT</b> set that property! If <code>bootfs</code> is set, you would find that you cannot add vdevs to your zfs-root. If it is set already, then unset it like this: <pre> zpool set bootfs= zfs-root </pre> Make a directory to store files to be inside the initramfs: <pre> mkdir /boot/initramfs-source </pre> This directory will hold some files for the initial rootfs inside the kernel. Your <code>/boot</code> should be on a small ext4 partition or on a mounted USB stick that you use to boot. Extract the slackware kernel-source package to obtain a copy of the kernel source, and make an initial kernel config for it: <pre> cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.28 /usr/src/linux-3.2.28b rm -r install cd /usr/src/linux-3.2.28b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support File systems -> <*> The Extended 4 (ext4) filesystem # build in any hard drive controllers and filesystems that you need for booting # then save the config make prepare scripts </pre> The kernel source has been set to have a "Local version" <code>b</code>. This will result in modules installed to <code>/lib/modules/3.2.28b</code> and keeps this kernel's source and modules seperate from slackware's kernel-generic package installation. The <code>make prepare scripts</code> command readies the kernel source as needed before we can install a copy of spl and zfs modules into the kernel source tree. Now proceed to configure and copy spl and zfs into the kernel source tree: <pre> cd ~/src tar xvzf ~/spl-0.6.0-rc11.tar.gz mkdir install cd spl-0.6.0-rc11 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.28b \ --with-linux-obj=/usr/src/linux-3.2.28b ./copy-builtin /usr/src/linux-3.2.28b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc11_3.2.28b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc11.tar.gz mkdir install cd zfs-0.6.0-rc11 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.28b \ --with-linux-obj=/usr/src/linux-3.2.28b \ --with-spl=/root/src/spl-0.6.0-rc11 --with-spl-obj=/root/src/spl-0.6.0-rc11 ./copy-builtin /usr/src/linux-3.2.28b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc11_3.2.28b-x86_64-1root.txz cd .. rm -r install </pre> At this point, the <code>copy-builtin</code> scripts have installed the configured spl and zfs modules source into the kernel source. The regular <code>make menuconfig</code> in the kernel source should now show options for spl and zfs in the kernel config. As of this writing, the copy-builtin script places the spl and zfs modules into the kernel source in places where the modules may not initialize in the best order, <i>after</i> all lower-level storage drivers are initialized. If spl and zfs initialize too soon, there is a chance they may not be able to see all of the storage devices. The order of initialization (as seen in dmesg) of modules that are builtin to the kernel is the order that the modules are linked into the kernel during kernel compilation. The order of link depends on where the module source files are located in the kernel source tree. To ensure that spl and zfs will initialize after all hardware drivers, we can move them into the <code>drivers</code> tree and after all other drivers. This move is <b>optional</b> and you can skip doing this and everything will probably work fine, but it is shown here how to move the modules to under drivers in case you prefer them there: <pre> cd /usr/src/linux-3.2.28b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.28b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.28b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.28b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.28b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.28b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF </pre> This completes the move of the spl and zfs modules in the kernel source tree to be under <code>drivers/zfsonlinux</code>. Now, in kernel configuration, you can build in the modules as follows: <pre> cd /usr/src/linux-3.2.28b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS </pre> In the kernel config, we set <code>/boot/initramfs-source</code> as source location of the contents to be linked into kernel's builtin initramfs (rootfs). Now, we create some files that are needed to be in the initramfs: <pre> cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache It is time to pause for a moment here and talk about zpool.cache: Using it is actually dangerous. We are not using udev and it's persistent block device filenames (/dev/disk/by-*), but are using the default kernel block device names (/dev/sd*) in devtmpfs. Device names for a hard drive in /dev can potentially change on boot depending on disk controller initialization order and disk drive response time. Adding another disk controller or hard disk on a controller can result in device name assignment changes to all the hard disks. A zpool.cache file holds all the zfs_member device filenames /dev/sd* for a pool configuration, but the zpool.cache configuration will be incorrect if device filenames have been changed or swapped around and this could result in a faulted pool that may or may not be recoverable. Using zpool.cache to import pools at boot, even with udev persistent device filenames, is potentially destructive if devices have been changed around. The proper thing to do is zpool_import and do not include zpool.cache in the initramfs. # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 </pre> This should be enough device nodes initially in the initramfs. Once devtmpfs mounts over /dev inside initramfs, a lot more devices are available in it by default. The initramfs needs an <code>/init</code> program that will be run automatically by the kernel as process id 1, the first program to run on the system. This program's task is to mount a root filesystem, switch it to be the new root (/), and then exec the init (<code>/sbin/init</code>) program that is on the new root so that the new root system is booted. The common way to make /init is using busybox with files like these in /boot/initrd-tree or /boot/initramfs-source: <pre> bin/busybox bin/ash -> busybox bin/sh -> busybox # run busybox to see what other "applets" can be symlinked to it # when busybox is run as a different symlinked applet name, it runs as the applet init # init can be an ash script, see slackware's /boot/initrd-tree/init for example </pre> For example, as an ash script, slackware's init does the following: <ol> <li>parse kernel parameters passed into it and set variables based on them</li> <li>start udevd and trigger rules for block devices to setup initial /dev devices</li> <li>load kernel modules and keyboard map</li> <li>run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices (any udev rules for them should do more /dev setup in the background)</li> <li>mount the root filesystem read-only at /mnt</li> <li>stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh</li> <li>shutdown udevd so it can be restarted by root system when booted</li> <li>mount --move {proc,sys,run,dev} to under /mnt</li> <li>run: exec switch_root /mnt /sbin/init $RUNLEVEL</li> </ol> The slackware mkinitrd package is a fully configured BusyBox installation that makes an external initramfs image file, initrd.gz, that is passed to the kernel by the bootloader (lilo). It could be changed to be internal to the kernel by just using initrd-tree as the CONFIG_INITRAMFS_SOURCE in the kernel config and removing initrd in the lilo.conf. The main purpose of most initramfs/initrd is to load and configure kernel modules and devices needed to mount a root filesystem. Because the spl/zfs modules are builtin, there isn't really a lot that needs to be done by an initramfs. What remains to be done is import the zfs-root pool, mount it, and exec the system /sbin/init. The kernel's "legacy" parameters <code>root=</code> and <code>rootfstype=</code> that are able to directly boot a root disk do not work with ZFS at this time because ZFS pools always need to be imported before it is possible to mount and boot on them. The automatic import that ZFS can do by using a cachefile (/etc/zfs/zpool.cache) stored in initramfs still does not work with the legacy boot parameters because at an earlier stage of the boot process, the kernel ignores a rootfs that does not contain an <code>/init</code> program, and/or the device type of an imported pool is not the device types recognized by the legacy boot as valid root devices. You could just continue to use slackware's mkinitrd package as in the "ZFS root" wiki and it works the same whether the modules are builtin or not. But, by building the spl/zfs modules in, aren't we really wanting to get rid of using the mkinitrd/initrd.gz? We'd like to have a kernel with everything in it to boot, and use a simple lilo image entry that has no initrd. We can do this, and not use the mkinitrd package, but we still need to finish our own initramfs <code>/init</code> program to import, mount, switch root, and boot. Save the following c program to "foobarz-init.c": <pre> /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * Copy this compiled program to /boot/initramfs-source/init * If not named /init, then use rdinit=/othername kernel parameter. * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.2" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.28/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { " root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { " rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { " mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { " zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } /* set defaults for params not given on cmdline */ for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); if( libzfs != NULL ) { printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } else { printk("zpool_import: unable to initialize libzfs.\n"); } } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } </pre> If foobarz-init is updated, you can find the latest version at [https://github.com/foobarz/foobarz-init github]. The foobarz-init program can be compiled two ways as of v1.1.1. First, the simpler compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: <pre> gcc --static init.c -o init strip init </pre> The second way to compile it adds support for zpool_import so that you do not have to include a <code>/etc/zfs/zpool.cache</code> file in the initramfs: <pre> gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/linux-3.2.28b/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init </pre> Dependencies required before you can compile this second way: <ul> <li> Install [http://sourceforge.net/projects/libtirpc/ libtirpc]. The glibc package has removed the RPC-related functions from the static libc. The libtirpc is the new replacement as a separate library. You can make your own libtirpc package and install it to resolve these RPC-related functions. Without this, the compile fails because it cannot find many "xdr" functions.</li> <li> Reinstall the [ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-current/source/a/util-linux/ util-linux] package with static libraries enabled. Edit the <code>util-linux.SlackBuild</code> and remove the line <code>--disable-static</code>, then build it and use upgradepkg to install the new package. This resolves linking static to libuuid.</li> <li><code>zfs_config.h</code> can be found in the kernel source when you have installed the builtin spl/zfs configuration; for example at <code>/usr/src/linux-3.2.28b/zfs_config.h</code>. If you currently have installed the modular spl/zfs configuration, <code>zfs_config.h</code> is found where the zfs module headers are installed; for example at <code>/usr/src/zfs-0.6.0-rc11/3.2.28/zfs_config.h</code>. Wherever it is, <code>-include</code> it as shown in the example gcc line above. zfs_config.h seems misplaced because it would seem that using libzfs shouldn't depend on modules header files.</li> <li>You may need to install the spl and zfs packages configured for --enable-linux-builtin=yes before compiling and linking to libzfs to make sure you are using the version of libzfs intended for builtin modules in case a difference between the two configurations exists. Currently, there seems to be no difference in the libzfs for either modular or builtin modules, but later there could be at least a small difference for detection of modules to load or builtin already. You may see a message that the ZFS modules stack load failed, but it can be ignored since the modules are builtin; this is just libzfs trying to load the modules even though they are builtin.</li> </ul> With these dependencies, you can probably compile static with the zpool_import support. The exact location of "zfs_config.h" may vary depending on your zfs and kernel versions, so adjust accordingly. Read the foobarz-init source code to see how it uses kernel parameters. The params <code>root</code> and <code>rootfstype</code> are always required to tell init what root pool name to mount and the filesystem type (e.g. zfs). For the zpool_import support: <code>zpool_import_name=poolname</code>, or <code>zpool_import_guid=<guid of a pool></code> tells what pool to import. You can also import the pool with a new different name by also using <code>zpool_import_newname=newpoolname</code>. If the import is not working, <code>zpool_import_force=1</code> can be used to force import even if ZFS thinks the pool may be in use by another system. However you import the pool, either using zpool.cache or zpool_import support, the kernel param <code>root=<your poolname or newpoolname></code> and <code>rootfstype=zfs</code> needs to be given also. The zpool_import only imports, it does not say what to mount. What to mount is still told using root= and rootfstype=. Now copy the compiled static program into the initramfs: <pre> cp init /boot/initramfs-source/init </pre> Build and install kernel: <pre> cd /usr/src/linux-3.2.28b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.28b cp System.map /boot/System.map-vm3.2.28b # add new lilo menu entry for vm3.2.28b kernel vi /etc/lilo.conf image = /boot/vm3.2.28b label = vm3.2.28b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Note: If <code>spl.spl_hostid=0x007f0100</code> is not included in addappend, then during boot SPL module will attempt to read /etc/hostid or run a user-space helper to write the <code>hostid</code> into <code>/proc/sys/kernel/spl/hostid</code>. Reading /etc/hostid fails unless you use foobarz-chhostid and make the file and copy it into /boot/initramfs-source/etc/hostid. The helper will fail because no <code>sh</code> shell and no <code>hostid</code> command are installed in the initramfs. The default hostid becomes 0xffffffff, which is considered an invalid hostid. Congrats! If this works, you can select the "vm3.2.28b" lilo entry to boot. If you are using the zpool_import support in the init program, you need to add at least the <code>zpool_import_name=zfs-root</code> param to the addappend line in lilo.conf. Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notice the <code>spl.spl_hostid=0x007f0100</code> param that works around the hostid mismatch problem while trying to import a pool; this param and hostname/ip set to use local loopback 127.0.0.1 in etc/hosts etc/HOSTNAME in initramfs will work most of the time, and if not the pool import needs to be forced. Notes on the spl and zfs packages to install: <i>If</i> you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc11_3.2.28b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.28b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console if booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 0f6ed16f04a4bfe2223c1622e7fdb328dc7ae7ad 804 801 2012-09-24T20:08:44Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first [http://slackwiki.com/ZFS_root "ZFS root"] wiki explains the details of running ZFS as your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create a kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternative kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. Use mountpoint=legacy so that zfs will not expect <code>zfs mount</code>, but instead expect standard <code>mount</code> for mounting zfs-root: <pre> zfs set mountpoint=legacy zfs-root </pre> Edit <code>/etc/rc.d/rc.S</code> and <code>rc.6</code> to use regular <code>mount</code> commands, remove <code>zfs</code> commands. Edit <code>rc.6</code> and remove or comment out <code>zpool export</code> command. These edits undo changes made in the "ZFS root" wiki, but it shows the two different ways of mounting a zfs filesystem. You <i>might</i> think to set <code>bootfs</code> property like this: <pre> zpool set bootfs=zfs-root zfs-root </pre> However, this will result in ZFS placing many restrictions on zfs-root as per how that option is used on Solaris systems: <ol> <li> zfs-root must be VTOC (SMI) label, not GPT (EFI) label</li> <li> zfs-root can only contain 1 vdev: either a plain disk, or a mirror</li> </ol> So, do <b>NOT</b> set that property! If <code>bootfs</code> is set, you would find that you cannot add vdevs to your zfs-root. If it is set already, then unset it like this: <pre> zpool set bootfs= zfs-root </pre> Make a directory to store files to be inside the initramfs: <pre> mkdir /boot/initramfs-source </pre> This directory will hold some files for the initial rootfs inside the kernel. Your <code>/boot</code> should be on a small ext4 partition or on a mounted USB stick that you use to boot. Extract the slackware kernel-source package to obtain a copy of the kernel source, and make an initial kernel config for it: <pre> cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.29 /usr/src/linux-3.2.29b rm -r install cd /usr/src/linux-3.2.29b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support File systems -> <*> The Extended 4 (ext4) filesystem # build in any hard drive controllers and filesystems that you need for booting # then save the config make prepare scripts </pre> The kernel source has been set to have a "Local version" <code>b</code>. This will result in modules installed to <code>/lib/modules/3.2.29b</code> and keeps this kernel's source and modules seperate from slackware's kernel-generic package installation. The <code>make prepare scripts</code> command readies the kernel source as needed before we can install a copy of spl and zfs modules into the kernel source tree. Now proceed to configure and copy spl and zfs into the kernel source tree: <pre> cd ~/src tar xvzf ~/spl-0.6.0-rc11.tar.gz mkdir install cd spl-0.6.0-rc11 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.29b \ --with-linux-obj=/usr/src/linux-3.2.29b ./copy-builtin /usr/src/linux-3.2.29b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc11_3.2.29b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc11.tar.gz mkdir install cd zfs-0.6.0-rc11 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.29b \ --with-linux-obj=/usr/src/linux-3.2.29b \ --with-spl=/root/src/spl-0.6.0-rc11 --with-spl-obj=/root/src/spl-0.6.0-rc11 ./copy-builtin /usr/src/linux-3.2.29b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc11_3.2.29b-x86_64-1root.txz cd .. rm -r install </pre> At this point, the <code>copy-builtin</code> scripts have installed the configured spl and zfs modules source into the kernel source. The regular <code>make menuconfig</code> in the kernel source should now show options for spl and zfs in the kernel config. As of this writing, the copy-builtin script places the spl and zfs modules into the kernel source in places where the modules may not initialize in the best order, <i>after</i> all lower-level storage drivers are initialized. If spl and zfs initialize too soon, there is a chance they may not be able to see all of the storage devices. The order of initialization (as seen in dmesg) of modules that are builtin to the kernel is the order that the modules are linked into the kernel during kernel compilation. The order of link depends on where the module source files are located in the kernel source tree. To ensure that spl and zfs will initialize after all hardware drivers, we can move them into the <code>drivers</code> tree and after all other drivers. This move is <b>optional</b> and you can skip doing this and everything will probably work fine, but it is shown here how to move the modules to under drivers in case you prefer them there: <pre> cd /usr/src/linux-3.2.29b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.29b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.29b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.29b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.29b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.29b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF </pre> This completes the move of the spl and zfs modules in the kernel source tree to be under <code>drivers/zfsonlinux</code>. Now, in kernel configuration, you can build in the modules as follows: <pre> cd /usr/src/linux-3.2.29b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS </pre> In the kernel config, we set <code>/boot/initramfs-source</code> as source location of the contents to be linked into kernel's builtin initramfs (rootfs). Now, we create some files that are needed to be in the initramfs: <pre> cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache </pre> It is time to pause for a moment here and talk about zpool.cache: Using it is actually dangerous. We are not using udev and it's persistent block device filenames (/dev/disk/by-*), but are using the default kernel block device names (/dev/sd*) in devtmpfs. Device names for a hard drive in /dev can potentially change on boot depending on disk controller initialization order and disk drive response time. Adding another disk controller or hard disk on a controller can result in device name assignment changes to all the hard disks. A zpool.cache file holds all the zfs_member device filenames /dev/sd* for a pool configuration, but the zpool.cache configuration will be incorrect if device filenames have been changed or swapped around and this could result in a faulted pool that may or may not be recoverable. Using zpool.cache to import pools at boot, even with udev persistent device filenames, is potentially destructive if devices have been changed around. The proper thing to do is zpool_import and do not include zpool.cache in the initramfs. Now, let's continue making some files in the initramfs-source: <pre> # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 </pre> This should be enough device nodes initially in the initramfs. Once devtmpfs mounts over /dev inside initramfs, a lot more devices are available in it by default. The initramfs needs an <code>/init</code> program that will be run automatically by the kernel as process id 1, the first program to run on the system. This program's task is to mount a root filesystem, switch it to be the new root (/), and then exec the init (<code>/sbin/init</code>) program that is on the new root so that the new root system is booted. The common way to make /init is using busybox with files like these in /boot/initrd-tree or /boot/initramfs-source: <pre> bin/busybox bin/ash -> busybox bin/sh -> busybox # run busybox to see what other "applets" can be symlinked to it # when busybox is run as a different symlinked applet name, it runs as the applet init # init can be an ash script, see slackware's /boot/initrd-tree/init for example </pre> For example, as an ash script, slackware's init does the following: <ol> <li>parse kernel parameters passed into it and set variables based on them</li> <li>start udevd and trigger rules for block devices to setup initial /dev devices</li> <li>load kernel modules and keyboard map</li> <li>run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices (any udev rules for them should do more /dev setup in the background)</li> <li>mount the root filesystem read-only at /mnt</li> <li>stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh</li> <li>shutdown udevd so it can be restarted by root system when booted</li> <li>mount --move {proc,sys,run,dev} to under /mnt</li> <li>run: exec switch_root /mnt /sbin/init $RUNLEVEL</li> </ol> The slackware mkinitrd package is a fully configured BusyBox installation that makes an external initramfs image file, initrd.gz, that is passed to the kernel by the bootloader (lilo). It could be changed to be internal to the kernel by just using initrd-tree as the CONFIG_INITRAMFS_SOURCE in the kernel config and removing initrd in the lilo.conf. The main purpose of most initramfs/initrd is to load and configure kernel modules and devices needed to mount a root filesystem. Because the spl/zfs modules are builtin, there isn't really a lot that needs to be done by an initramfs. What remains to be done is import the zfs-root pool, mount it, and exec the system /sbin/init. The kernel's "legacy" parameters <code>root=</code> and <code>rootfstype=</code> that are able to directly boot a root disk do not work with ZFS at this time because ZFS pools always need to be imported before it is possible to mount and boot on them. The automatic import that ZFS can do by using a cachefile (/etc/zfs/zpool.cache) stored in initramfs still does not work with the legacy boot parameters because at an earlier stage of the boot process, the kernel ignores a rootfs that does not contain an <code>/init</code> program, and/or the device type of an imported pool is not the device types recognized by the legacy boot as valid root devices. You could just continue to use slackware's mkinitrd package as in the "ZFS root" wiki and it works the same whether the modules are builtin or not. But, by building the spl/zfs modules in, aren't we really wanting to get rid of using the mkinitrd/initrd.gz? We'd like to have a kernel with everything in it to boot, and use a simple lilo image entry that has no initrd. We can do this, and not use the mkinitrd package, but we still need to finish our own initramfs <code>/init</code> program to import, mount, switch root, and boot. Save the following c program to "foobarz-init.c": <pre> /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * Copy this compiled program to /boot/initramfs-source/init * If not named /init, then use rdinit=/othername kernel parameter. * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.2" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.29/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { " root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { " rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { " mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { " zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } /* set defaults for params not given on cmdline */ for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); if( libzfs != NULL ) { printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } else { printk("zpool_import: unable to initialize libzfs.\n"); } } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } </pre> If foobarz-init is updated, you can find the latest version at [https://github.com/foobarz/foobarz-init github]. The foobarz-init program can be compiled two ways as of v1.1.1. First, the simpler compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: <pre> gcc --static init.c -o init strip init </pre> The second way to compile it adds support for zpool_import so that you do not have to include a <code>/etc/zfs/zpool.cache</code> file in the initramfs: <pre> gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/linux-3.2.29b/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init </pre> Dependencies required before you can compile this second way: <ul> <li> Install [http://sourceforge.net/projects/libtirpc/ libtirpc]. The glibc package has removed the RPC-related functions from the static libc. The libtirpc is the new replacement as a separate library. You can make your own libtirpc package and install it to resolve these RPC-related functions. Without this, the compile fails because it cannot find many "xdr" functions.</li> <li> Reinstall the [ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-current/source/a/util-linux/ util-linux] package with static libraries enabled. Edit the <code>util-linux.SlackBuild</code> and remove the line <code>--disable-static</code>, then build it and use upgradepkg to install the new package. This resolves linking static to libuuid.</li> <li><code>zfs_config.h</code> can be found in the kernel source when you have installed the builtin spl/zfs configuration; for example at <code>/usr/src/linux-3.2.29b/zfs_config.h</code>. If you currently have installed the modular spl/zfs configuration, <code>zfs_config.h</code> is found where the zfs module headers are installed; for example at <code>/usr/src/zfs-0.6.0-rc11/3.2.29/zfs_config.h</code>. Wherever it is, <code>-include</code> it as shown in the example gcc line above. zfs_config.h seems misplaced because it would seem that using libzfs shouldn't depend on modules header files.</li> <li>You may need to install the spl and zfs packages configured for --enable-linux-builtin=yes before compiling and linking to libzfs to make sure you are using the version of libzfs intended for builtin modules in case a difference between the two configurations exists. Currently, there seems to be no difference in the libzfs for either modular or builtin modules, but later there could be at least a small difference for detection of modules to load or builtin already. You may see a message that the ZFS modules stack load failed, but it can be ignored since the modules are builtin; this is just libzfs trying to load the modules even though they are builtin.</li> </ul> With these dependencies, you can probably compile static with the zpool_import support. The exact location of "zfs_config.h" may vary depending on your zfs and kernel versions, so adjust accordingly. Read the foobarz-init source code to see how it uses kernel parameters. The params <code>root</code> and <code>rootfstype</code> are always required to tell init what root pool name to mount and the filesystem type (e.g. zfs). For the zpool_import support: <code>zpool_import_name=poolname</code>, or <code>zpool_import_guid=<guid of a pool></code> tells what pool to import. You can also import the pool with a new different name by also using <code>zpool_import_newname=newpoolname</code>. If the import is not working, <code>zpool_import_force=1</code> can be used to force import even if ZFS thinks the pool may be in use by another system. However you import the pool, either using zpool.cache or zpool_import support, the kernel param <code>root=<your poolname or newpoolname></code> and <code>rootfstype=zfs</code> needs to be given also. The zpool_import only imports, it does not say what to mount. What to mount is still told using root= and rootfstype=. Now copy the compiled static program into the initramfs: <pre> cp init /boot/initramfs-source/init </pre> Build and install kernel: <pre> cd /usr/src/linux-3.2.29b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.29b cp System.map /boot/System.map-vm3.2.29b # add new lilo menu entry for vm3.2.29b kernel vi /etc/lilo.conf image = /boot/vm3.2.29b label = vm3.2.29b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Note: If <code>spl.spl_hostid=0x007f0100</code> is not included in addappend, then during boot SPL module will attempt to read /etc/hostid or run a user-space helper to write the <code>hostid</code> into <code>/proc/sys/kernel/spl/hostid</code>. Reading /etc/hostid fails unless you use foobarz-chhostid and make the file and copy it into /boot/initramfs-source/etc/hostid. The helper will fail because no <code>sh</code> shell and no <code>hostid</code> command are installed in the initramfs. The default hostid becomes 0xffffffff, which is considered an invalid hostid. Congrats! If this works, you can select the "vm3.2.29b" lilo entry to boot. If you are using the zpool_import support in the init program, you need to add at least the <code>zpool_import_name=zfs-root</code> param to the addappend line in lilo.conf. Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notice the <code>spl.spl_hostid=0x007f0100</code> param that works around the hostid mismatch problem while trying to import a pool; this param and hostname/ip set to use local loopback 127.0.0.1 in etc/hosts etc/HOSTNAME in initramfs will work most of the time, and if not the pool import needs to be forced. Notes on the spl and zfs packages to install: <i>If</i> you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc11_3.2.29b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.29b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console if booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 67bc5a2aa63fd57ce3be00a67015d0e628141caa 805 804 2012-09-25T12:12:38Z Foobarz 298 wikitext text/x-wiki [[Category:Tutorials]] The first [http://slackwiki.com/ZFS_root "ZFS root"] wiki explains the details of running ZFS as your root filesystem by using a fully modular generic kernel approach. Now, I can share how it can be done with the SPL and ZFS modules built into the kernel. This procedure is just an example and can use some fine tuning, but here goes: The steps below are to create a kernel with SPL and ZFS modules builtin. This kernel will be installed as an alternative kernel to boot in lilo, and it will have a separate kernel installation from the fully modular and working system kernel. This will allow testing the builtin kernel while able to boot back onto a working modular ZFS system. We start this procedure assuming you are on a working fully modular ZFS install as in the "ZFS root" wiki. Use mountpoint=legacy so that zfs will not expect <code>zfs mount</code>, but instead expect standard <code>mount</code> for mounting zfs-root: <pre> zfs set mountpoint=legacy zfs-root </pre> Edit <code>/etc/rc.d/rc.S</code> and <code>rc.6</code> to use regular <code>mount</code> commands, remove <code>zfs</code> commands. Edit <code>rc.6</code> and remove or comment out <code>zpool export</code> command. These edits undo changes made in the "ZFS root" wiki, but it shows the two different ways of mounting a zfs filesystem. You <i>might</i> think to set <code>bootfs</code> property like this: <pre> zpool set bootfs=zfs-root zfs-root </pre> However, this will result in ZFS placing many restrictions on zfs-root as per how that option is used on Solaris systems: <ol> <li> zfs-root must be VTOC (SMI) label, not GPT (EFI) label</li> <li> zfs-root can only contain 1 vdev: either a plain disk, or a mirror</li> </ol> So, do <b>NOT</b> set that property! If <code>bootfs</code> is set, you would find that you cannot add vdevs to your zfs-root. If it is set already, then unset it like this: <pre> zpool set bootfs= zfs-root </pre> Make a directory to store files to be inside the initramfs: <pre> mkdir /boot/initramfs-source </pre> This directory will hold some files for the initial rootfs inside the kernel. Your <code>/boot</code> should be on a small ext4 partition or on a mounted USB stick that you use to boot. Extract the slackware kernel-source package to obtain a copy of the kernel source, and make an initial kernel config for it: <pre> cd ~ mkdir src cd src tar xvzf /mnt/cdrom/slackware64/k/kernel-source-*.txz mv usr/src/linux-3.2.29 /usr/src/linux-3.2.29b rm -r install cd /usr/src/linux-3.2.29b make menuconfig General setup->Local version - append to kernel release = b General setup->Default hostname = slackzfs General setup->Initramfs source files(s) = /boot/initramfs-source Device Drivers->SCSI device support->SCSI low-level drivers-> <*> SYM53C8XX Version 2 SCSI support File systems -> <*> The Extended 4 (ext4) filesystem # build in any hard drive controllers and filesystems that you need for booting # then save the config make prepare scripts </pre> The kernel source has been set to have a "Local version" <code>b</code>. This will result in modules installed to <code>/lib/modules/3.2.29b</code> and keeps this kernel's source and modules seperate from slackware's kernel-generic package installation. The <code>make prepare scripts</code> command readies the kernel source as needed before we can install a copy of spl and zfs modules into the kernel source tree. Now proceed to configure and copy spl and zfs into the kernel source tree: <pre> cd ~/src tar xvzf ~/spl-0.6.0-rc11.tar.gz mkdir install cd spl-0.6.0-rc11 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.29b \ --with-linux-obj=/usr/src/linux-3.2.29b ./copy-builtin /usr/src/linux-3.2.29b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../spl-0.6.0rc11_3.2.29b-x86_64-1root.txz cd .. rm -r install tar xvzf ~/zfs-0.6.0-rc11.tar.gz mkdir install cd zfs-0.6.0-rc11 ./configure \ --prefix=/ \ --libdir=/lib64 \ --includedir=/usr/include \ --datarootdir=/usr/share \ --enable-linux-builtin=yes \ --with-linux=/usr/src/linux-3.2.29b \ --with-linux-obj=/usr/src/linux-3.2.29b \ --with-spl=/root/src/spl-0.6.0-rc11 --with-spl-obj=/root/src/spl-0.6.0-rc11 ./copy-builtin /usr/src/linux-3.2.29b make make install DESTDIR=~/src/install cd ~/src/install makepkg ../zfs-0.6.0rc11_3.2.29b-x86_64-1root.txz cd .. rm -r install </pre> At this point, the <code>copy-builtin</code> scripts have installed the configured spl and zfs modules source into the kernel source. The regular <code>make menuconfig</code> in the kernel source should now show options for spl and zfs in the kernel config. As of this writing, the copy-builtin script places the spl and zfs modules into the kernel source in places where the modules may not initialize in the best order, <i>after</i> all lower-level storage drivers are initialized. If spl and zfs initialize too soon, there is a chance they may not be able to see all of the storage devices. The order of initialization (as seen in dmesg) of modules that are builtin to the kernel is the order that the modules are linked into the kernel during kernel compilation. The order of link depends on where the module source files are located in the kernel source tree. To ensure that spl and zfs will initialize after all hardware drivers, we can move them into the <code>drivers</code> tree and after all other drivers. This move is <b>optional</b> and you can skip doing this and everything will probably work fine, but it is shown here how to move the modules to under drivers in case you prefer them there: <pre> cd /usr/src/linux-3.2.29b mkdir drivers/zfsonlinux mv spl drivers/zfsonlinux vi Kconfig # remove references to spl vi Makefile # remove references to spl cd /usr/src/linux-3.2.29b/fs mv zfs ../drivers/zfsonlinux vi Kconfig # remove references to zfs vi Makefile # remove references to zfs cd /usr/src/linux-3.2.29b/drivers vi Kconfig )# add line at end of menu, before "endmenu": )source "drivers/zfsonlinux/Kconfig" )endmenu cd /usr/src/linux-3.2.29b/drivers vi Makefile )# add line at very end of file: )obj-$(CONFIG_ZFSONLINUX) += zfsonlinux/ cd /usr/src/linux-3.2.29b/drivers/zfsonlinux cat > Kconfig <<"EOF" menuconfig ZFSONLINUX tristate "ZFSonLinux support" if ZFSONLINUX source "drivers/zfsonlinux/spl/Kconifg" source "drivers/zfsonlinux/zfs/Kconifg" endif EOF cd /usr/src/linux-3.2.29b/zfsonlinux cat > Makefile <<"EOF" obj-$(CONFIG_SPL) += spl/ obj-$(CONFIG_ZFS) += zfs/ EOF </pre> This completes the move of the spl and zfs modules in the kernel source tree to be under <code>drivers/zfsonlinux</code>. Now, in kernel configuration, you can build in the modules as follows: <pre> cd /usr/src/linux-3.2.29b make menuconfig Device Drivers -> <*> ZFSonLinux support -> <*> Solaris Porting Layer (SPL) <*> ZFS </pre> In the kernel config, we set <code>/boot/initramfs-source</code> as source location of the contents to be linked into kernel's builtin initramfs (rootfs). Now, we create some files that are needed to be in the initramfs: <pre> cd /boot/initramfs-source # make standard directories mkdir -p proc dev sys mnt bin sbin etc/zfs # zfs seems to want mtab present, even if empty touch etc/mtab # if zpool.cache file can be read by zfs at module init, it imports the pools in the cache cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache </pre> It is time to pause for a moment here and talk about zpool.cache: Using it is actually dangerous. We are not using udev and it's persistent block device filenames (/dev/disk/by-*), but are using the default kernel block device names (/dev/sd*) in devtmpfs. Device names for a hard drive in /dev can potentially change on boot depending on disk controller initialization order and disk drive response time. Adding another disk controller or hard disk on a controller can result in device name assignment changes to all the hard disks. A zpool.cache file holds all the zfs_member device filenames /dev/sd* for a pool configuration, but the zpool.cache configuration will be incorrect if device filenames have been changed or swapped around and this could result in a faulted pool that may or may not be recoverable. Using zpool.cache to import pools at boot, even with udev persistent device filenames, is potentially destructive if devices have been changed around. The proper thing to do is zpool_import and do not include zpool.cache in the initramfs. Now, let's continue making some files in the initramfs-source: <pre> # make initial console device node; otherwise, there is a problem at startup: # "Warning: unable to open an initial console" and you'd have problems with console and tty login # making these nodes from within /init is not early enough to avoid problem mknod dev/console c 5 1 # system console # make memory device kmsg to "printk" kernel messages # we can write to this file to send out messages mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer # recommended loop0 device to mount fs images mknod dev/loop0 b 7 0 # make initial virtual terminal devices mknod dev/tty c 5 0 # current tty mknod dev/tty0 c 4 0 # current virtual term mknod dev/tty1 c 4 1 # login virtual term 1 (F1) # make alternative console=ttyS0 standard 8250/16550 UART serial port devices # useful with kernel parameter console=ttyS0 # with qemu -nographic -option-rom sgabios.bin,bootindex=0 mknod dev/ttyS0 c 4 64 # COM1 mknod dev/ttyS1 c 4 65 # COM2 mknod dev/ttyS2 c 4 66 # COM3 mknod dev/ttyS3 c 4 67 $ COM4 </pre> This should be enough device nodes initially in the initramfs. Once devtmpfs mounts over /dev inside initramfs, a lot more devices are available in it by default. The initramfs needs an <code>/init</code> program that will be run automatically by the kernel as process id 1, the first program to run on the system. This program's task is to mount a root filesystem, switch it to be the new root (/), and then exec the init (<code>/sbin/init</code>) program that is on the new root so that the new root system is booted. The common way to make /init is using busybox with files like these in /boot/initrd-tree or /boot/initramfs-source: <pre> bin/busybox bin/ash -> busybox bin/sh -> busybox # run busybox to see what other "applets" can be symlinked to it # when busybox is run as a different symlinked applet name, it runs as the applet init # init can be an ash script, see slackware's /boot/initrd-tree/init for example </pre> For example, as an ash script, slackware's init does the following: <ol> <li>parse kernel parameters passed into it and set variables based on them</li> <li>start udevd and trigger rules for block devices to setup initial /dev devices</li> <li>load kernel modules and keyboard map</li> <li>run mdadm, cryptsetup, lvm, zpool/zfs to setup more devices (any udev rules for them should do more /dev setup in the background)</li> <li>mount the root filesystem read-only at /mnt</li> <li>stat /mnt/sbin/init, and if not executable run a rescue shell /bin/sh</li> <li>shutdown udevd so it can be restarted by root system when booted</li> <li>mount --move {proc,sys,run,dev} to under /mnt</li> <li>run: exec switch_root /mnt /sbin/init $RUNLEVEL</li> </ol> The slackware mkinitrd package is a fully configured BusyBox installation that makes an external initramfs image file, initrd.gz, that is passed to the kernel by the bootloader (lilo). It could be changed to be internal to the kernel by just using initrd-tree as the CONFIG_INITRAMFS_SOURCE in the kernel config and removing initrd in the lilo.conf. The main purpose of most initramfs/initrd is to load and configure kernel modules and devices needed to mount a root filesystem. Because the spl/zfs modules are builtin, there isn't really a lot that needs to be done by an initramfs. What remains to be done is import the zfs-root pool, mount it, and exec the system /sbin/init. The kernel's "legacy" parameters <code>root=</code> and <code>rootfstype=</code> that are able to directly boot a root disk do not work with ZFS at this time because ZFS pools always need to be imported before it is possible to mount and boot on them. The automatic import that ZFS can do by using a cachefile (/etc/zfs/zpool.cache) stored in initramfs still does not work with the legacy boot parameters because at an earlier stage of the boot process, the kernel ignores a rootfs that does not contain an <code>/init</code> program, and/or the device type of an imported pool is not the device types recognized by the legacy boot as valid root devices. You could just continue to use slackware's mkinitrd package as in the "ZFS root" wiki and it works the same whether the modules are builtin or not. But, by building the spl/zfs modules in, aren't we really wanting to get rid of using the mkinitrd/initrd.gz? We'd like to have a kernel with everything in it to boot, and use a simple lilo image entry that has no initrd. We can do this, and not use the mkinitrd package, but we still need to finish our own initramfs <code>/init</code> program to import, mount, switch root, and boot. Save the following c program to "foobarz-init.c": <pre> /* software product name: foobarz-init.c * suggested binary name: /init (in initramfs-source, rootfs) * license : BSD * license text: Copyright (c) 2012, foobarz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Your initramfs-source should contain the following * * cd /boot/initramfs-source * mkdir -p proc dev sys mnt bin sbin etc/zfs * touch etc/mtab * cp /etc/zfs/zpool.cache-initrd etc/zfs/zpool.cache * # zpool.cache is optional - zpool_import_ kernel params can be used instead * # see below for details on using zpool_import * mknod dev/console c 5 1 # system console * mknod dev/kmsg c 1 11 # lines printed to kmsg enter kernel messages buffer * mknod dev/loop0 b 7 0 * mknod dev/tty c 5 0 # current tty * mknod dev/tty0 c 4 0 # current virtual term * mknod dev/tty1 c 4 1 # login virtual term 1 (F1) * mknod dev/ttyS0 c 4 64 # COM1 * mknod dev/ttyS1 c 4 65 # COM2 * mknod dev/ttyS2 c 4 66 # COM3 * mknod dev/ttyS3 c 4 67 $ COM4 * * Copy this compiled program to /boot/initramfs-source/init * If not named /init, then use rdinit=/othername kernel parameter. * * Set kernel config option * CONFIG_INITRAMFS_SOURCE=/boot/initramfs-source * to build the initramfs into your kernel image * that also has builtin drivers (spl and zfs, etc). */ #define FOOBARZ_INIT_VERSION "1.1.2" #define _BSD_SOURCE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/mount.h> #include <sysexits.h> #include <errno.h> #include <string.h> /* support for zpool import * * If -DINCLUDE_ZPOOL_IMPORT, then support to import a zpool is * enabled in the program. Enabling it will add many dependencies to the * compile and link; for example: * * gcc -static -DINCLUDE_ZPOOL_IMPORT \ * foobarz-init.c -include /usr/src/zfs-0.6.0-rc10/3.2.29/zfs_config.h \ * -o init \ * -I /usr/include/libspl -I /usr/include/libzfs \ * -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ * -I /usr/include/tirpc \ * -ltirpc * * Note that libtirpc is a drop-in replacement for the SunRPC functions that * used to be in glibc. No additional includes are needed, just the gcc -I and -l * options for tirpc. * * Otherwise, with -UINCLUDE_ZPOOL_IMPORT, the compile is just: * gcc -static foobarz-init.c -o init */ #if defined(INCLUDE_ZPOOL_IMPORT) #include <libzfs.h> #else #include <sys/types.h> #include <sys/stat.h> #endif #define PARAM_REQ_NO 0 #define PARAM_REQ_YES 1 #define PARAM_SRC_DEFAULT 0 #define PARAM_SRC_CMDLINE 1 void printk(char *fmt, ...) { FILE* f; int fd; va_list args; f = fopen("/dev/kmsg", "w"); va_start(args, fmt); vfprintf(f, fmt, args); va_end(args); fflush(f); fclose(f); /* avoid flooding kmsg and having msgs suppressed; 20msgs/sec */ usleep(50000); } int main(int argc, char* argv[]) { /*** variables */ int i; int fd = 0; /* file descriptor */ unsigned long mountflags; /* kernel command line */ off_t cmdline_size; char* cmdline; /* to be malloc 4096B */ char* cmdline_end; char* temp_end; char* src_msg; /* default or cmdline */ int flag_param_missing = 0; /* use to hold contents of a misc /proc/<file> */ char* miscproc_buff; /* to be malloc 4096B */ off_t miscproc_size; /* note about environ, argv, and kernel cmdline for init: * environ is not defined for init * only argv[0] is set for init * kernel command line parameters are accessed * at /proc/cmdline */ /* kernel parameters expected to be name=value */ /* do not use quotes or spaces in parameters */ /* you can add more params somwhere after root= */ struct nv { char* n; char* v; char* v_end; int req; int src; }; struct nv param[] = { { " root=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { " rootfstype=", NULL, NULL, PARAM_REQ_YES, PARAM_SRC_DEFAULT }, { " mountopt=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " init=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " runlevel=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " console=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #if defined(INCLUDE_ZPOOL_IMPORT) , { " zpool_import_name=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " zpool_import_guid=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " zpool_import_newname=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT }, { " zpool_import_force=", NULL, NULL, PARAM_REQ_NO , PARAM_SRC_DEFAULT } #endif }; enum { iroot, irootfstype, imountopt, iinit, irunlevel, iconsole, #if defined(INCLUDE_ZPOOL_IMPORT) izpool_import_name, izpool_import_guid, izpool_import_newname, izpool_import_force, #endif ilastparam }; #if defined(INCLUDE_ZPOOL_IMPORT) libzfs_handle_t* libzfs = NULL; importargs_t iargs = { 0 }; nvlist_t* pools = NULL; nvpair_t* pool = NULL; nvlist_t* config = NULL; #endif /*** program */ printk("foobarz-init, version %s: booting initramfs.\n", FOOBARZ_INIT_VERSION); cmdline = (char*) malloc(4096); miscproc_buff = (char*) malloc(4096); if( (cmdline == NULL) || (miscproc_buff == NULL) ) { printk("Unable to allocate buffer memory: malloc: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* mount proc /proc * note: some /dev devices symlink into /proc * proc contains info about processes, including cmdline etc. */ printk("Attempting cmd: mount proc /proc\n"); if( mount("proc", "/proc", "proc", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount proc successful.\n"); } /* mount devtmpfs /dev * note: This simple init program works if your root device is made from devices * that are available by default in devtmpfs, such as /dev/sd* * * For zfs, your root zfs pool should be created with default device nodes and * then it should be mountable by this simple init program. * * udev may be needed to configure device nodes and symlinks required * to access a root device configuration made with such nodes and symlinks. * If you need udevd, you can include it into your initramfs-source and * modify this program to run it before attempting to mount your root device. * However, if udevd is needed, a significant number of userspace programs may also be * required by rules in /lib/udev/. You could install busybox + udev (about 5MB) or * coreutils + util-linux + bash + udev (about 25MB) into initramfs-source. But, at that * point you'd have ash or bash and many tools that are easier to use than this * simple init program; it would then be easy to have /init as #!/bin/<b>ash script. */ printk("Attempting cmd: mount devtmpfs /dev\n"); if( mount("devtmpfs", "/dev", "devtmpfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount devtmpfs successful.\n"); } /* mount sysfs /sys * note: some kernel modules try to access /sys with userspace helpers to echo values into /sys variables; * such modules expect a minimal userspace that contains coreutils or busybox */ printk("Attempting cmd: mount sysfs /sys\n"); if( mount("sysfs", "/sys", "sysfs", 0, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } else { printk("Mount sysfs successful.\n"); } /* process kernel command line */ fd = open("/proc/cmdline", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } /* note, on /proc fs: * lseek likely always returns error * stat likely always returns st_size = 0 * so determining size of /proc file means just reading it; * you have to read /proc files according to their documented * maximum sizes; this is probably for performance reasons */ cmdline_size = read(fd, cmdline, 4095); if( cmdline_size == -1 ) { printk("Failed to read /proc/cmdline: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); /* cmdline may be newline + null terminated, but make it null + null */ cmdline[cmdline_size] = '\0'; if( cmdline[cmdline_size-1] == '\n' ) { cmdline[cmdline_size-1] = '\0'; cmdline_size--; cmdline_end = cmdline + cmdline_size; } printk("Kernel cmdline size: %i\n", cmdline_size); printk("Kernel cmdline: \"%s\"\n", cmdline); /* find v and v_end of values in cmdline */ for( i=iroot; i<ilastparam; i++ ) { param[i].v = strstr(cmdline, param[i].n); if( param[i].v != NULL ) { param[i].src = PARAM_SRC_CMDLINE; while( *(param[i].v) != '=' ) param[i].v++; param[i].v++; temp_end = param[i].v; while( !( (*temp_end == ' ') || (*temp_end == '\n') || (temp_end == cmdline_end) ) ) temp_end++; if( temp_end == param[i].v ) { printk("Kernel parameter %s: value missing.\n", param[i].n); param[i].v = NULL; } else param[i].v_end = temp_end; } } /* set defaults for params not given on cmdline */ for( i=iroot; i<ilastparam; i++ ) { /* terminate value strings */ if( param[i].v_end != NULL ) *(param[i].v_end) = '\0'; /* set defaults if no value on cmdline */ if( param[i].v == NULL ) { param[i].src = PARAM_SRC_DEFAULT; if( param[i].req == PARAM_REQ_YES ) flag_param_missing = 1; switch(i) { case iroot : param[i].v = "<missing required param>" ; break; case irootfstype: param[i].v = "<missing required param>" ; break; case imountopt : param[i].v = "ro" ; break; case iinit : param[i].v = "/sbin/init"; break; case irunlevel : param[i].v = "3" ; break; case iconsole : param[i].v = "console" ; break; default : param[i].v = NULL; } } if(param[i].src == PARAM_SRC_DEFAULT) src_msg = "default"; else src_msg = "cmdline"; printk("Using %s \"%s\" (source: %s)\n", param[i].n, param[i].v, src_msg); } if( flag_param_missing ) { printk("Aborting boot process: missing required kernel parameter(s).\n"); return EX_USAGE; } /* generic nv pair kernel cmdline processing finished * now, examine specific params for defaults and correctness */ /* param[irootfstype]: can be checked against /proc/filesystems: */ fd = open("/proc/filesystems", O_RDONLY); if( fd == -1 ) { printk("Cannot open /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } miscproc_size = read(fd, miscproc_buff, 4095); if( miscproc_size == -1 ) { printk("Failed to read /proc/filesystems: %s\n", strerror(errno)); return EX_UNAVAILABLE; } close(fd); if( strstr(miscproc_buff, param[irootfstype].v) == NULL ) { printk("%s \"%s\": filesystem type not available.\n", param[irootfstype].n, param[irootfstype].v); return EX_UNAVAILABLE; } /* zfs-specific */ if( strcmp(param[irootfstype].v, "zfs") == 0 ) { if( access("/etc/zfs/zpool.cache", F_OK) == 0 ) printk("rootfstype=%s: /etc/zfs/zpool.cache is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/zfs/zpool.cache not present in initramfs.\n", param[irootfstype].v); if( access("/etc/hostid", F_OK) == 0 ) printk("rootfstype=%s: /etc/hostid is present in initramfs.\n", param[irootfstype].v); else printk("rootfstype=%s: /etc/hostid not present in initramfs.\n", param[irootfstype].v); #if defined(INCLUDE_ZPOOL_IMPORT) /* zpool import */ if( (param[izpool_import_name].v != NULL) || (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: import requested.\n"); if( (param[izpool_import_name].v != NULL) && (param[izpool_import_guid].v != NULL) ) { printk("zpool_import: given both pool name and guid; using guid.\n"); param[izpool_import_name].v = NULL; } if( param[izpool_import_name].v != NULL ) printk("zpool_import: pool name: %s\n", param[izpool_import_name].v ); else printk("zpool_import: pool guid: %s\n", param[izpool_import_guid].v ); iargs.path = NULL; iargs.paths = 0; iargs.poolname = param[izpool_import_name].v; if( param[izpool_import_guid].v != NULL ) iargs.guid = strtoull(param[izpool_import_guid].v, NULL, 10); else iargs.guid = 0; iargs.cachefile = NULL; if( (param[izpool_import_force].v != NULL) && (strcmp(param[izpool_import_force].v, "1") == 0) ) { iargs.can_be_active = 1; printk("zpool_import: import forced.\n"); } else { iargs.can_be_active = 0; printk("zpool_import: import not forced.\n"); } iargs.unique = 1; iargs.exists = 1; printk("zpool_import: init libzfs.\n"); libzfs = libzfs_init(); if( libzfs != NULL ) { printk("zpool_import: searching for pool.\n"); pools = zpool_search_import(libzfs, &iargs); if( (pools == NULL) || nvlist_empty(pools) ) printk("zpool_import: pool not available for import, or already imported by cachefile.\n"); else { printk("zpool_import: getting pool information.\n"); pool = nvlist_next_nvpair(pools, pool); printk("zpool_import: getting pool configuration.\n"); nvpair_value_nvlist(pool, &config); printk("zpool_import: attempting pool import.\n"); if( zpool_import(libzfs, config, param[izpool_import_newname].v, NULL) != 0 ) { printk("zpool_import: import failed.\n"); printk("zpool_import: error description: %s\n", libzfs_error_description(libzfs) ); printk("zpool_import: error action: %s\n", libzfs_error_action(libzfs) ); } else printk("zpool_import: import successful.\n"); } printk("zpool_import: fini libzfs.\n"); libzfs_fini(libzfs); } else { printk("zpool_import: unable to initialize libzfs.\n"); } } #endif /* zpool_import */ } if( strcmp(param[imountopt].v, "ro") == 0 ) mountflags = MS_RDONLY; else if( strcmp(param[imountopt].v, "rw") == 0 ) mountflags = 0; else { printk("%s \"%s\": invalid parameter value; defaulting to \"ro\".\n", param[imountopt].n, param[imountopt].v); mountflags = MS_RDONLY; } /* param[iroot]: nothing to check; if user gives bad root=device then mount fails */ /* try to mount root=device at /mnt * * note: for zfs, if a copy of /etc/zfs/zpool.cache (when pool is imported) is put in initramfs-source, then * the zfs module can read it and automatically import the pools described in the cache file; the imported * pools can be available to mount here if they were created using standard device names, otherwise * udevd may be required to run before mounting the pool */ printk("Attempting cmd: mount -t %s -o %s %s /mnt.\n", param[irootfstype].v, param[imountopt].v, param[iroot].v); if( mount(param[iroot].v, "/mnt", param[irootfstype].v, mountflags, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("%s mounted successfully.\n", param[iroot].v); /* check to see if the mounted root filesystem has an executable init program */ chdir("/mnt"); if( access(param[iinit].v+1, X_OK) != 0 ) { chdir("/"); printk("access X_OK: %s\n", strerror(errno)); printk("The init program /mnt/%s is not present or not executable.\n", param[iinit].v+1); printk("Aborting boot process: no init program.\n"); printk("Unmounting %s.\n", param[iroot].v); if( umount("/mnt") == -1 ) { printk("umount: %s\n", strerror(errno)); printk("Failed to umount %s.\n", param[iroot].v); } else printk("Successfully unmounted %s.\n", param[iroot].v); return EX_UNAVAILABLE; } chdir("/"); printk("Init program /mnt/%s is present and executable.\n", param[iinit].v+1); /* switch the root / from initramfs to the mounted new root device at /mnt. * * note: after this switch, it is not possible to access the initramfs files anymore, * yet they consume ram memory unless they are deleted here before switching. * Any programs that are run after clearing the initramfs and switching root must exist on the new root. * This program may safely delete itself (/init) since it is already in ram and executing. * If you have installed additional files and programs in initramfs that consume significant ram, * then you need to insert additional code here to delete those files (carefully). */ /* delete files off of initramfs to free ram memory */ printk("Freeing memory from initramfs...\n"); if( unlink(argv[0]) != 0 ) printk("unlink %s: %s\n", argv[0], strerror(errno)); else printk("%s %s", argv[0], "deleted from initramfs.\n"); /* switch root */ printk("Beginning switch root procedure.\n"); printk("(1) Attempting cmd: mount --move /dev /mnt/dev \n"); if( mount("/dev", "/mnt/dev", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(2) Attempting cmd: mount --move /proc /mnt/proc \n"); if( mount("/proc", "/mnt/proc", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(3) Attempting cmd: mount --move /sys /mnt/sys \n"); if( mount("/sys", "/mnt/sys", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(4) Attempting cmd: chdir /mnt \n"); if( chdir("/mnt") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(5) Attempting cmd: mount --move . / \n"); if( mount(".", "/", NULL, MS_MOVE, NULL) != 0 ) { printk("time to panic: mount: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(6) Attempting cmd: chroot . \n"); if( chroot(".") != 0 ) { printk("time to panic: chroot: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("(7) Attempting cmd: chdir / \n"); if( chdir("/") != 0 ) { printk("time to panic: chdir: %s\n", strerror(errno)); return EX_UNAVAILABLE; } printk("Completed switch root procedure.\n"); /* check for "console=" kernel parameter and switch * stdin, stdout, and stderr to named console device */ if( param[iconsole].src == PARAM_SRC_CMDLINE ) { printk("Console redirection to device %s requested.\n", param[iconsole].v); /* expect only basename of console device (e.g., ttyS0), so chdir /dev */ chdir("/dev"); if( access(param[iconsole].v, F_OK ) == 0 ) { printk("Opening stdin, stdout, and stderr on %s.\n", param[iconsole].v); close(0); open(param[iconsole].v, O_RDWR); dup2(0, 1); dup2(0, 2); } else { printk("access F_OK: %s\n", strerror(errno)); printk("Could not access device: %s!\n", param[iconsole].v); printk("Console redirection to device %s aborted!\n", param[iconsole].v); } chdir("/"); } printk("Execing: \"%s %s\" to boot mounted root system.\n", param[iinit].v, param[irunlevel].v); /* free resources held to this point */ free(cmdline); free(miscproc_buff); if( execl(param[iinit].v, param[irunlevel].v, (char *) NULL ) != 0 ) { printk("time to panic: execl: %s\n", strerror(errno)); return EX_UNAVAILABLE; } } </pre> If foobarz-init is updated, you can find the latest version at [https://github.com/foobarz/foobarz-init github]. The foobarz-init program can be compiled two ways as of v1.1.1. First, the simpler compile that does not support zpool_import but does support importing pools using a /etc/zfs/zpool.cache file in the initramfs: <pre> gcc --static init.c -o init strip init </pre> The second way to compile it adds support for zpool_import so that you do not have to include a <code>/etc/zfs/zpool.cache</code> file in the initramfs: <pre> gcc -static -DINCLUDE_ZPOOL_IMPORT \ foobarz-init.c -include /usr/src/linux-3.2.29b/zfs_config.h \ -o init \ -I /usr/include/libspl -I /usr/include/libzfs \ -lzfs -lnvpair -lzpool -luutil -luuid -lrt -lz -lm -lpthread \ -I /usr/include/tirpc \ -ltirpc strip init </pre> Dependencies required before you can compile this second way: <ul> <li> Install [http://sourceforge.net/projects/libtirpc/ libtirpc]. The glibc package has removed the RPC-related functions from the static libc. The libtirpc is the new replacement as a separate library. You can make your own libtirpc package and install it to resolve these RPC-related functions. Without this, the compile fails because it cannot find many "xdr" functions.</li> <li> Reinstall the [ftp://slackware.mirrors.tds.net/pub/slackware/slackware64-current/source/a/util-linux/ util-linux] package with static libraries enabled. Edit the <code>util-linux.SlackBuild</code> and remove the line <code>--disable-static</code>, then build it and use upgradepkg to install the new package. This resolves linking static to libuuid.</li> <li><code>zfs_config.h</code> can be found in the kernel source when you have installed the builtin spl/zfs configuration; for example at <code>/usr/src/linux-3.2.29b/zfs_config.h</code>. If you currently have installed the modular spl/zfs configuration, <code>zfs_config.h</code> is found where the zfs module headers are installed; for example at <code>/usr/src/zfs-0.6.0-rc11/3.2.29/zfs_config.h</code>. Wherever it is, <code>-include</code> it as shown in the example gcc line above. zfs_config.h seems misplaced because it would seem that using libzfs shouldn't depend on modules header files.</li> <li>You may need to install the spl and zfs packages configured for --enable-linux-builtin=yes before compiling and linking to libzfs to make sure you are using the version of libzfs intended for builtin modules in case a difference between the two configurations exists. Currently, there seems to be no difference in the libzfs for either modular or builtin modules, but later there could be at least a small difference for detection of modules to load or builtin already. You may see a message that the ZFS modules stack load failed, but it can be ignored since the modules are builtin; this is just libzfs trying to load the modules even though they are builtin.</li> </ul> With these dependencies, you can probably compile static with the zpool_import support. The exact location of "zfs_config.h" may vary depending on your zfs and kernel versions, so adjust accordingly. Read the foobarz-init source code to see how it uses kernel parameters. The params <code>root</code> and <code>rootfstype</code> are always required to tell init what root pool name to mount and the filesystem type (e.g. zfs). For the zpool_import support: <code>zpool_import_name=poolname</code>, or <code>zpool_import_guid=<guid of a pool></code> tells what pool to import. You can also import the pool with a new different name by also using <code>zpool_import_newname=newpoolname</code>. If the import is not working, <code>zpool_import_force=1</code> can be used to force import even if ZFS thinks the pool may be in use by another system. However you import the pool, either using zpool.cache or zpool_import support, the kernel param <code>root=<your poolname or newpoolname></code> and <code>rootfstype=zfs</code> needs to be given also. The zpool_import only imports, it does not say what to mount. What to mount is still told using root= and rootfstype=. Now copy the compiled static program into the initramfs: <pre> cp init /boot/initramfs-source/init </pre> Build and install kernel: <pre> cd /usr/src/linux-3.2.29b make -j8 make -j8 modules_install cp arch/x86/boot/bzImage /boot/vm3.2.29b cp System.map /boot/System.map-vm3.2.29b # add new lilo menu entry for vm3.2.29b kernel vi /etc/lilo.conf image = /boot/vm3.2.29b label = vm3.2.29b addappend = " spl.spl_hostid=0x007f0100 zfs.spa_config_path=/etc/zfs/zpool.cache root=zfs-root rootfstype=zfs" lilo reboot </pre> Note: If <code>spl.spl_hostid=0x007f0100</code> is not included in addappend, then during boot SPL module will attempt to read <code>/etc/hostid</code> or else run a user-space helper to write the <code>hostid</code> into <code>/proc/sys/kernel/spl/hostid</code>. Reading <code>/etc/hostid</code> fails unless you use [https://github.com/foobarz/foobarz-chhostid foobarz-chhostid] to make the file and copy it to <code>/boot/initramfs-source/etc/hostid</code> then run the steps above again. The helper will fail because no <code>sh</code> shell and no <code>hostid</code> command are installed in the initramfs. The default hostid becomes 0xffffffff, which is considered an invalid hostid. Congrats! If this works, you can select the "vm3.2.29b" lilo entry to boot. If you are using the zpool_import support in the init program, you need to add at least the <code>zpool_import_name=zfs-root</code> param to the addappend line in lilo.conf. Notes on kernel params (lilo append and addappend lines): root= and rootfstype= are used by both foorbarz-init and mkinitrd. The "ro" param is not used by foobarz-init, so instead use: mountopt=ro|rw. See "modinfo spl" and "modinfo zfs" to see all of the options those modules can take on the kernel command line. Notice the <code>spl.spl_hostid=0x007f0100</code> param that works around the hostid mismatch problem while trying to import a pool; this param and hostname/ip set to use local loopback 127.0.0.1 in etc/hosts etc/HOSTNAME in initramfs will work most of the time, and if not the pool import needs to be forced. Notes on the spl and zfs packages to install: <i>If</i> you have errors using zfs and zpool commands on booted system with builtin modules, then upgrade/switch to the 0.6.0rc11_3.2.29b builds, or you can make a custom package with the binaries renamed like zpoolb, zfsb etc for builtin. ---- Using qemu's -nographic serial console (/usr/share/qemu/sgabios.bin): If you have a boot problem, you might want to run in qemu's -nographic console mode: First, edit /etc/inittab, and uncomment the line for local serial ports runlevel "s1" (ttyS0) for serial console login support. This is done in the guest (host does not need this): <pre> # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 38400 linux #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 </pre> Second, edit /etc/securetty, and uncomment ttyS0 line: <pre> ttyS0 #ttyS1 # ... </pre> You cannot login on ttyS0 without this change even though you get the login prompt! Then, run qemu such as: <pre> qemu-kvm <all regular options> -nographic -option-rom sgabios.bin,bootindex=0 </pre> Wait for the lilo prompt, it may take several seconds show up in this mode. In the lilo menu, select your kernel image with builtin spl/zfs, and use kernel params such as: <pre> boot: vm3.2.29b console=ttyS0 </pre> At the lilo prompt, use kernel parameter: console=ttyS0 (do NOT say /dev/ttS0). Passing runlevel=s1 does not appear to be necessary. When you are in qemu's serial mode, the interface is a little different than in the normal graphical mode: use keypresses: <pre> ctrl-a h # for help ctrl-a c # toggle access to (QEMU) console / back to emulation </pre> If you cannot get a login: prompt, try ctrl-a c, then do (QEMU) sendkey ctrl-alt-delete. This will reboot cleanly back to lilo, then you can do (QEMU) quit. Once you login to the guest, the terminal size needs adjustment. On your host, in another xterm sized the same as your guest console terminal, get the size of the terminal: <pre> echo $LINES echo $COLUMNS </pre> Now, back in the guest terminal of same size: <pre> export LINES <lines> export COLUMNS <columns> stty cols $COLUMNS rows $LINES exec bash reset </pre> So, you set the environment variables and also set them with stty. Then, restart bash (exec, or else it is a child shell process). BECAREFUL not to start qemu twice on the same ZFS guest! Two simultaneous running qemu on the same ZFS will corrupt the pool and it will NOT recover - you lose your whole installation! Before running qemu, check ps -A, look for an already running qemu process incase it somehow entered into the background! BECAREFUL when using -nographic ttyS0 that you are not doing commands on the HOST! Only use -nographic to see kernel problems. Use regular console if booting is working normally. To use the qemu -drive if=scsi option, the linux module sym53c8xx should be loaded in the guest. You may need to use the qemu option: <pre> -option-rom 8xx_64.rom,bootindex=1 </pre> The file 8xx_64.rom used to be inside qemu, but in new versions it is missing. You can download it: <pre> wget http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus%20Adapters%20Common%20Files/lsi_bios.zip </pre> Extract the zip and place 8xx_64.rom in /usr/share/qemu/. Good luck! 7fbba332770064d8ef7e24af8063bb956ae3fbac Install Slackware Using A USB Flash Drive 0 233 806 490 2012-09-30T11:20:26Z Dont stop me 303 Updated installation source selection. The old option did not accept the iso9960 partition system. wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk Make it hybrid: isohybrid slackware-13.1-install-dvd.iso == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. The following command will overwrite all the files currently present on the USB drive so prior backups are highly advisable: dd if=slackware-13.1-install-dvd.iso of=/dev/sdX PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. Before running '''setup''', look up (with '''fdisk -l''') which device your USB drive is, and mount the device to some location: mkdir flash && mount /dev/sdX1 flash When installing, choose "Install from a Slackware CD or DVD" then select the "custom" option. Enter /dev/sdX1 (as shown by "fdisk -l") and installation will proceed. Other than that, installation process should be no different than when installing from a DVD. 452db266e52c791170aaf3dae4e2df319fa8e3fe 808 806 2012-09-30T11:45:05Z Dont stop me 303 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk Make it hybrid: isohybrid slackware-13.1-install-dvd.iso == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. The following command will overwrite all the files currently present on the USB drive so prior backups are highly advisable: dd if=slackware-13.1-install-dvd.iso of=/dev/sdX PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. Before running '''setup''', look up (with '''fdisk -l''') which device your USB drive is, and mount the device to some location: mkdir flash && mount /dev/sdX1 flash When installing, choose "Install from a Slackware CD or DVD" then select the "manual" option and after that the "custom" option. Enter /dev/sdX1 (as shown by "fdisk -l") and installation will proceed. Other than that, installation process should be no different than when installing from a DVD. 7296c22ba5c734226979e0c3d6b39bcdfa844b5c 830 808 2013-03-09T21:03:54Z Enjoying life 317 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk Make it hybrid: isohybrid slackware-13.1-install-dvd.iso == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. The following command will overwrite all the files currently present on the USB drive so prior backups are highly advisable: dd if=slackware-13.1-install-dvd.iso of=/dev/sdX PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. Before running '''setup''', look up (with '''fdisk -l''') which device your USB drive is, and mount the device to some location: mkdir flash && mount /dev/sdX1 flash When installing, choose "Install from a Slackware CD or DVD" then select the "manual" option and after that the "custom" option. Enter /dev/sdX1 (as shown by "fdisk -l") and installation will proceed. Other than that, installation process should be no different than when installing from a DVD. == Install with Unetbootin == It is possible to install with unetbootin. Download the Slackware iso image of your choice and then install to a USB drive using unetbootin. Tutorials for unetbootin are everywhere. Then, when you get to the SOURCE option in setup use the drive you are installing slackware from (usually it is /dev/sdb1). When it asks where the packages are, enter /slackware for 32 bit and /slackware64 for 64 bit. 075e538b8a13fa5362b134c6a97038d5b6c54a8d 831 830 2013-03-09T21:19:59Z Enjoying life 317 /* Install with Unetbootin */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk Make it hybrid: isohybrid slackware-13.1-install-dvd.iso == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. The following command will overwrite all the files currently present on the USB drive so prior backups are highly advisable: dd if=slackware-13.1-install-dvd.iso of=/dev/sdX PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. Before running '''setup''', look up (with '''fdisk -l''') which device your USB drive is, and mount the device to some location: mkdir flash && mount /dev/sdX1 flash When installing, choose "Install from a Slackware CD or DVD" then select the "manual" option and after that the "custom" option. Enter /dev/sdX1 (as shown by "fdisk -l") and installation will proceed. Other than that, installation process should be no different than when installing from a DVD. == Install with Unetbootin == It is possible to install with unetbootin. Download the Slackware iso image of your choice and then install to a USB drive using unetbootin. Tutorials for unetbootin are everywhere. Then, when you get to the SOURCE option in setup use the drive you are installing slackware from (usually it is /dev/sdb1). When it asks where the packages are, enter /slackware for 32 bit and /slackware64 for 64 bit. This was tested using the Slackware 14.0 64-bit x86_64 iso. bbb4dd1068a3dd5e69ec5a188725cb62a2d70bed 832 831 2013-03-09T21:25:05Z Enjoying life 317 /* Install with Unetbootin */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk Make it hybrid: isohybrid slackware-13.1-install-dvd.iso == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. The following command will overwrite all the files currently present on the USB drive so prior backups are highly advisable: dd if=slackware-13.1-install-dvd.iso of=/dev/sdX PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. Before running '''setup''', look up (with '''fdisk -l''') which device your USB drive is, and mount the device to some location: mkdir flash && mount /dev/sdX1 flash When installing, choose "Install from a Slackware CD or DVD" then select the "manual" option and after that the "custom" option. Enter /dev/sdX1 (as shown by "fdisk -l") and installation will proceed. Other than that, installation process should be no different than when installing from a DVD. == Install with Unetbootin == It is possible to install with unetbootin. Download the Slackware iso image of your choice and then install to a USB drive using unetbootin. Tutorials for unetbootin are everywhere. Then, when you get to the SOURCE option in setup use the drive you are installing slackware from (usually it is /dev/sdb1). When it asks where the packages are, enter /slackware for 32 bit or /slackware64 for 64 bit. This was tested using the Slackware 14.0 64-bit x86_64 iso. c9f9679dd77c787ef202647ab84dffcf4f67b55c Talk:Install Slackware Using A USB Flash Drive 1 292 807 753 2012-09-30T11:26:28Z Dont stop me 303 wikitext text/x-wiki Hi, I'm new to slackware. I tried installing it as given in the wiki page. But ran into trouble in the last stage. First of all, fdisk -l shows sdb - 16 gb(usb size), sdb1 (4 gb) and sdb1p1 (similar size). What is sdb1p1? Which one do I mount? I decided to mount sdb1. After mounting and running setup, I set up the targets \home, \usr etc. Then it says it has detected FAT/NTFS filesystem (the usb in all probability) and if I want to add that to fstab. I tried different things here. Since the usb is already mounted, I first tried answering no and going to install. Later I tried mounting sdb1 in flash at this step again and then running install. In both cases, when I select "install from hard disk partition" and select source partition as "/dev/sdb1" and then source path as "/slackware" or "/flash/slackware" or "slackware", it says "error mounting, should I continue". I tried using install option "pre-mounted directory" and gave "/flash/slackware" as the directory but it couldn't find the directory. What am I doing wrong? Hi, I had the same issue. You have to select "Install from a Slackware CD or DVD" then select custom. Enter the device path ex. /dev/sdb1. Installatin should proceed as normal. The reason for this is that installing from hard disks option does not support iso9660 filesystem. Hope this helps, Best wishes, Zoltan 1f36476721c558e6474d1b27699d917b82e8bfa5 Customizing Bash Prompt 0 77 809 727 2012-12-03T07:01:42Z Supyrow 196 wikitext text/x-wiki [[Category:Tips]] Originally posted by http://www.compelitepc.com There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from "\033" or "ESC" commands into text commands for better reading, modifying or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes. <pre> #.bashrc DULL=0 BRIGHT=1 FG_BLACK=30 FG_RED=31 FG_GREEN=32 FG_YELLOW=33 FG_BLUE=34 FG_VIOLET=35 FG_CYAN=36 FG_WHITE=37 FG_NULL=00 BG_BLACK=40 BG_RED=41 BG_GREEN=42 BG_YELLOW=43 BG_BLUE=44 BG_VIOLET=45 BG_CYAN=46 BG_WHITE=47 BG_NULL=00 ESC="\033" NORMAL="\[$ESC[m\]" RESET="\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]" BLACK="\[$ESC[${DULL};${FG_BLACK}m\]" RED="\[$ESC[${DULL};${FG_RED}m\]" GREEN="\[$ESC[${DULL};${FG_GREEN}m\]" YELLOW="\[$ESC[${DULL};${FG_YELLOW}m\]" BLUE="\[$ESC[${DULL};${FG_BLUE}m\]" VIOLET="\[$ESC[${DULL};${FG_VIOLET}m\]" CYAN="\[$ESC[${DULL};${FG_CYAN}m\]" WHITE="\[$ESC[${DULL};${FG_WHITE}m\]" BRIGHT_BLACK="\[$ESC[${BRIGHT};${FG_BLACK}m\]" BRIGHT_RED="\[$ESC[${BRIGHT};${FG_RED}m\]" BRIGHT_GREEN="\[$ESC[${BRIGHT};${FG_GREEN}m\]" BRIGHT_YELLOW="\[$ESC[${BRIGHT};${FG_YELLOW}m\]" BRIGHT_BLUE="\[$ESC[${BRIGHT};${FG_BLUE}m\]" BRIGHT_VIOLET="\[$ESC[${BRIGHT};${FG_VIOLET}m\]" BRIGHT_CYAN="\[$ESC[${BRIGHT};${FG_CYAN}m\]" BRIGHT_WHITE="\[$ESC[${BRIGHT};${BG_WHITE}m\]" REV_CYAN="\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]" REV_RED="\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]" PROMPT_COMMAND='export ERR=$?' </pre> If you happen to use Eterm or other advanced terminal its possible you need a ".bash_profile" here is one you can use if you don't have one. <pre> #.bash_profile source .bashrc if [ -f ~/.bashrc ]; then . ~/.bashrc fi #End Script </pre> Lets put it to work: I personally would comment out my currently working ##"PS1=" and put it below it in case you need to change it back for some reason. <pre> PS1="${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@compelitepc.com${BRIGHT_YELLOW}]\n ${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} | ${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n ${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %> ${RESET}" </pre> Should look like this minus the colors: <pre> YOUR COMPANY NAME HERE[sales@compelitepc.com] [13:57:23][590.478 MB|563.316 MiB][/media/cdrom] [503] %> </pre> Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past. Now... To get the sum of files in current working directory, I made two files which do the summing. "lsMB" and "lsMiB" which on my system are both located in ~/bin as executable. Here is lsMB: <pre> #!/bin/bash #lsMB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) suffix="kB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) suffix="MB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) suffix="GB" fi fi fi fi echo -n "$TotalSize $suffix" #End Script </pre> Finally, this is the lsMiB executable file located in "~/bin" This has the modification for the conversion to KiB, MiB & GiB one could further the code to handle TiB easily by doing some research on it... Try wiki! <pre> #!/bin/bash #lsMiB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix2="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1024*.976 \nquit" | bc) suffix2="KiB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1048576*.954 \nquit" | bc) suffix2="MiB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1073741824*.931 \nquit" | bc) suffix2="GiB" fi fi fi fi echo -n "$TotalSize2 $suffix2" #End Script </pre> One would be able to see the changes if 1) Restart the Terminal or 2) type:<pre>$ source ~/.bashrc</pre> and you will instantly see the changes. d20b8af9f15e0be3116889676dd7e3b933235c7c 810 809 2012-12-03T07:02:13Z Supyrow 196 wikitext text/x-wiki [[Category:Tips]] Originally posted by http://www.compelitepc.com Look under HOWTOs There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from "\033" or "ESC" commands into text commands for better reading, modifying or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes. <pre> #.bashrc DULL=0 BRIGHT=1 FG_BLACK=30 FG_RED=31 FG_GREEN=32 FG_YELLOW=33 FG_BLUE=34 FG_VIOLET=35 FG_CYAN=36 FG_WHITE=37 FG_NULL=00 BG_BLACK=40 BG_RED=41 BG_GREEN=42 BG_YELLOW=43 BG_BLUE=44 BG_VIOLET=45 BG_CYAN=46 BG_WHITE=47 BG_NULL=00 ESC="\033" NORMAL="\[$ESC[m\]" RESET="\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]" BLACK="\[$ESC[${DULL};${FG_BLACK}m\]" RED="\[$ESC[${DULL};${FG_RED}m\]" GREEN="\[$ESC[${DULL};${FG_GREEN}m\]" YELLOW="\[$ESC[${DULL};${FG_YELLOW}m\]" BLUE="\[$ESC[${DULL};${FG_BLUE}m\]" VIOLET="\[$ESC[${DULL};${FG_VIOLET}m\]" CYAN="\[$ESC[${DULL};${FG_CYAN}m\]" WHITE="\[$ESC[${DULL};${FG_WHITE}m\]" BRIGHT_BLACK="\[$ESC[${BRIGHT};${FG_BLACK}m\]" BRIGHT_RED="\[$ESC[${BRIGHT};${FG_RED}m\]" BRIGHT_GREEN="\[$ESC[${BRIGHT};${FG_GREEN}m\]" BRIGHT_YELLOW="\[$ESC[${BRIGHT};${FG_YELLOW}m\]" BRIGHT_BLUE="\[$ESC[${BRIGHT};${FG_BLUE}m\]" BRIGHT_VIOLET="\[$ESC[${BRIGHT};${FG_VIOLET}m\]" BRIGHT_CYAN="\[$ESC[${BRIGHT};${FG_CYAN}m\]" BRIGHT_WHITE="\[$ESC[${BRIGHT};${BG_WHITE}m\]" REV_CYAN="\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]" REV_RED="\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]" PROMPT_COMMAND='export ERR=$?' </pre> If you happen to use Eterm or other advanced terminal its possible you need a ".bash_profile" here is one you can use if you don't have one. <pre> #.bash_profile source .bashrc if [ -f ~/.bashrc ]; then . ~/.bashrc fi #End Script </pre> Lets put it to work: I personally would comment out my currently working ##"PS1=" and put it below it in case you need to change it back for some reason. <pre> PS1="${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@compelitepc.com${BRIGHT_YELLOW}]\n ${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} | ${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n ${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %> ${RESET}" </pre> Should look like this minus the colors: <pre> YOUR COMPANY NAME HERE[sales@compelitepc.com] [13:57:23][590.478 MB|563.316 MiB][/media/cdrom] [503] %> </pre> Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past. Now... To get the sum of files in current working directory, I made two files which do the summing. "lsMB" and "lsMiB" which on my system are both located in ~/bin as executable. Here is lsMB: <pre> #!/bin/bash #lsMB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1024 \nquit" | bc) suffix="kB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc) suffix="MB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize=$(echo -e "scale=3 \n$TotalBytes/1073741824 \nquit" | bc) suffix="GB" fi fi fi fi echo -n "$TotalSize $suffix" #End Script </pre> Finally, this is the lsMiB executable file located in "~/bin" This has the modification for the conversion to KiB, MiB & GiB one could further the code to handle TiB easily by doing some research on it... Try wiki! <pre> #!/bin/bash #lsMiB free for anyone who wishes to use and implement it, just please show your work. ;) let TotalBytes=0 for Bytes in $(ls -l -a | grep "^-" | awk '{ print $5 }') do let TotalBytes=$TotalBytes+$Bytes done if [ $TotalBytes -lt 1024 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes \nquit" | bc) suffix2="B" else if [ $TotalBytes -lt 1048576 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1024*.976 \nquit" | bc) suffix2="KiB" else if [ $TotalBytes -lt 1073741824 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1048576*.954 \nquit" | bc) suffix2="MiB" else if [ $TotalBytes -lt 1099511627776 ]; then TotalSize2=$(echo -e "scale=3 \n$TotalBytes/1073741824*.931 \nquit" | bc) suffix2="GiB" fi fi fi fi echo -n "$TotalSize2 $suffix2" #End Script </pre> One would be able to see the changes if 1) Restart the Terminal or 2) type:<pre>$ source ~/.bashrc</pre> and you will instantly see the changes. 1fd5e221f851d3ef500c06f733ebd654a40d89b4 User:Funnyhodge 2 302 813 2012-12-06T16:33:13Z Funnyhodge 310 Funnyhodge moved page [[User:Funnyhodge]] to [[User:Data control and optimization]] wikitext text/x-wiki #REDIRECT [[User:Data control and optimization]] cfc116e75f114452877a7f9861bf44444e48b73b Google Earth 0 96 814 118 2012-12-17T06:58:24Z Tonyguards 311 wikitext text/x-wiki [[Category:Tips]] You can download Google Earth from http://earth.google.com/ You have to set the .bin file that you download to be executatable, and then run it, to install. <pre> chmod a+x GoogleEarthLinux.bin ./GoogleEarthLinux.bin </pre> By default it installs itself in /opt/google-earth/ . It offers to make a link from /usr/local/bin/googleearth to the right executable, I recommend allowing it to do this. Once it is done, to run it you just type "googleearth" in an xterm (X must be running). You can make the appropriate desktop icon or menu item depending on what window manager you are using. If the splash screen shows up for some amount of time, and then all of X (the entire graphical environment) crashes (if you have graphical login set up, it will give you a login screen again, otherwise you will go back to the console), some people have found this to be solved by downloading the libGL.so library. It should be put in the /opt/google-earth/ directory: (as root) <pre> cd /opt/google-earth/ wget http://librarian.launchpad.net/7037027/libGL.so.1 -O libGL.so.1 </pre> Some places on the web also refer to downloading it from http://www.ground-impact.com/libGL.so.1.2 . Here are links to a few discussions of the issue: http://www.linuxquestions.org/questions/slackware-14/google-earth-crashes-x-598569/?s=3ff14bc2cdec277267c5547b7dee84d9 http://forum.mandriva.com/viewtopic.php?t=71691&highlight=googleearth '''Performance Issue with Google Earth:''' <pre> if google earth is slow in slackware Linux, check whether DRI is enabled or not, if Direct Rendering is enabled then disable "Atmosphere" effect from View menu -> [x] Atmosphere for smoother functioning of the graphics in Google Earth window. </pre> [http://littletods.com/en/content/4-perlengkapan-bayi Perlengkapan Bayi] e42469ddba16aab8f8ba64b7fc0c4d3eeda9d731 815 814 2012-12-17T07:02:19Z Tonyguards 311 wikitext text/x-wiki [[Category:Tips]] You can download Google Earth from http://earth.google.com/ You have to set the .bin file that you download to be executatable, and then run it, to install. <pre> chmod a+x GoogleEarthLinux.bin ./GoogleEarthLinux.bin </pre> By default it installs itself in /opt/google-earth/ . It offers to make a link from /usr/local/bin/googleearth to the right executable, I recommend allowing it to do this. Once it is done, to run it you just type "googleearth" in an xterm (X must be running). You can make the appropriate desktop icon or menu item depending on what window manager you are using. If the splash screen shows up for some amount of time, and then all of X (the entire graphical environment) crashes (if you have graphical login set up, it will give you a login screen again, otherwise you will go back to the console), some people have found this to be solved by downloading the libGL.so library. It should be put in the /opt/google-earth/ directory: (as root) <pre> cd /opt/google-earth/ wget http://librarian.launchpad.net/7037027/libGL.so.1 -O libGL.so.1 </pre> Some places on the web also refer to downloading it from http://www.ground-impact.com/libGL.so.1.2 . Here are links to a few discussions of the issue: http://www.linuxquestions.org/questions/slackware-14/google-earth-crashes-x-598569/?s=3ff14bc2cdec277267c5547b7dee84d9 http://forum.mandriva.com/viewtopic.php?t=71691&highlight=googleearth '''Performance Issue with Google Earth:''' <pre> if google earth is slow in slackware Linux, check whether DRI is enabled or not, if Direct Rendering is enabled then disable "Atmosphere" effect from View menu -> [x] Atmosphere for smoother functioning of the graphics in Google Earth window. </pre> * [http://littletods.com/en/content/4-perlengkapan-bayi Perlengkapan Bayi] * [http://www.doxapest.co.id/index.php/pest-control-dan-anti-rayap Anti Rayap] * [http://saranasukses.com/outsourcing-indonesia.html Outsourcing Indonesia] a77066b87b7a9b18bf269ec8c0adfdb48114043f 816 815 2012-12-17T15:20:26Z Erik 1 Reverted edits by [[Special:Contributions/Tonyguards|Tonyguards]] ([[User talk:Tonyguards|talk]]) to last revision by [[User:Erik|Erik]] wikitext text/x-wiki [[Category:Tips]] You can download Google Earth from http://earth.google.com/ You have to set the .bin file that you download to be executatable, and then run it, to install. <pre> chmod a+x GoogleEarthLinux.bin ./GoogleEarthLinux.bin </pre> By default it installs itself in /opt/google-earth/ . It offers to make a link from /usr/local/bin/googleearth to the right executable, I recommend allowing it to do this. Once it is done, to run it you just type "googleearth" in an xterm (X must be running). You can make the appropriate desktop icon or menu item depending on what window manager you are using. If the splash screen shows up for some amount of time, and then all of X (the entire graphical environment) crashes (if you have graphical login set up, it will give you a login screen again, otherwise you will go back to the console), some people have found this to be solved by downloading the libGL.so library. It should be put in the /opt/google-earth/ directory: (as root) <pre> cd /opt/google-earth/ wget http://librarian.launchpad.net/7037027/libGL.so.1 -O libGL.so.1 </pre> Some places on the web also refer to downloading it from http://www.ground-impact.com/libGL.so.1.2 . Here are links to a few discussions of the issue: http://www.linuxquestions.org/questions/slackware-14/google-earth-crashes-x-598569/?s=3ff14bc2cdec277267c5547b7dee84d9 http://forum.mandriva.com/viewtopic.php?t=71691&highlight=googleearth '''Performance Issue with Google Earth:''' <pre> if google earth is slow in slackware Linux, check whether DRI is enabled or not, if Direct Rendering is enabled then disable "Atmosphere" effect from View menu -> [x] Atmosphere for smoother functioning of the graphics in Google Earth window. </pre> b2ad930a00343e4563141b3261b42c4da4d45198 Multilib 0 228 817 396 2012-12-18T07:22:32Z RonaldCole 312 wikitext text/x-wiki There's a good tutorial (and packages) on how to set up multilib support (32-bit programs on Slackware64) at [http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:multilib AlienBOB's site]. You'd do well to go there next. ''However'', as that's not complete and clear on all points, here are some details: ==Binary display drivers== You need to reinstall binary drivers. ATI and Nvidia driver packages contain both 64bit and 32bit libraries to be maximally useful on a 64bit multilib OS. However, the slackbuild scripts available at slackbuilds.org are not up to this task, so if you already installed 64-bit binary drivers from slackbuilds.org, you should remove these and then use ATI's or Nvidia's driver installer. [[Category:Tutorials]] <nowiki>http://essaywritingservice.co/</nowiki> 941870259c0bdf1e9a7c14aea5a46377abfe2fb8 818 817 2012-12-18T13:58:01Z Erik 1 Reverted edits by [[Special:Contributions/RonaldCole|RonaldCole]] ([[User talk:RonaldCole|talk]]) to last revision by [[User:Merge-delete|Merge-delete]] wikitext text/x-wiki There's a good tutorial (and packages) on how to set up multilib support (32-bit programs on Slackware64) at [http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:multilib AlienBOB's site]. You'd do well to go there next. ''However'', as that's not complete and clear on all points, here are some details: ==Binary display drivers== You need to reinstall binary drivers. ATI and Nvidia driver packages contain both 64bit and 32bit libraries to be maximally useful on a 64bit multilib OS. However, the slackbuild scripts available at slackbuilds.org are not up to this task, so if you already installed 64-bit binary drivers from slackbuilds.org, you should remove these and then use ATI's or Nvidia's driver installer. [[Category:Tutorials]] c1907982c750d717ec701e87c90a4923a26cebc4 Resource Limits 0 31 819 48 2013-01-02T01:35:09Z Beder 313 wikitext text/x-wiki = Purpose = This page does not attempt to explain the different types of system resource limits or when it is (or is not) appropriate to change them; see '''man ulimit''' and [[http://google.com Google]] for that discussion. However, some users run into problems with the linux kernel's default limit settings, so we'll attempt to explain how to modify them to suit special needs. = Overview = The default settings provided by the kernel are sane values for most multi-user machines. Issuing the command '''ulimit -Hn''' should show the following: user@host:~$ ulimit -Hn 1024 and '''ulimit -n''' should show this: user@host:~$ ulimit -n 1024 The first command shows the hard limit set by the kernel, and the second command shows the soft limit set by the user. An unprivileged user can increase the soft limit (up to the hard limit value), and he is also able to lower the hard limit (but then is unable to increase it, as an unprivileged user cannot raise the hard limit at all). There are some situations which might require a larger hard limit for users, and the obvious "solution" is to add a line in /etc/profile to increase it. However, this will not work, because normal users cannot increase their hard limits (as indicated above). = Solution = To increase the hard limits for users, you will need to create '''/etc/initscript''' and place appropriate commands inside it. The easiest way is to copy the file '''/sbin/initscript.sample''' to '''/etc/initscript''' and edit the copy, but you are certainly free to "roll your own." Using the following '''/etc/initscript''' file: PATH=/bin:/sbin:/usr/bin:/usr/sbin export PATH # Increase the hardlimit for open files ulimit -Hn 4096 # Execute the program. eval exec "$4" You should get the following after a reboot: user@host:~$ ulimit -Hn 4096 user@host:~$ ulimit -n 1024 Notice that the hardlimit is now 4096 (as specified in /etc/initscript), but the softlimit is still 1024. In other words, you will still need to use /etc/profile (or some other shell init file - see below for recommendation) to raise the desired users' softlimits. With some creative scripting, you can be more selective about which users have what limits. Rather than editing the system /etc/profile, it's recommended to create a custom file in /etc/profile.d and make it executable. This way, you don't have to worry about trying to merge your changes to /etc/profile when doing Slackware upgrades to new versions. = Other Resources = * '''man initscript''' * '''man ulimit''' [[Category:Tutorials]] 2d43ea3b4bae0ff7f88322bb72cb7a05cb60d7a7 User talk:Beder 3 303 820 2013-01-02T02:27:45Z Rworkman 13 Thanks! wikitext text/x-wiki Thanks for the fix in Resource_Limits :-) --rworkman fb496efcf83ed92f260c9b273d4c7095d0e8ffc1 PPPoE 0 79 821 101 2013-01-30T10:05:31Z Gutrus gutrus 315 /* Connecting With PPPoE */ wikitext text/x-wiki [[Category:Tutorials]] == Setting Up PPPoE == As root, run '''pppoe-setup'''. Answer the questions. '''GOTCHA:''' on the last question, answer ''1 STAND ALONE''. == Connecting With PPPoE == As root, run '''pppoe-start'''. You should now be connected. PROBLEM: It reports connected but, I can't get to the internet. FIX: It's probably screwed up your routing table. ::route del default ::route add default dev ppp0 Your connection should be working now. To make this process automatic at bootup, add the following lines at the end of file /etc/rc.d/rc.local: ::pppoe-start ::route del default ::route add default dev ppp0 and then reboot... 25e0a7cbc22693deca6dafe7e94f286a0e7702ed Administration (General) 0 38 822 59 2013-01-30T10:17:26Z Gutrus gutrus 315 /* Hostname */ wikitext text/x-wiki == Hostname == You can change a Slackware box's <code>hostname</code> by two methods: 1) Edit <code>/etc/HOSTNAME</code> 2) Use the hostname command- :On any running Linux system you can change its hostname with the command ‘hostname‘. ::'''<code>#hostname</code>''' without any parameter it will output the current hostname of the system. ::'''<code>hostname –fd</code>''' will output the fully qualified domain name (or FQDN) of the system. ::'''<code>hostname NEW_NAME</code>''' will set the hostname of the system to NEW_NAME. This is active right away and will remain like that until the system will be rebooted (because at system boot it will set this from some particular file configurations - see bellow how to set this permanently). You will most probably need to exit the current shell in order to see the change in your shell prompt. [[Category:Tutorials]] 15f71235cf0120da5310e2fa7d0a72e772ff727c 823 822 2013-01-30T10:20:50Z Gutrus gutrus 315 /* Hostname */ wikitext text/x-wiki == Hostname == You can change a Slackware box's <code>hostname</code> by two methods: 1) Edit <code>/etc/HOSTNAME</code> 2) Use the hostname command- :On any running Linux system you can change its hostname with the command ‘hostname‘. ::'''<code>#hostname</code>''' without any parameter it will output the current hostname of the system. ::'''<code>hostname –f</code>''' will output the fully qualified domain name (or FQDN) of the system. ::'''<code>hostname NEW_NAME</code>''' will set the hostname of the system to NEW_NAME. This is active right away and will remain like that until the system will be rebooted (because at system boot it will set this from some particular file configurations - see bellow how to set this permanently). You will most probably need to exit the current shell in order to see the change in your shell prompt. [[Category:Tutorials]] ba6f2735593a2a56d569d3d8e7a183ddb5bcd52a 824 823 2013-01-30T10:21:16Z Gutrus gutrus 315 /* Hostname */ wikitext text/x-wiki == Hostname == You can change a Slackware box's <code>hostname</code> by two methods: 1) Edit <code>/etc/HOSTNAME</code> 2) Use the hostname command- :On any running Linux system you can change its hostname with the command ‘hostname‘. ::'''<code>hostname</code>''' without any parameter it will output the current hostname of the system. ::'''<code>hostname –f</code>''' will output the fully qualified domain name (or FQDN) of the system. ::'''<code>hostname NEW_NAME</code>''' will set the hostname of the system to NEW_NAME. This is active right away and will remain like that until the system will be rebooted (because at system boot it will set this from some particular file configurations - see bellow how to set this permanently). You will most probably need to exit the current shell in order to see the change in your shell prompt. [[Category:Tutorials]] dbbd7f1ec5351c8142a2b3f065e90cdb56f069dd 825 824 2013-01-30T10:23:16Z Gutrus gutrus 315 wikitext text/x-wiki == Hostname == You can change a Slackware box's <code>hostname</code> by two methods: 1) Edit <code>/etc/HOSTNAME</code> 2) Use the hostname command- :On any running Linux system you can change its hostname with the command ‘hostname‘. ::'''<code>hostname</code>''' without any parameter it will output the current hostname of the system. ::'''<code>hostname –f</code>''' will output the fully qualified domain name (or FQDN) of the system. ::'''<code>hostname NEW_NAME</code>''' will set the hostname of the system to NEW_NAME. This is active right away and will remain so until the system is rebooted (because at system boot it sets this from some particular file configuration - see bellow how to set this permanently). You will most probably need to exit the current shell in order to see the change in your shell prompt. [[Category:Tutorials]] 061d901ee9b0931b19d33ba77e47ad324912d7de User:Gutrus gutrus 2 304 826 2013-01-30T10:25:42Z Gutrus gutrus 315 Created page with "Buon giorno! LOL!" wikitext text/x-wiki Buon giorno! LOL! ad3a41aa0e6dd716a038b5cfc70874f2fd44b312 Fstab 0 94 827 474 2013-01-30T10:33:23Z Gutrus gutrus 315 /* Syntax */ wikitext text/x-wiki The /etc/fstab file tells the system how and where to mount filesystems by default. ==Syntax== The syntax of the file is this: <table cellspacing="10"> <tr> <td align="right"><b>MAN PAGE-ese:</b></td> <td align="center">FS_SPEC</td> <td align="center">FS_FILE</td> <td align="center">FS_VFSTYPE</td> <td align="center">FS_MNTOPS</td> <td align="center">FS_FREQ</td> <td align="center">FS_PASSNO</td> </tr><tr> <td align="right"><b>IN ENGLISH:</b></td> <td align="center">DEVICE</td> <td align="center">MOUNT_POINT</td> <td align="center">FILESYSTEM</td> <td align="center">OPTIONS</td> <td align="center">DUMP</td> <td align="center">FSCK_ORDER</td> </tr><tr> <td align="right"><b>EXAMPLE:</b></td> <td align="center">/dev/hdb1</td> <td align="center">/mnt/windows</td> <td align="center">vfat</td> <td align="center">defaults</td> <td align="center">0</td> <td align="center">1</td> </tr> </table> ==Field Descriptions== FS_SPEC (DEVICE) - the device or remote filesystem to be mounted. FS_FILE (MOUNT_POINT) - the mount point for the filesystem. <i>NOTE: For swap partitions, this field should be specified as `none'. If the name of the mount point contains spaces these can be escaped as `\040'.</i> FS_VFSTYPE (FILESYSTEM)- the type of the filesystem. As of Slackware 10.2, the FILE_SYSTEM choices are: :auto, adfs, affs, autofs, coda, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, nfs4, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf, ufs, umsdos, vfat, xfs, xiafs and possibly others. <i>NOTE: for swap-able and portable devices (e.g. memory sticks and CDROMs), <code>auto</code> is the best choice because it allows the computer to determine the correct filesystem.</i> FS_MNTOPS (OPTION) - the (comma seperated) mount options. See the MOUNT command's MAN PAGE for the options because there are MANY! The most commonly used options are:<br> :noauto - do not mount this device/partition automatically on boot-up. :ro - mount this device/partition READ-ONLY (e.g. CDROM). :owner - Only allow the owner to mount and un-mount this device/partition. :users - Allow any user to mount or unmount this device/partition. FS_FREQ (DUMP) - used for these filesystems by the dump command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped. For the most part, this should be "0" (zero). FS_PASSNO (FSCK_ORDER) - used by the fsck program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked. ==Benefits Of fstab Entries== Once you have a device in the fstab, mounting become VERY easy. Instead of having to: :<code>mount -t iso9660 /dev/hdb1 /mnt/cdrom</code> every time you want to use the CDROM, you can just type: :<code>mount /mnt/cdrom</code> IF you have the entry in your fstab. ==Useful Examples== CDROM:<br> :/dev/hdc1 /mnt/cdrom auto noauto,ro,owner,users 0 0 [[USB Memory Stick]]:<br> :/dev/sda1 /mnt/memstick auto noauto,owner,users 0 0<br> (make sure to <code>mkdir /mnt/memstick</code> after changing your /etc/fstab). [[External USB Drive / NTFS partition]] :/dev/sdd1 /media/1T ntfs-3g auto 0 0 (/dev/sdd1 is your external USB hard drive and /media/1T is destination folder) Note: For changing who can access the filesystem on NON-Native linux formats see [[Permissions and Umasks]] and [[Windows Partitions]] [[Category:Tutorials]] 9aba1696e5162486953abe55fc6db8eaa31676af 828 827 2013-01-30T10:37:11Z Gutrus gutrus 315 /* Useful Examples */ wikitext text/x-wiki The /etc/fstab file tells the system how and where to mount filesystems by default. ==Syntax== The syntax of the file is this: <table cellspacing="10"> <tr> <td align="right"><b>MAN PAGE-ese:</b></td> <td align="center">FS_SPEC</td> <td align="center">FS_FILE</td> <td align="center">FS_VFSTYPE</td> <td align="center">FS_MNTOPS</td> <td align="center">FS_FREQ</td> <td align="center">FS_PASSNO</td> </tr><tr> <td align="right"><b>IN ENGLISH:</b></td> <td align="center">DEVICE</td> <td align="center">MOUNT_POINT</td> <td align="center">FILESYSTEM</td> <td align="center">OPTIONS</td> <td align="center">DUMP</td> <td align="center">FSCK_ORDER</td> </tr><tr> <td align="right"><b>EXAMPLE:</b></td> <td align="center">/dev/hdb1</td> <td align="center">/mnt/windows</td> <td align="center">vfat</td> <td align="center">defaults</td> <td align="center">0</td> <td align="center">1</td> </tr> </table> ==Field Descriptions== FS_SPEC (DEVICE) - the device or remote filesystem to be mounted. FS_FILE (MOUNT_POINT) - the mount point for the filesystem. <i>NOTE: For swap partitions, this field should be specified as `none'. If the name of the mount point contains spaces these can be escaped as `\040'.</i> FS_VFSTYPE (FILESYSTEM)- the type of the filesystem. As of Slackware 10.2, the FILE_SYSTEM choices are: :auto, adfs, affs, autofs, coda, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, nfs4, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf, ufs, umsdos, vfat, xfs, xiafs and possibly others. <i>NOTE: for swap-able and portable devices (e.g. memory sticks and CDROMs), <code>auto</code> is the best choice because it allows the computer to determine the correct filesystem.</i> FS_MNTOPS (OPTION) - the (comma seperated) mount options. See the MOUNT command's MAN PAGE for the options because there are MANY! The most commonly used options are:<br> :noauto - do not mount this device/partition automatically on boot-up. :ro - mount this device/partition READ-ONLY (e.g. CDROM). :owner - Only allow the owner to mount and un-mount this device/partition. :users - Allow any user to mount or unmount this device/partition. FS_FREQ (DUMP) - used for these filesystems by the dump command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped. For the most part, this should be "0" (zero). FS_PASSNO (FSCK_ORDER) - used by the fsck program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked. ==Benefits Of fstab Entries== Once you have a device in the fstab, mounting become VERY easy. Instead of having to: :<code>mount -t iso9660 /dev/hdb1 /mnt/cdrom</code> every time you want to use the CDROM, you can just type: :<code>mount /mnt/cdrom</code> IF you have the entry in your fstab. ==Useful Examples== CDROM/DVD:<br> :/dev/sr0 /media/dvd auto noauto,ro,owner,users 0 0 [[USB Memory Stick]]:<br> :/dev/sda1 /mnt/memstick auto noauto,owner,users 0 0<br> (make sure to <code>mkdir /mnt/memstick</code> after changing your /etc/fstab). [[External USB Drive / NTFS partition]] :/dev/sdd1 /media/1T ntfs-3g auto 0 0 (/dev/sdd1 is your external USB hard drive and /media/1T is destination folder) Note: For changing who can access the filesystem on NON-Native linux formats see [[Permissions and Umasks]] and [[Windows Partitions]] [[Category:Tutorials]] 6e35d61dd81a976dc89b65dc14be829114b99510 829 828 2013-01-30T10:38:23Z Gutrus gutrus 315 /* Useful Examples */ wikitext text/x-wiki The /etc/fstab file tells the system how and where to mount filesystems by default. ==Syntax== The syntax of the file is this: <table cellspacing="10"> <tr> <td align="right"><b>MAN PAGE-ese:</b></td> <td align="center">FS_SPEC</td> <td align="center">FS_FILE</td> <td align="center">FS_VFSTYPE</td> <td align="center">FS_MNTOPS</td> <td align="center">FS_FREQ</td> <td align="center">FS_PASSNO</td> </tr><tr> <td align="right"><b>IN ENGLISH:</b></td> <td align="center">DEVICE</td> <td align="center">MOUNT_POINT</td> <td align="center">FILESYSTEM</td> <td align="center">OPTIONS</td> <td align="center">DUMP</td> <td align="center">FSCK_ORDER</td> </tr><tr> <td align="right"><b>EXAMPLE:</b></td> <td align="center">/dev/hdb1</td> <td align="center">/mnt/windows</td> <td align="center">vfat</td> <td align="center">defaults</td> <td align="center">0</td> <td align="center">1</td> </tr> </table> ==Field Descriptions== FS_SPEC (DEVICE) - the device or remote filesystem to be mounted. FS_FILE (MOUNT_POINT) - the mount point for the filesystem. <i>NOTE: For swap partitions, this field should be specified as `none'. If the name of the mount point contains spaces these can be escaped as `\040'.</i> FS_VFSTYPE (FILESYSTEM)- the type of the filesystem. As of Slackware 10.2, the FILE_SYSTEM choices are: :auto, adfs, affs, autofs, coda, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, nfs4, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf, ufs, umsdos, vfat, xfs, xiafs and possibly others. <i>NOTE: for swap-able and portable devices (e.g. memory sticks and CDROMs), <code>auto</code> is the best choice because it allows the computer to determine the correct filesystem.</i> FS_MNTOPS (OPTION) - the (comma seperated) mount options. See the MOUNT command's MAN PAGE for the options because there are MANY! The most commonly used options are:<br> :noauto - do not mount this device/partition automatically on boot-up. :ro - mount this device/partition READ-ONLY (e.g. CDROM). :owner - Only allow the owner to mount and un-mount this device/partition. :users - Allow any user to mount or unmount this device/partition. FS_FREQ (DUMP) - used for these filesystems by the dump command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped. For the most part, this should be "0" (zero). FS_PASSNO (FSCK_ORDER) - used by the fsck program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked. ==Benefits Of fstab Entries== Once you have a device in the fstab, mounting become VERY easy. Instead of having to: :<code>mount -t iso9660 /dev/hdb1 /mnt/cdrom</code> every time you want to use the CDROM, you can just type: :<code>mount /mnt/cdrom</code> IF you have the entry in your fstab. ==Useful Examples== CDROM/DVD:<br> :/dev/sr0 /media/dvd auto noauto,ro,owner,users 0 0 [[USB Memory Stick]]:<br> :/dev/sda1 /mnt/memstick auto noauto,owner,users 0 0<br> (make sure to <code>mkdir /mnt/memstick</code> after changing your /etc/fstab). [[External USB Drive / NTFS partition]] :/dev/sdd1 /media/1T ntfs-3g auto 0 0 (/dev/sdd1 is your external USB hard drive and /media/1T is destination folder) Note: For changing who can access the filesystem on NON-Native linux formats see [[Permissions and Umasks]] and [[Windows Partitions]] [[Category:Tutorials]] 148ed47ea90ed940ac89ac3cc4f3b00642d36722 PDF Printing 0 208 833 296 2013-03-15T16:23:37Z Allend 75 /* PDF Printing */ wikitext text/x-wiki [[Category:Tips]] == PDF Printing == While many applications offer exporting output to portable document format (PDF) files, many others do not. It is easy to add a virtual PDF printer to CUPS by installing the cups-pdf package that is available at http://www.slackbuilds.org This works well for single documents, but if you print multiple documents that are parsed as having the same name then the older documents will be overwritten. A solution to this is to run a script that watches for the creation of the PDF document in the spool directory (/var/spool/cups-pdf/<username> by default) and then moves the document to another directory (USERS_DIR). The script below (watch_for_spooled_pdf.sh kept in /home/xx/pdf_printing) also prepends a date and time string to keep the document names unique. A user xx should start this script as a background process i.e. /home/xx/pdf_printing/watch_for_spooled_pdf.sh & <pre> #!/bin/sh # Script to watch for creation of .pdf files by CUPS-PDF in spool directory # and move to users directory prepending the creation date and time. # # This script uses the -m option to inotifywait and should never exit. SPOOL_DIR=/var/spool/cups-pdf/xx/ USERS_DIR=/home/xx/Desktop/PDF_Files/ inotifywait -mq --timefmt '%Y%m%d %H%M%S' --format '%T %f' \ -e close_write $SPOOL_DIR \ | while read date time file; do mv $SPOOL_DIR${file} $USERS_DIR${date}${time}_${file} done </pre> What if printed PDF documents should be combined into one large PDF document? A user could move the files to be combined to a new subdirectory and then run the script (combine.sh) shown below. This script creates a single PDF document with bookmark entries to each of the individual documents using the facilities in the pdfpages and hyperref packages of LaTeX. The page order is in the order of creation date and time. <pre> #!/bin/bash # Script to combine .pdf files into a single bookmarked .pdf file # Intended to be run from within a directory containing files to be concatenated. # The directory name is accepted as a parameter # If the directory name has been passed, then make it the working directory. if [[ $1 ]]; then cd $1; fi # Filename for the .tex file that will be processed using pdflatex OUTFILE=$PWD/out2.tex # Starting values for bookmark creation BKMK_TEXT=Contents BKMK_ANCHOR=Beginning BKMK_LEVEL=0 # Variable containing ASCII code for centre dot character CENTREDOT=$(echo -e "\xB7") # Function to sanitise filenames by: # Changing space characters to underscore characters # and changing all but last period characters to centre dot (0xB7) # Necessary for \includepdf to parse filenames correctly sanitise_filenames () { for FILENAME in *.[Pp][Dd][Ff] ; do PREFIX=${FILENAME%.*} SUFFIX=${FILENAME##*.} NEWPREFIX=${PREFIX// /_} NEWPREFIX=${NEWPREFIX//./$CENTREDOT} if [ "$PREFIX" != "$NEWPREFIX" ]; then mv "$FILENAME" "$NEWPREFIX.$SUFFIX" fi done return } # Function to create a bookmark entry do_bookmark_entry () { BKMK_TEXT=${FILENAME%.*} BKMK_TEXT=${BKMK_TEXT:15} # NB. Need to substitute 'space' for 'underscore' to be valid bookmark text. BKMK_TEXT=${BKMK_TEXT//_/ } # Create a unique anchor point based on date and time prepended to filename BKMK_ANCHOR=${FILENAME:0:14} echo "\pdfbookmark["$BKMK_LEVEL"]{"$BKMK_TEXT"}{"$BKMK_ANCHOR"}" >> $OUTFILE return } # Function to add all pdf files in current directory to the output file add_pdf_files () { for FILENAME in *.[Pp][Dd][Ff] ; do do_bookmark_entry echo "\includepdf[pages=-,fitpaper]{"$PWD"/"$FILENAME"}" >> $OUTFILE done return } echo "\documentclass{article}" > $OUTFILE echo "\usepackage{pdfpages}" >> $OUTFILE echo "\usepackage[bookmarks,bookmarksopen,bookmarksopenlevel=1,pdfpagelayout={SinglePage},pdfview={Fit}]{hyperref}" >> $OUTFILE echo "\begin{document}" >> $OUTFILE echo "\pdfbookmark["$BKMK_LEVEL"]{"$BKMK_TEXT"}{"$BKMK_ANCHOR"}" >> $OUTFILE sanitise_filenames (( BKMK_LEVEL++ )) for FNAME in * ; do if [ -d $FNAME ]; then FILENAME=$FNAME do_bookmark_entry cd $FNAME (( BKMK_LEVEL++ )) sanitise_filenames add_pdf_files (( BKMK_LEVEL-- )) cd .. elif [ -f $FNAME ] && [[ ${FNAME##*.} == [Pp][Dd][Ff] ]] ; then FILENAME=$FNAME do_bookmark_entry echo "\includepdf[pages=-,fitpaper]{"$PWD"/"$FILENAME"}" >> $OUTFILE fi done echo "\end{document}" >> $OUTFILE # Now process the .tex file # Do a second run so that bookmark entries are resolved pdflatex $OUTFILE; pdflatex $OUTFILE wait # Rename the created .pdf file mv ${OUTFILE%.*}.pdf $(date +%Y%m%d%H%M%S)_All.pdf # Cleanup files left by pdflatex processing rm ${OUTFILE%.*}* # Cleanup trigger file if this script has been started from watch_for_combine_start.sh script if [ -f combine.start ]; then rm combine.start; fi # Remove this script rm $0 </pre> As a convenience, the user could also have a second background process running the script (watch_for_combine_start.sh) shown below. This script watches for the creation of a 'trigger' file (combine.start) in the directory tree and then executes the 'combine.sh' script shown above. This is useful in a network environment, so that a Windows user manipulating the files via a Samba share can create the combined PDF file without having to log in to the Slackware Linux server. <pre> #!/bin/sh # Script to watch for creation of a trigger file in a directory tree. # This event causes another script to be copied into the tree subdirectory and run. # The tree subdirectory name is passed as a parameter. # # This script should never exit WATCH_DIR=/home/xx/Desktop/PDF_Files TRIGGER_FILE=combine.start SCRIPT_FILE=/home/xx/pdf_printing/combine.sh inotifywait -mqr --timefmt '%Y%m%d %H%M%S' --format '%T %w %f' \ -e close_write $WATCH_DIR \ | while read date time path file; do if [ ${file} == $TRIGGER_FILE ]; then cp $SCRIPT_FILE ${path} sh ${path}/$(basename $SCRIPT_FILE) ${path} > /dev/null & fi done </pre> 6ffc3b41174059d3b99e668e4e3e2bf4665fe2cc Links 0 3 834 516 2013-03-27T14:14:22Z Graf 318 wikitext text/x-wiki [[Category:Information]] ==Slackware Links== * http://www.slackware.com - the home of Slackware * [http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ Slackware FAQ by] [[User:juhl|juhl]] (Jesper Juhl) * [http://www.nielshorn.net/slackware/slack_versions.php A complete overview of all Slackware versions] by Niels Horn * [http://www.slackbook.org Updated version of the slackware book] * [http://www.slackware.com/getslack Extensive listing of Slackware mirrors] * [http://www.linuxquestions.org/questions/slackware-14/ Slackware forum] on LinuxQuestions.org * [http://slackbuilds.org/ slackbuilds.org - Build scripts for additional software] * [http://sbopkg.org sbopkg.org] - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository * [http://gitorious.org/sbopkg-slackware-queues Build queues for all Slackware packages from SlackBuilds.org] * [http://slackworld.berlios.de/ The Slack World page on berlios] * [http://slacky.eu European Slackware community] * [http://slackware.linux.or.id Indonesian Slackware Community] - by [[User:Willysr|Willysr]] * [http://open-eslack.org/ Spanish Slackware community] * [http://www.slack-world.com Iranian Slackware Community] * [http://www.slackware.ru Russian Slackware Community] * [http://www.slackware.su Russian Slackware forum and articles] * http://jtgzmanager.sf.net/ A new frontend to pkgtools built with Qt4 C++ libs - by Alexandre Arnt * http://slackbot.sourceforge.net - Buildsystem and buildtools for Slackware * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. ==Free packages== * [http://connie.slackware.com/~alien/slackbuilds/ Eric Hameleers' packages] [http://slackware.org.uk/people/alien/slackbuilds/ mirror] * [http://rlworkman.net/pkgs/ rworkman's packages] [http://slackware.org.uk/people/rlworkman/ mirror] * [http://www.nielshorn.net/slackware/slack_pkg.php Niels Horn's packages] * http://www.linuxpackages.net/ * [http://repository.slacky.eu/ Slacky.eu] Italian Slackware site * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware ==SlackBuild Repositories== * [http://slackbuilds.org The SlackBuilds.org Project] * [http://www.slackware.com/~alien/slackbuilds/ Eric "Alien" Hameleer's SlackBuilds] * [http://slackware.org.uk/people/rlworkman/sources/ rworkman's SlackBuilds] ==Live CD's based on Slackware== * [http://porteus.org/ Porteus] - A fast, portable and modular live CD/USB, originally started as a community remix of Slax * [http://www.imagineos.com.br/ ImagineOS] (formerly GoblinX) * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://alien.slackbook.org/ Alien Bob's Wiki] * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://open-eslack.org/wiki/ A Spanish Slackware Wiki] * [http://www.slackware.ru/wiki/ 1 Russian Slackware Wiki] * [http://wiki.slackware.su 2 Russian Slackware Wiki] ==RSS Feeds== * http://dev.slackware.it/rss/ - RSS feeds for stable Slackware release and -current ChangeLog * http://slackbuilds.org/mirror/rss/ - ChangeLog RSS feeds for stable and current ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs 0a3b42bd606c449ebbd2d3f1162b957a877af9a4 User:AndDT 2 305 835 2013-03-30T14:46:41Z AndDT 319 Created page with "Slackware user :) First met Slackware 20120328 Schoolguy, learning in the lastest, 11th form in Technical Lyceum KPI in Kyiv * Real Name: Andrew Tkalia * IRC Nickname: AndDT ..." wikitext text/x-wiki Slackware user :) First met Slackware 20120328 Schoolguy, learning in the lastest, 11th form in Technical Lyceum KPI in Kyiv * Real Name: Andrew Tkalia * IRC Nickname: AndDT * E-Mail: anddt@anddt.us.to * My homepage: http://anddt.us.to/ * My blog: http://anddt.us.to/blog/ * My package collection: ftp://anddt.us.to:2111/packages/ 890334faba79b90ed16a2dd1c029a06fbabe967f 836 835 2013-03-30T14:47:50Z AndDT 319 wikitext text/x-wiki Slackware user :) First met Slackware 20120328. Schoolguy, learning in the lastest, 11th form in Technical Lyceum KPI in Kyiv * Real Name: Andrew Tkalia * IRC Nickname: AndDT * E-Mail: anddt@anddt.us.to * My homepage: http://anddt.us.to/ * My blog: http://anddt.us.to/blog/ * My package collection: ftp://anddt.us.to:2111/packages/ 7c127a337ab85671e9dc32fb49050417a8b59476 837 836 2013-03-30T14:50:16Z AndDT 319 wikitext text/x-wiki Slackware user :) First met Slackware 20120328. Schoolguy, learning in the lastest, 11th form in Technical Lyceum KPI in Kyiv. I have an amateur server (my notebook) at anddt.us.to with lighttpd, exim, vsftpd, php, postgresql ...etc I am systemd and Oracle hater :) * Real Name: Andrew * IRC Nickname: AndDT * E-Mail: anddt@anddt.us.to * My homepage: http://anddt.us.to/ * My blog: http://anddt.us.to/blog/ * My package collection: ftp://anddt.us.to:2111/packages/ 221fb8d56c12caba217724cd911046866bb421d2 838 837 2013-03-30T17:56:55Z AndDT 319 wikitext text/x-wiki Slackware user :) First met Slackware 20120328. Schoolguy, learning in the lastest, 11th form in Technical Lyceum KPI in Kyiv. I have an amateur server (my notebook) at anddt.us.to with lighttpd, exim, vsftpd, php, postgresql ...etc I am systemd and Oracle hater :) * Real Name: Andrew * IRC Nickname: AndDT * E-Mail: anddt@anddt.us.to * My homepage: http://anddt.us.to/ * My blog: http://anddt.us.to/blog/ * My package collection: ftp://anddt.us.to:2111/packages/ * My SlackBuilds: https://github.com/AndDT/SlackBuilds/ 3257d67c475309c2849ee4f6c8b014d5426005fd User:Alisonken1 2 242 839 499 2013-05-21T20:16:53Z Alisonken1 38 wikitext text/x-wiki * Real name: Ken Roberts * IRC Nickname: alisonken1 * IRC aliasses: alisonken1home, alisonken1lap1, alisonken1lap2, alisonken1lap3 * Slackware mirror that I maintain: http://slackware.dreamhost.com/slackware 1a94777e91bd7319b577e085a61ced347c4fceab 840 839 2013-05-21T20:17:24Z Alisonken1 38 wikitext text/x-wiki * Real name: Ken Roberts * IRC Nickname: alisonken1 * IRC aliases: alisonken1home, alisonken1lap1, alisonken1lap2, alisonken1lap3 * Slackware mirror that I maintain: http://slackware.dreamhost.com/slackware dc180f8ae3c21de5f22fbca2734cf3aa5e920ca7 The Regulars 0 4 841 619 2013-05-21T20:43:40Z Clientkill 323 Added me wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Adioe3|adioe3]] * [[User:Alisonken1|Alisonken1]] * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[User:Clientkill|Clientkill]] * [[USer:codermaniac|codermaniac]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|dchmelik]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:Erik|erik]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jcm |jcm]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[User:natex|natex]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:robert-brown|robert-brown]] * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. 0e8a8a478be01f338c81f4a15e3ea9b0f908e62a 867 841 2013-11-19T13:07:15Z Dchmelik 32 /* Others */ wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Adioe3|adioe3]] * [[User:Alisonken1|Alisonken1]] * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[User:Clientkill|Clientkill]] * [[USer:codermaniac|codermaniac]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|darwin]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:Erik|erik]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jcm |jcm]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[User:natex|natex]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:robert-brown|robert-brown]] * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. 457fb63209b1bbfe674c7942b61f7c196ab4eeaa User:Clientkill 2 306 842 2013-05-21T20:44:52Z Clientkill 323 Created page with "Hello slackers, I'm Clientkill. I'm relatively new to slack, but have been using Linux for a while now. I'm on ##slackware and ot almost always, feel free to chat!" wikitext text/x-wiki Hello slackers, I'm Clientkill. I'm relatively new to slack, but have been using Linux for a while now. I'm on ##slackware and ot almost always, feel free to chat! d9b2dfc6f342b18f2a9e6f8603bd9e52f7eed3b1 Install Slackware Using A USB Flash Drive 0 233 843 832 2013-05-24T11:19:10Z Donallen 324 /* Installation */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Using isohybrid == At this point you should have a Slackware ISO lying on your hard disk Make it hybrid: isohybrid slackware-13.1-install-dvd.iso == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. The following command will overwrite all the files currently present on the USB drive so prior backups are highly advisable: dd if=slackware-13.1-install-dvd.iso of=/dev/sdX PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. Before running '''setup''', look up (with '''fdisk -l''') which device your USB drive is. When installing, choose "Install from a Slackware CD or DVD". Then select the "manual" option, then the "custom" option. Enter /dev/sdX1 (as shown by "fdisk -l") and installation will proceed as when installing from a DVD. == Install with Unetbootin == It is possible to install with unetbootin. Download the Slackware iso image of your choice and then install to a USB drive using unetbootin. Tutorials for unetbootin are everywhere. Then, when you get to the SOURCE option in setup use the drive you are installing slackware from (usually it is /dev/sdb1). When it asks where the packages are, enter /slackware for 32 bit or /slackware64 for 64 bit. This was tested using the Slackware 14.0 64-bit x86_64 iso. 4254ea3ea2e393c0c26d93d3cae4f5055e55136c DVB 0 81 849 309 2013-09-13T02:50:43Z Domtheo 331 wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. [http://www.propertykita.com/rumah.html Rumah Dijual di Jakarta], [http://www.propertykita.com/rumah.html Rumah Dijual di Bandung], [http://www.propertykita.com/rumah.html Rumah Dijual di Bekasi] == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi] # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps Eventually, my SlackBuild will be hosted here http://slackbuilds.rlworkman.net/CONTRIB/linuxtv-dvb-apps/ (thanks to robw810). == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ 375959fb3151b8fa90b552b54c8d36ae0020e6e8 852 849 2013-09-29T20:09:59Z Eflags 334 Undo revision 849 by [[Special:Contributions/Domtheo|Domtheo]] ([[User talk:Domtheo|talk]]) wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps Eventually, my SlackBuild will be hosted here http://slackbuilds.rlworkman.net/CONTRIB/linuxtv-dvb-apps/ (thanks to robw810). == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ 75a8ff975f95ea3d57850216885694a0868a88d1 854 852 2013-09-30T03:39:53Z Domtheo 331 wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. [http://www.propertykita.com/rumah.html Rumah Dijual di Jakarta], [http://www.propertykita.com/rumah.html Rumah Dijual di Bandung], [http://www.propertykita.com/rumah.html Rumah Dijual di Bekasi] == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi] # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps Eventually, my SlackBuild will be hosted here http://slackbuilds.rlworkman.net/CONTRIB/linuxtv-dvb-apps/ (thanks to robw810). == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ 375959fb3151b8fa90b552b54c8d36ae0020e6e8 864 854 2013-10-31T09:29:40Z Domtheo 331 wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. [http://www.propertykita.com/rumah.html Rumah Dijual di Jakarta], [http://www.awanirentcar.com Sewa mobil jakarta], [http://kiosauto.com Aksesoris mobil] == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi] # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps Eventually, my SlackBuild will be hosted here http://slackbuilds.rlworkman.net/CONTRIB/linuxtv-dvb-apps/ (thanks to robw810). == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ 4de2c210a93130ec0cd38e6f5ec77aa0b646a3f8 869 864 2013-11-21T01:11:04Z Rworkman 13 Fucking spammers wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi] # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps Eventually, my SlackBuild will be hosted here http://slackbuilds.rlworkman.net/CONTRIB/linuxtv-dvb-apps/ (thanks to robw810). == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ fbb716c6aac147fce659760032518fbd49689f32 870 869 2013-11-21T01:11:25Z Rworkman 13 /* DVB Apps */ wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi] # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ fe886615a3a8aa6d826160d0692e37bc649c08a4 872 870 2013-11-25T03:22:15Z Kunaguers 343 Undo revision 869 by [[Special:Contributions/Rworkman|Rworkman]] ([[User talk:Rworkman|talk]]) wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. [http://www.propertykita.com/rumah.html Rumah Dijual di Jakarta], [http://www.awanirentcar.com Sewa mobil jakarta], [http://kiosauto.com Aksesoris mobil] == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi] # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ f3c4f9c7eec44a0e934172de3c5ed5b9fbbd03e5 874 872 2014-01-01T02:51:46Z Count Zero 346 Undo revision 872 by [[Special:Contributions/Kunaguers|Kunaguers]] ([[User talk:Kunaguers|talk]]) wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi] # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ fe886615a3a8aa6d826160d0692e37bc649c08a4 875 874 2014-01-01T02:53:07Z Count Zero 346 Removing a piece of spam I missed on first undo. wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ ec6559520878aab1714f2b78351def4e6c009ce3 879 875 2014-01-02T04:13:17Z Kunaguers 343 wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. [http://www.propertykita.com/rumah.html Rumah Dijual di Jakarta], [http://www.awanirentcar.com Sewa mobil jakarta], [http://kiosauto.com Aksesoris mobil] == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi] # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ f3c4f9c7eec44a0e934172de3c5ed5b9fbbd03e5 891 879 2014-01-07T05:14:11Z Count Zero 346 Undo revision 879 by [[Special:Contributions/Kunaguers|Kunaguers]] ([[User talk:Kunaguers|talk]]) wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ ec6559520878aab1714f2b78351def4e6c009ce3 SlackBuild Scripts 0 15 850 592 2013-09-13T02:56:35Z Domtheo 331 wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other [http://www.optimaweb.co.id/jasa-seo Jasa seo Profesional] sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi], [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta] : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. [http://www.propertykita.com/rumah.html Rumah Dijual di Depok], [http://www.propertykita.com/rumah.html Rumah Dijual di Jakarta] Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] 72db4bd0a5698b21a972d7384f89e08bdcacebeb 851 850 2013-09-29T20:08:32Z Eflags 334 Reverting vandalism wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] 5efc3844c6e55de198f33a7ed5009d1bd1cf0049 853 851 2013-09-30T03:39:27Z Domtheo 331 wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other [http://www.optimaweb.co.id/jasa-seo Jasa seo Profesional] sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi], [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.awanirentcar.com Sewa Mobil Jakarta] : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. [http://www.propertykita.com/rumah.html Rumah Dijual di Depok], [http://www.propertykita.com/rumah.html Rumah Dijual di Jakarta] Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] e2e0cdc16d8ab1376bd8787f3a34f95686042909 865 853 2013-11-15T16:01:15Z Willysr 341 Undo revision 853 by [[Special:Contributions/Domtheo|Domtheo]] ([[User talk:Domtheo|talk]]) wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] 5efc3844c6e55de198f33a7ed5009d1bd1cf0049 866 865 2013-11-18T03:36:30Z Domtheo 331 Undo revision 865 by [[Special:Contributions/Willysr|Willysr]] ([[User talk:Willysr|talk]]) wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other [http://www.optimaweb.co.id/jasa-seo Jasa seo Profesional] sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi], [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.awanirentcar.com Sewa Mobil Jakarta] : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. [http://www.propertykita.com/rumah.html Rumah Dijual di Depok], [http://www.propertykita.com/rumah.html Rumah Dijual di Jakarta] Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] e2e0cdc16d8ab1376bd8787f3a34f95686042909 868 866 2013-11-21T00:58:37Z Willysr 341 Undo revision 866 by [[Special:Contributions/Domtheo|Domtheo]] ([[User talk:Domtheo|talk]]) wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] 5efc3844c6e55de198f33a7ed5009d1bd1cf0049 871 868 2013-11-25T03:21:39Z Kunaguers 343 Undo revision 868 by [[Special:Contributions/Willysr|Willysr]] ([[User talk:Willysr|talk]]) wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other [http://www.optimaweb.co.id/jasa-seo Jasa seo Profesional] sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi], [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.awanirentcar.com Sewa Mobil Jakarta] : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. [http://www.propertykita.com/rumah.html Rumah Dijual di Depok], [http://www.propertykita.com/rumah.html Rumah Dijual di Jakarta] Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] e2e0cdc16d8ab1376bd8787f3a34f95686042909 873 871 2013-12-31T01:06:47Z Count Zero 346 Undo revision 871 by [[Special:Contributions/Kunaguers|Kunaguers]] ([[User talk:Kunaguers|talk]]) wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] 5efc3844c6e55de198f33a7ed5009d1bd1cf0049 878 873 2014-01-02T04:13:00Z Kunaguers 343 Undo revision 873 by [[Special:Contributions/Count Zero|Count Zero]] ([[User talk:Count Zero|talk]]) wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other [http://www.optimaweb.co.id/jasa-seo Jasa seo Profesional] sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi], [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.awanirentcar.com Sewa Mobil Jakarta] : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. [http://www.propertykita.com/rumah.html Rumah Dijual di Depok], [http://www.propertykita.com/rumah.html Rumah Dijual di Jakarta] Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] e2e0cdc16d8ab1376bd8787f3a34f95686042909 892 878 2014-01-07T05:15:03Z Count Zero 346 Undo revision 878 by [[Special:Contributions/Kunaguers|Kunaguers]] ([[User talk:Kunaguers|talk]]) wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] 5efc3844c6e55de198f33a7ed5009d1bd1cf0049 893 892 2014-01-10T13:30:58Z Kath16 348 wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [http://samsvaginalmeshlawsuitblog.wordpress.com/ Sam's Vaginal Mesh Lawsuit Blog] [http://samsvaginalmeshlawsuitblog.webs.com/ Sam's Blog] [[Category:Tutorials]] 7747e0cdffd0b97b6095851322cf91a12a75ec3f 894 893 2014-01-20T03:46:21Z Domtheos 350 wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other [http://www.optimaweb.co.id/jasa-seo Jasa seo Profesional] sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi], [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.awanirentcar.com Sewa Mobil Jakarta] : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. [http://www.propertykita.com/rumah.html Rumah Dijual di Depok], [http://www.propertykita.com/rumah.html Rumah Dijual di Jakarta] Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] e2e0cdc16d8ab1376bd8787f3a34f95686042909 895 894 2014-01-20T06:52:35Z Rworkman 13 Reverted edits by [[Special:Contributions/Domtheos|Domtheos]] ([[User talk:Domtheos|talk]]) to last revision by [[User:Kath16|Kath16]] wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [http://samsvaginalmeshlawsuitblog.wordpress.com/ Sam's Vaginal Mesh Lawsuit Blog] [http://samsvaginalmeshlawsuitblog.webs.com/ Sam's Blog] [[Category:Tutorials]] 7747e0cdffd0b97b6095851322cf91a12a75ec3f 896 895 2014-01-20T06:55:19Z Rworkman 13 Die in a fire, spammer. wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] 5efc3844c6e55de198f33a7ed5009d1bd1cf0049 897 896 2014-01-23T03:00:18Z Sinyorita 351 wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other [http://www.optimaweb.co.id/jasa-seo Jasa seo Profesional] sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi], [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.awanirentcar.com Sewa Mobil Jakarta] : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. [http://www.propertykita.com/rumah.html Rumah Dijual di Depok], [http://www.propertykita.com/rumah.html Rumah Dijual di Jakarta] Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] e2e0cdc16d8ab1376bd8787f3a34f95686042909 Links 0 3 859 834 2013-10-18T11:19:40Z Lystor 337 Add Slackware Packages Search wikitext text/x-wiki [[Category:Information]] ==Slackware Links== * http://www.slackware.com - the home of Slackware * [http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ Slackware FAQ by] [[User:juhl|juhl]] (Jesper Juhl) * [http://www.nielshorn.net/slackware/slack_versions.php A complete overview of all Slackware versions] by Niels Horn * [http://www.slackbook.org Updated version of the slackware book] * [http://www.slackware.com/getslack Extensive listing of Slackware mirrors] * [http://www.linuxquestions.org/questions/slackware-14/ Slackware forum] on LinuxQuestions.org * [http://slackbuilds.org/ slackbuilds.org - Build scripts for additional software] * [http://sbopkg.org sbopkg.org] - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository * [http://gitorious.org/sbopkg-slackware-queues Build queues for all Slackware packages from SlackBuilds.org] * [http://slackworld.berlios.de/ The Slack World page on berlios] * [http://slacky.eu European Slackware community] * [http://slackware.linux.or.id Indonesian Slackware Community] - by [[User:Willysr|Willysr]] * [http://open-eslack.org/ Spanish Slackware community] * [http://www.slack-world.com Iranian Slackware Community] * [http://www.slackware.ru Russian Slackware Community] * [http://www.slackware.su Russian Slackware forum and articles] * http://jtgzmanager.sf.net/ A new frontend to pkgtools built with Qt4 C++ libs - by Alexandre Arnt * http://slackbot.sourceforge.net - Buildsystem and buildtools for Slackware * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. ==Free packages== * [http://connie.slackware.com/~alien/slackbuilds/ Eric Hameleers' packages] [http://slackware.org.uk/people/alien/slackbuilds/ mirror] * [http://rlworkman.net/pkgs/ rworkman's packages] [http://slackware.org.uk/people/rlworkman/ mirror] * [http://www.nielshorn.net/slackware/slack_pkg.php Niels Horn's packages] * http://www.linuxpackages.net/ * [http://repository.slacky.eu/ Slacky.eu] Italian Slackware site * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware ==SlackBuild Repositories== * [http://slackbuilds.org The SlackBuilds.org Project] * [http://www.slackware.com/~alien/slackbuilds/ Eric "Alien" Hameleer's SlackBuilds] * [http://slackware.org.uk/people/rlworkman/sources/ rworkman's SlackBuilds] ==Live CD's based on Slackware== * [http://porteus.org/ Porteus] - A fast, portable and modular live CD/USB, originally started as a community remix of Slax * [http://www.imagineos.com.br/ ImagineOS] (formerly GoblinX) * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://alien.slackbook.org/ Alien Bob's Wiki] * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://open-eslack.org/wiki/ A Spanish Slackware Wiki] * [http://www.slackware.ru/wiki/ 1 Russian Slackware Wiki] * [http://wiki.slackware.su 2 Russian Slackware Wiki] ==RSS Feeds== * http://dev.slackware.it/rss/ - RSS feeds for stable Slackware release and -current ChangeLog * http://slackbuilds.org/mirror/rss/ - ChangeLog RSS feeds for stable and current ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==Slackware Packages Search== * http://pkgs.org * http://slackfind.net ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs d6bd07b475300082ddda4ef5bdda25b287663603 860 859 2013-10-22T15:10:22Z Alienbob 9 /* SlackBuild Repositories */ Spell my name correctly. wikitext text/x-wiki [[Category:Information]] ==Slackware Links== * http://www.slackware.com - the home of Slackware * [http://www.chaosbits.net/Articles/Historical/SlackwareFAQ/ Slackware FAQ by] [[User:juhl|juhl]] (Jesper Juhl) * [http://www.nielshorn.net/slackware/slack_versions.php A complete overview of all Slackware versions] by Niels Horn * [http://www.slackbook.org Updated version of the slackware book] * [http://www.slackware.com/getslack Extensive listing of Slackware mirrors] * [http://www.linuxquestions.org/questions/slackware-14/ Slackware forum] on LinuxQuestions.org * [http://slackbuilds.org/ slackbuilds.org - Build scripts for additional software] * [http://sbopkg.org sbopkg.org] - Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org repository * [http://gitorious.org/sbopkg-slackware-queues Build queues for all Slackware packages from SlackBuilds.org] * [http://slackworld.berlios.de/ The Slack World page on berlios] * [http://slacky.eu European Slackware community] * [http://slackware.linux.or.id Indonesian Slackware Community] - by [[User:Willysr|Willysr]] * [http://open-eslack.org/ Spanish Slackware community] * [http://www.slack-world.com Iranian Slackware Community] * [http://www.slackware.ru Russian Slackware Community] * [http://www.slackware.su Russian Slackware forum and articles] * http://jtgzmanager.sf.net/ A new frontend to pkgtools built with Qt4 C++ libs - by Alexandre Arnt * http://slackbot.sourceforge.net - Buildsystem and buildtools for Slackware * http://buildpkg.berlios.de/ - buildpkg: a Slackware package building utility. ==Free packages== * [http://connie.slackware.com/~alien/slackbuilds/ Eric Hameleers' packages] [http://slackware.org.uk/people/alien/slackbuilds/ mirror] * [http://rlworkman.net/pkgs/ rworkman's packages] [http://slackware.org.uk/people/rlworkman/ mirror] * [http://www.nielshorn.net/slackware/slack_pkg.php Niels Horn's packages] * http://www.linuxpackages.net/ * [http://repository.slacky.eu/ Slacky.eu] Italian Slackware site * [http://slacke17.sourceforge.net/ SlackE17] A distribution of Enlightenment DR17 for Slackware ==SlackBuild Repositories== * [http://slackbuilds.org The SlackBuilds.org Project] * [http://www.slackware.com/~alien/slackbuilds/ Eric "AlienBOB" Hameleers' SlackBuilds] * [http://slackware.org.uk/people/rlworkman/sources/ rworkman's SlackBuilds] ==Live CD's based on Slackware== * [http://porteus.org/ Porteus] - A fast, portable and modular live CD/USB, originally started as a community remix of Slax * [http://www.imagineos.com.br/ ImagineOS] (formerly GoblinX) * [http://mutagenix.org Mutagenix] A basic rescue CD and a Freerock GNOME based desktop CD * [http://www.slax.org Slax Homepage] * [http://slampp.abangadek.com SLAMPP Homepage] ==Other Wikis== * [http://alien.slackbook.org/ Alien Bob's Wiki] * [http://www.slackforum.de/wiki/ A German Slackware Wiki] * [http://open-eslack.org/wiki/ A Spanish Slackware Wiki] * [http://www.slackware.ru/wiki/ 1 Russian Slackware Wiki] * [http://wiki.slackware.su 2 Russian Slackware Wiki] ==RSS Feeds== * http://dev.slackware.it/rss/ - RSS feeds for stable Slackware release and -current ChangeLog * http://slackbuilds.org/mirror/rss/ - ChangeLog RSS feeds for stable and current ==Slack== * http://www.subgenius.com - The [[Church of the SubGenius]]: the source of the term "Slack" * http://www.modemac.com/x-day - X-Day * http://en.wikipedia.org/wiki/Church_of_the_SubGenius - Wikipedia entry ==Slackware Packages Search== * http://pkgs.org * http://slackfind.net ==General Links== * http://freshmeat.net - large index of Unix and cross-platform software and themes * http://sourceforge.net - large repository of Open Source code and applications * http://developer.berlios.de - another Open Source repository - ideal if you want subversion hosting for your project * http://art.gnome.org - gnome-desktop themes and backgrounds * http://www.gnome-look.org - eyecandy for your gnome-desktop * http://www.kde-look.org - eyecandy for your KDE desktop * http://www.kde-apps.org - Applications and addons for KDE * http://kerneltrap.org - Kernel talk * http://urbanmyth.org/microcode/ - The latest microcode for your Intel CPUs ef193e8001401a80986eff7a16d7aea18b2ab06b UX32VD 0 313 877 2014-01-01T13:28:01Z Mega-lnx 347 Created page with "[[Category:Hardware]] ==Slackware on an ASUS UX32VD== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pr..." wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> SMBus Control Method Interface <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default <M> AST server chips </pre> Sound: Intel HD Audio <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <*> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== d4ad19902fff19c7a7e6f2c1dece4a7108d2f94b 880 877 2014-01-02T12:27:29Z Mega-lnx 347 /* Slackware on an ASUS UX32VD */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> SMBus Control Method Interface <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default <M> AST server chips </pre> Sound: Intel HD Audio <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <*> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== 024c2322016b962ca27505e79d551ffeac9de296 881 880 2014-01-02T12:29:59Z Mega-lnx 347 wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> SMBus Control Method Interface <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default <M> AST server chips </pre> Sound: Intel HD Audio <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <*> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== a917980bba2edb4016e4baf8e02123a4e2711ba4 882 881 2014-01-02T12:32:00Z Mega-lnx 347 wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> SMBus Control Method Interface <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default <M> AST server chips </pre> Sound: Intel HD Audio <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <*> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] fb7765ccbc643e87e5e72991b46d180c7222e992 883 882 2014-01-02T14:42:57Z Mega-lnx 347 wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> SMBus Control Method Interface <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default <M> AST server chips </pre> Sound: Intel HD Audio <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <*> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Ambient Light Sensor== ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] * [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller/ als-controller] c024aac87cc3f47e3c2310c3c75c1f863c6cccda 884 883 2014-01-02T15:06:12Z Mega-lnx 347 /* Ambient Light Sensor */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> SMBus Control Method Interface <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default <M> AST server chips </pre> Sound: Intel HD Audio <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <*> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Ambient Light Sensor== See: [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller here] In order to use the Ambient Light Sensor it is necessary to insert the module (insmod als.ko) and the acpi call module (insmod acpi_call.ko). The acpi_call module is required to enable and disable the sensor. Finally run the als-controller to create the service for management of brightness. ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] * [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller/ als-controller] 97f8aab444a8c552313c889bd7c4ab26de6de03c 885 884 2014-01-02T15:09:02Z Mega-lnx 347 /* Hardware */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> lsusb<pre> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller Bus 002 Device 003: ID 04f2:b330 Chicony Electronics Co., Ltd Asus 720p CMOS webcam Bus 002 Device 005: ID 8087:07da Intel Corp. </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> SMBus Control Method Interface <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default <M> AST server chips </pre> Sound: Intel HD Audio <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <*> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Ambient Light Sensor== See: [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller here] In order to use the Ambient Light Sensor it is necessary to insert the module (insmod als.ko) and the acpi call module (insmod acpi_call.ko). The acpi_call module is required to enable and disable the sensor. Finally run the als-controller to create the service for management of brightness. ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] * [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller/ als-controller] ec8275c7332d0e8e1a7bb720e61dd1421dd97135 886 885 2014-01-02T15:10:48Z Mega-lnx 347 /* Kernel Configuration */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> lsusb<pre> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller Bus 002 Device 003: ID 04f2:b330 Chicony Electronics Co., Ltd Asus 720p CMOS webcam Bus 002 Device 005: ID 8087:07da Intel Corp. </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> SMBus Control Method Interface <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default </pre> Sound: Intel HD Audio <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <*> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Ambient Light Sensor== See: [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller here] In order to use the Ambient Light Sensor it is necessary to insert the module (insmod als.ko) and the acpi call module (insmod acpi_call.ko). The acpi_call module is required to enable and disable the sensor. Finally run the als-controller to create the service for management of brightness. ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] * [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller/ als-controller] 6e7513519a152775f24afd197491ce19d9782b38 887 886 2014-01-02T15:16:38Z Mega-lnx 347 /* Kernel Configuration */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> lsusb<pre> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller Bus 002 Device 003: ID 04f2:b330 Chicony Electronics Co., Ltd Asus 720p CMOS webcam Bus 002 Device 005: ID 8087:07da Intel Corp. </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> Intel SCH SMBus 1.0 <M> Intel iSMT SMBus Controller <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default </pre> Sound: Intel HD Audio <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <*> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Ambient Light Sensor== See: [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller here] In order to use the Ambient Light Sensor it is necessary to insert the module (insmod als.ko) and the acpi call module (insmod acpi_call.ko). The acpi_call module is required to enable and disable the sensor. Finally run the als-controller to create the service for management of brightness. ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] * [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller/ als-controller] 1cd6974fc6b768063255e0ddf4582e9baf51848d 889 887 2014-01-04T18:04:32Z Mega-lnx 347 wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> lsusb<pre> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller Bus 002 Device 003: ID 04f2:b330 Chicony Electronics Co., Ltd Asus 720p CMOS webcam Bus 002 Device 005: ID 8087:07da Intel Corp. </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> Intel SCH SMBus 1.0 <M> Intel iSMT SMBus Controller <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default </pre> Sound: Intel HD Audio <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <*> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Touchpad== <pre> Section "InputClass" Identifier "Synaptics Touchpad" Driver "synaptics" MatchISTouchpad "on" MatchDriver "synaptics" # MatchDevice Path "/dev/input/event*" # Option "FastTaps" "1" Option "ClickPad" "true" Option "HorizTwoFingerScroll" "on" Option "EmulateMidButtonTime" "0" Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0" Option "CircularScrolling" "on" Option "CircScrollTrigger" "1" Option "FingerLow" "6" Option "FingerHigh" "13" Option "SHMConfig" "on" EndSection </pre> ==Ambient Light Sensor== See: [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller here] In order to use the Ambient Light Sensor it is necessary to insert the module (insmod als.ko) and the acpi call module (insmod acpi_call.ko). The acpi_call module is required to enable and disable the sensor. Finally run the als-controller to create the service for management of brightness. ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] * [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller/ als-controller] 4d4a274120e300f4d075285cc5590fb25075f4fd 890 889 2014-01-04T18:05:12Z Mega-lnx 347 /* Touchpad */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> lsusb<pre> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller Bus 002 Device 003: ID 04f2:b330 Chicony Electronics Co., Ltd Asus 720p CMOS webcam Bus 002 Device 005: ID 8087:07da Intel Corp. </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> Intel SCH SMBus 1.0 <M> Intel iSMT SMBus Controller <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default </pre> Sound: Intel HD Audio <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <*> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Touchpad== /etc/X11/xorg.conf.d/50-synaptics.conf <pre> Section "InputClass" Identifier "Synaptics Touchpad" Driver "synaptics" MatchISTouchpad "on" MatchDriver "synaptics" # MatchDevice Path "/dev/input/event*" # Option "FastTaps" "1" Option "ClickPad" "true" Option "HorizTwoFingerScroll" "on" Option "EmulateMidButtonTime" "0" Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0" Option "CircularScrolling" "on" Option "CircScrollTrigger" "1" Option "FingerLow" "6" Option "FingerHigh" "13" Option "SHMConfig" "on" EndSection </pre> ==Ambient Light Sensor== See: [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller here] In order to use the Ambient Light Sensor it is necessary to insert the module (insmod als.ko) and the acpi call module (insmod acpi_call.ko). The acpi_call module is required to enable and disable the sensor. Finally run the als-controller to create the service for management of brightness. ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] * [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller/ als-controller] 2a9b936db2b802d0655292e688da10a0f1dfae10 EeePC 1215N 0 314 888 2014-01-03T14:59:13Z Mega-lnx 347 Created page with "[[Category:Hardware]] ==Slackware on an ASUS eeepc 1215N == '''Ethernet:''' - Kernel version 2.6.x <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Et..." wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS eeepc 1215N == '''Ethernet:''' - Kernel version 2.6.x <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet (1000 Mbit) ---> < x > Atheros L1C Gigabit Ethernet </pre> - Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet driver support ---> [ x ] Atheros Devices < x > Atheros L1C Gigabit Ethernet support </pre> '''Wifi:''' The wireless card has two controller solutions Proprietary driver: The Broadcom STA driver can be downloaded [http://www.broadcom.com/support/802.11/linux_sta.php here]. or Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network device support ---> [ x ] Wireless LAN ---> [ M ] USB ZD1201 based Wireless device support [ M ] Broadcom IEEE802.11n PCIe SoftMAC WLAN driver [ M ] IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) </pre> ae6cce8cbe28a5b76c56f8eb6449ebf6b0dba4f8 DVB 0 81 898 891 2014-01-23T03:00:32Z Sinyorita 351 Undo revision 891 by [[Special:Contributions/Count Zero|Count Zero]] ([[User talk:Count Zero|talk]]) wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. [http://www.propertykita.com/rumah.html Rumah Dijual di Jakarta], [http://www.awanirentcar.com Sewa mobil jakarta], [http://kiosauto.com Aksesoris mobil] == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware [http://www.optimaweb.co.id/jasa-seo Jasa seo Jakarta], [http://www.optimaweb.co.id/jasa-seo Jasa seo Bergaransi] # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ f3c4f9c7eec44a0e934172de3c5ed5b9fbbd03e5 901 898 2014-03-15T16:31:34Z Rworkman 13 Reverted edits by [[Special:Contributions/Sinyorita|Sinyorita]] ([[User talk:Sinyorita|talk]]) to last revision by [[User:Count Zero|Count Zero]] wikitext text/x-wiki [[Category:Tutorials]] == Introduction == I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble. ==Kernel Configuration == I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see [[Kernel26Compilation]] snipped from my .config # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n CONFIG_VIDEO_CX88_VP3054=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card. == Firmware == Make sure you are in /usr/src/linux # pwd /usr/src/linux There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it. # chmod +x Documentation/dvb/get_dvb_firmware # ./Documentation/dvb/get_dvb_firmware nxt2004 Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware # cp dvb-fe-nxt2004.fw /lib/firmware Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod $ lsmod | grep cx88 cx88_dvb 8964 0 cx8802 8068 1 cx88_dvb cx88xx 54180 2 cx88_dvb,cx8802 ir_common 7812 1 cx88xx btcx_risc 3848 2 cx8802,cx88xx tveeprom 12304 1 cx88xx cx88_vp3054_i2c 3456 1 cx88_dvb i2c_algo_bit 7432 2 cx88xx,cx88_vp3054_i2c mt352 5380 1 cx88_dvb or51132 8324 1 cx88_dvb video_buf_dvb 4228 1 cx88_dvb video_buf 15364 4 cx88_dvb,cx8802,cx88xx,video_buf_dvb nxt200x 11524 1 cx88_dvb cx24123 7684 1 cx88_dvb lgdt330x 6684 1 cx88_dvb cx22702 5252 1 cx88_dvb i2c_core 15248 15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702 dvb_pll 9220 4 cx88_dvb,or51132,nxt200x,cx22702 == DVB Apps == All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the [[SlackBuild_Scripts]] tutorial. You will log in to the cvs with an empty password. $ mkdir ~/dvb-apps-build $ cd ~/dvb-apps-build $ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login $ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps == Udev Rules == By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it: #create correct dvb devices KERNEL=="dvb0.dvr*", NAME="dvb/adapter0/dvr%n" KERNEL=="dvb0.demux*", NAME="dvb/adapter0/demux%n" KERNEL=="dvb0.frontend*", NAME="dvb/adapter0/frontend%n" KERNEL=="dvb0.audio*", NAME="dvb/adapter0/audio%n" KERNEL=="dvb0.ca*", NAME="dvb/adapter0/ca%n" KERNEL=="dvb0.osd*", NAME="dvb/adapter0/osd%n" KERNEL=="dvb0.net*", NAME="dvb/adapter0/net%n" KERNEL=="dvb0.video*", NAME="dvb/adapter0/video%n" == Scanning for Channels == Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file. $ mkdir ~/.azap $ touch ~/.azap/channels.conf $ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done: dumping lists (12 services) WJZ-DT:617000000:8VSB:49:52:1 WNUV High Def:629000000:8VSB:49:52:3 WNUV - The Tube:629000000:8VSB:65:68:4 Same as the Tube:629000000:8VSB:81:84:5 FOX45 HDTV:665000000:8VSB:49:52:3 FOX45 Digital Television:665000000:8VSB:65:68:4 WMAR-Radar SD-3:701000000:8VSB:81:84:5 WMAR-SD2:701000000:8VSB:65:68:4 WMAR-HD:701000000:8VSB:49:52:3 WMAR-TV:701000000:8VSB:0:0:65535 WBALDT:743000000:8VSB:49:52:1 WBALSD:743000000:8VSB:65:68:2 Done. You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to: $ azap -r WBALDT using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' tuning to 743000000 Hz video pid 0x0031, audio pid 0x0034 status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg: $ dmesg ... nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)... nxt2004: Waiting for firmware upload(2)... nxt2004: Firmware upload complete cx88[0]/2: queue is empty - first active cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2 cx88[0]/2: setting the interrupt mask cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active cx88[0]/2: cx8802_restart_queue cx88[0]/2: cx8802_restart_queue: queue is empty == Setting up MPlayer == According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[http://slackbuilds.rlworkman.net/MPlayer/]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched: ./configure \ --prefix=/usr \ --confdir=/etc/mplayer \ --enable-gui \ --enable-menu \ --enable-dvb \ --with-dvbincdir=/usr/src/linux/include \ --enable-xmms \ --with-codecsdir=$CODECSDIR \ --with-win32libdir=$CODECSDIR Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel: $ mplayer /dev/dvb/adapter0/dvr0 or $ mplayer dvb://WMARHD GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer. == Setting up Xine == According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly. == Resources == http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards http://www.mythtv.org/wiki/index.php/Dvb_Apps http://www.linuxtv.org/ ec6559520878aab1714f2b78351def4e6c009ce3 Slack-desc 0 17 899 570 2014-01-23T17:33:29Z Arfon 70 /* Tools */ - linuxpackages.net is no more. wikitext text/x-wiki =Overview= A proper slack-desc file should be written as follows: # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' on # the right side marks the last column you can put a character in. You must make # exactly 11 lines for the formatting to be correct. It's also customary to # leave one space after the ':'. |-----handy-ruler------------------------------------------------------| appname: appname (Short description of the application) appname: <this line is generally left blank> appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname: The "appname" string must *exactly* match the application name portion of the Slackware package (for example, a package titled "gaim-1.5-i486-1.tgz" must have a slack-desc file with the <appname> string of "gaim: " rather than "Gaim: " or "GAIM: " or something else. The first line ''must'' show the application name followed by a short description (enclosed in parentheses). The "handy ruler" is meant to stop you at 79 characters, because the standard console is 80x25 and if you go beyond this the words will wrap. The space after the : is needed only when there is text after the : In the above example lines 9 & 11 should not have a space after the : =Tools= 1. There is a command-line tool that automates the creation of slack-desc files and helps you generate legal slack-desc files with minimal effort: http://slack-desc.sourceforge.net/ =See Also= man makepkg man pkgtool [[Category:Tutorials]] 0f3097d30f877cb9195c9d921fe5a49bafc34225 SlackBuild Scripts 0 15 900 897 2014-03-15T16:31:25Z Rworkman 13 Reverted edits by [[Special:Contributions/Sinyorita|Sinyorita]] ([[User talk:Sinyorita|talk]]) to last revision by [[User:Rworkman|Rworkman]] wikitext text/x-wiki SlackBuild scripts are simple shell scripts which can automate the compiling and packaging of a program from source. While not necessary to compile and create packages on Slackware, SlackBuilds serve as tools for scripting the compiling and packaging processes, which are often repetitive. Just as importantly, SlackBuilds also act as documentation of compile-time options and configurations for that particular package. For that reason, official Slackware packages come with SlackBuilds bundled with the source code, and the inclusion of a SlackBuild is desirable in third-party packages. == Using SlackBuild Scripts == In this example I'm going to use the [http://www.pidgin.im Pidgin] slackbuild. First you find on the mirror in the source directory and download the whole directory of Pidgin: : <code>mkdir pidgin</code> : <code>cd pidgin</code> : <code>wget --passive-ftp <nowiki>ftp://slackware.at/slackware-12.1/source/xap/pidgin/*</nowiki></code> This downloads the files needed for Slackware scripts. The same idea applies for SlackBuild scripts from other sources - you generally need to download all of the files in the directory that contains the build script. For example, in the pidgin source directory, you would need the following files: : <code>pidgin-2.4.1.tar.bz2 pidgin-encryption-3.0.tar.gz pidgin.SlackBuild* slack-desc </code> There will sometimes be other files, such as doinst.sh, diff.gz patch files, and rc.* scripts in this directory. Now, say you want to get the newest version of pidgin? Well, you download the tar.bz2 file (in Pidgin, the script uses tar.bz2). Now you open up pidgin.Slackbuild: : <code>VERSION=2.4.1</code> This is the line we are looking at. Now we can change this to : <code>VERSION=2.4.2</code> Now you can edit the compile flags and other cool things not covered here. Now that we have downloaded and edited the SlackBuild script, let's make it executable: : <code>chmod +x pidgin.SlackBuild</code> Now this is executable, and we want to run as root for permissions and other reasons so we want to become root: : <code>su -</code> Now we start the script, and this will compile Pidgin and make a Slackware package. Depending on how the script is written, the resulting package will be in /tmp, some directory of /tmp, or perhaps some other location - have a look at the SlackBuild script for some hints if you can't find the package that was built. Once you find the package, you simply use 'installpkg' to install it normally (and you probably want to move it somewhere else on your system for safekeeping). : <code>./pidgin.SlackBuild</code> =SlackBuild Archives= ;* http://www.slackbuilds.org ;* http://repository.slacky.eu ;* http://www.slackware.com/~alien/slackbuilds/ =Other Resources= For a bit more detailed tutorial, see this entry: [[Writing A SlackBuild Script]] [[Category:Tutorials]] 5efc3844c6e55de198f33a7ed5009d1bd1cf0049 Broadcom Wireless 0 246 902 589 2014-04-01T21:42:31Z Beder 313 wikitext text/x-wiki [[Category:Tutorials]] == Introduction == This tutorial is written for setting up wireless on Slackware on laptops with Broadcom wireless cards. It deals with installing Boradcom's official proprietary '''wl''' driver for Linux that includes support for Broadcom's BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and BCM43228-based hardware. == Prerequisites == This tutorial assumes a full Slackware installation. There should also be a way to transfer files to the target laptop - it can either be a working internet connection using the laptop's ethernet card, '''or''' a different machine with internet access and a USB thumb drive to transfer the files. The regular user account on the laptop must also be a part of the ''netdev'' group. == Getting Started == The first thing is to check if the user is part of the ''netdev'' group : <pre>groups</pre> If the output does not contain <code>netdev</code>, then as <code>root</code>, enter the following command : <pre>usermod -a -G netdev username</pre> where <code>username</code> is the name of your user account. == Installing the driver == === Sbopkg method === If a working internet connection is available on the laptop (say a wired connection), use [http://sbopkg.org sbopkg] to install the drivers : <pre>sbopkg -i broadcom-sta</pre> === Manual method === Navigate to the slackbuilds.org's [http://slackbuilds.org/result/?search=broadcom-sta&sv= broadcom-sta page] and build the package according to the [http://slackbuilds.org/howto/ instructions] given. Make sure to download the source code relevant to the architecture of your installation (32-bit or 64-bit). === Kernel upgrade === If at any point you upgrade your kernel, you will have to do this process again, because the module is compiled against the running kernel only. == Blacklisting the b43 and ssb modules == The Broadcom's <code>wl</code> driver conflicts with the kernel's <code>b43</code> driver, so open up the <code>/lib/modprobe.d/blacklist.conf</code> using the text editor of your choice as <code>root</code> and add the following lines to it : <pre> blacklist ssb blacklist b43 blacklist bcma </pre> == Final steps == At this point, reboot your machine. The drivers should be installed and work now. To test this, enter the <code>iwconfig</code> command. you should see an output like this : <pre> $ iwconfig lo no wireless extensions. eth1 IEEE 802.11 Nickname:"lapto" Access Point: Not-Associated Link Quality:5 Signal level:217 Noise level:199 Rx invalid nwid:0 invalid crypt:31 invalid misc:0 eth0 no wireless extensions. </pre> This output suggests that the drivers installed right and your wireless card is recognized as <code>eth1</code> by the kernel. Hooray! If you still don't see the wireless extensions, check if any of the blacklisted modules are really not loaded: <pre> lsmod | grep ssb lsmod | grep b43 lsmod | grep bcma </pre> None of this commands should return anything. If any of the modules are still loaded, remove them manually: <pre> rmmod ssb rmmod b43 rmmod bcma </pre> You can also make sure that the "wl" module is properly loaded <pre> lsmod | grep wl </pre> If there is no output, you may load the "wl" module manually <pre> modprobe wl </pre> You can now either use the <code>iwconfig</code> tool to configure your wireless networks, '''or''' if you prefer to use a GUI, follow the next section for installing Wicd. == Installing Wicd == To make management of wireless connections easier, we will install [http://wicd.sourceforge.net/ Wicd] network manager that provides a simple configuration GUI and system tray icon. === Using slackpkg === If a working internet connection is available on the laptop (say a wired connection), simply use <code>slackpkg</code> to install wicd : <pre>slackpkg install wicd</pre> === Using package tarball === Download the <code>Wicd</code> package for your Slackware version from the ''extra/'' section of your preferred Slackware [http://slackware.osuosl.org/ mirror] and install using <code>installpkg</code>. For example, on a 32-bit system running Slackware 13.37, as root: <pre> wget http://slackware.dreamhost.com/slackware/slackware-13.37/extra/wicd/wicd-1.7.0-i486-2.txz installpkg ./wicd-1.7.0-i486-2.txz </pre> == Wicd usage == Start the Wicd daemon : <pre> /etc/rc.d/rc.wicd start </pre> Once its started, run <code>wicd-client</code> and configure the network to your liking. === Caveat === Wicd by default treats <code>wlan0</code> as the default wireless interface. Since the interface is <code>eth1</code> in our case, you might want to correct this in Wicd's Preferences. === User note === In order to access the wicd client utilities, your user must also be in the netdev group. Add your user to the netdev group, logout and login to make it effective, then you can run the wicd client utilities as your user. For the CLI based tool, there is wicd-cli and wicd-curses. For the GUI client, ther is wicd-client and wicd-gtk. 7e4b9cfdcfc85840767fda07c59ce2ad56ddfc27 903 902 2014-04-03T03:36:33Z Rworkman 13 Do not edit files in /lib/modprobe.d/ - they are overwritten on upgrades wikitext text/x-wiki [[Category:Tutorials]] == Introduction == This tutorial is written for setting up wireless on Slackware on laptops with Broadcom wireless cards. It deals with installing Boradcom's official proprietary '''wl''' driver for Linux that includes support for Broadcom's BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and BCM43228-based hardware. == Prerequisites == This tutorial assumes a full Slackware installation. There should also be a way to transfer files to the target laptop - it can either be a working internet connection using the laptop's ethernet card, '''or''' a different machine with internet access and a USB thumb drive to transfer the files. The regular user account on the laptop must also be a part of the ''netdev'' group. == Getting Started == The first thing is to check if the user is part of the ''netdev'' group : <pre>groups</pre> If the output does not contain <code>netdev</code>, then as <code>root</code>, enter the following command : <pre>usermod -a -G netdev username</pre> where <code>username</code> is the name of your user account. == Installing the driver == === Sbopkg method === If a working internet connection is available on the laptop (say a wired connection), use [http://sbopkg.org sbopkg] to install the drivers : <pre>sbopkg -i broadcom-sta</pre> === Manual method === Navigate to the slackbuilds.org's [http://slackbuilds.org/result/?search=broadcom-sta&sv= broadcom-sta page] and build the package according to the [http://slackbuilds.org/howto/ instructions] given. Make sure to download the source code relevant to the architecture of your installation (32-bit or 64-bit). === Kernel upgrade === If at any point you upgrade your kernel, you will have to do this process again, because the module is compiled against the running kernel only. == Blacklisting the b43 and ssb modules == The Broadcom's <code>wl</code> driver conflicts with the kernel's <code>b43</code> driver, so open up the <code>/etc/modprobe.d/blacklist.conf</code> using the text editor of your choice as <code>root</code> and add the following lines to it : <pre> blacklist ssb blacklist b43 blacklist bcma </pre> == Final steps == At this point, reboot your machine. The drivers should be installed and work now. To test this, enter the <code>iwconfig</code> command. you should see an output like this : <pre> $ iwconfig lo no wireless extensions. eth1 IEEE 802.11 Nickname:"lapto" Access Point: Not-Associated Link Quality:5 Signal level:217 Noise level:199 Rx invalid nwid:0 invalid crypt:31 invalid misc:0 eth0 no wireless extensions. </pre> This output suggests that the drivers installed right and your wireless card is recognized as <code>eth1</code> by the kernel. Hooray! If you still don't see the wireless extensions, check if any of the blacklisted modules are really not loaded: <pre> lsmod | grep ssb lsmod | grep b43 lsmod | grep bcma </pre> None of this commands should return anything. If any of the modules are still loaded, remove them manually: <pre> rmmod ssb rmmod b43 rmmod bcma </pre> You can also make sure that the "wl" module is properly loaded <pre> lsmod | grep wl </pre> If there is no output, you may load the "wl" module manually <pre> modprobe wl </pre> You can now either use the <code>iwconfig</code> tool to configure your wireless networks, '''or''' if you prefer to use a GUI, follow the next section for installing Wicd. == Installing Wicd == To make management of wireless connections easier, we will install [http://wicd.sourceforge.net/ Wicd] network manager that provides a simple configuration GUI and system tray icon. === Using slackpkg === If a working internet connection is available on the laptop (say a wired connection), simply use <code>slackpkg</code> to install wicd : <pre>slackpkg install wicd</pre> === Using package tarball === Download the <code>Wicd</code> package for your Slackware version from the ''extra/'' section of your preferred Slackware [http://slackware.osuosl.org/ mirror] and install using <code>installpkg</code>. For example, on a 32-bit system running Slackware 13.37, as root: <pre> wget http://slackware.dreamhost.com/slackware/slackware-13.37/extra/wicd/wicd-1.7.0-i486-2.txz installpkg ./wicd-1.7.0-i486-2.txz </pre> == Wicd usage == Start the Wicd daemon : <pre> /etc/rc.d/rc.wicd start </pre> Once its started, run <code>wicd-client</code> and configure the network to your liking. === Caveat === Wicd by default treats <code>wlan0</code> as the default wireless interface. Since the interface is <code>eth1</code> in our case, you might want to correct this in Wicd's Preferences. === User note === In order to access the wicd client utilities, your user must also be in the netdev group. Add your user to the netdev group, logout and login to make it effective, then you can run the wicd client utilities as your user. For the CLI based tool, there is wicd-cli and wicd-curses. For the GUI client, ther is wicd-client and wicd-gtk. acead184858e2e6a3073e5477ead2970313cd166 904 903 2014-04-03T03:38:04Z Rworkman 13 /* Blacklisting the b43 and ssb modules */ wikitext text/x-wiki [[Category:Tutorials]] == Introduction == This tutorial is written for setting up wireless on Slackware on laptops with Broadcom wireless cards. It deals with installing Boradcom's official proprietary '''wl''' driver for Linux that includes support for Broadcom's BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and BCM43228-based hardware. == Prerequisites == This tutorial assumes a full Slackware installation. There should also be a way to transfer files to the target laptop - it can either be a working internet connection using the laptop's ethernet card, '''or''' a different machine with internet access and a USB thumb drive to transfer the files. The regular user account on the laptop must also be a part of the ''netdev'' group. == Getting Started == The first thing is to check if the user is part of the ''netdev'' group : <pre>groups</pre> If the output does not contain <code>netdev</code>, then as <code>root</code>, enter the following command : <pre>usermod -a -G netdev username</pre> where <code>username</code> is the name of your user account. == Installing the driver == === Sbopkg method === If a working internet connection is available on the laptop (say a wired connection), use [http://sbopkg.org sbopkg] to install the drivers : <pre>sbopkg -i broadcom-sta</pre> === Manual method === Navigate to the slackbuilds.org's [http://slackbuilds.org/result/?search=broadcom-sta&sv= broadcom-sta page] and build the package according to the [http://slackbuilds.org/howto/ instructions] given. Make sure to download the source code relevant to the architecture of your installation (32-bit or 64-bit). === Kernel upgrade === If at any point you upgrade your kernel, you will have to do this process again, because the module is compiled against the running kernel only. == Blacklisting the b43 and ssb modules == The Broadcom's <code>wl</code> driver conflicts with the kernel's <code>b43</code> driver, so create the <code>/etc/modprobe.d/b43-blacklist.conf</code> file (name doesn't matter, but it's nice to have something intuitive) using the text editor of your choice as <code>root</code> and add the following lines to it : <pre> blacklist ssb blacklist b43 blacklist bcma </pre> == Final steps == At this point, reboot your machine. The drivers should be installed and work now. To test this, enter the <code>iwconfig</code> command. you should see an output like this : <pre> $ iwconfig lo no wireless extensions. eth1 IEEE 802.11 Nickname:"lapto" Access Point: Not-Associated Link Quality:5 Signal level:217 Noise level:199 Rx invalid nwid:0 invalid crypt:31 invalid misc:0 eth0 no wireless extensions. </pre> This output suggests that the drivers installed right and your wireless card is recognized as <code>eth1</code> by the kernel. Hooray! If you still don't see the wireless extensions, check if any of the blacklisted modules are really not loaded: <pre> lsmod | grep ssb lsmod | grep b43 lsmod | grep bcma </pre> None of this commands should return anything. If any of the modules are still loaded, remove them manually: <pre> rmmod ssb rmmod b43 rmmod bcma </pre> You can also make sure that the "wl" module is properly loaded <pre> lsmod | grep wl </pre> If there is no output, you may load the "wl" module manually <pre> modprobe wl </pre> You can now either use the <code>iwconfig</code> tool to configure your wireless networks, '''or''' if you prefer to use a GUI, follow the next section for installing Wicd. == Installing Wicd == To make management of wireless connections easier, we will install [http://wicd.sourceforge.net/ Wicd] network manager that provides a simple configuration GUI and system tray icon. === Using slackpkg === If a working internet connection is available on the laptop (say a wired connection), simply use <code>slackpkg</code> to install wicd : <pre>slackpkg install wicd</pre> === Using package tarball === Download the <code>Wicd</code> package for your Slackware version from the ''extra/'' section of your preferred Slackware [http://slackware.osuosl.org/ mirror] and install using <code>installpkg</code>. For example, on a 32-bit system running Slackware 13.37, as root: <pre> wget http://slackware.dreamhost.com/slackware/slackware-13.37/extra/wicd/wicd-1.7.0-i486-2.txz installpkg ./wicd-1.7.0-i486-2.txz </pre> == Wicd usage == Start the Wicd daemon : <pre> /etc/rc.d/rc.wicd start </pre> Once its started, run <code>wicd-client</code> and configure the network to your liking. === Caveat === Wicd by default treats <code>wlan0</code> as the default wireless interface. Since the interface is <code>eth1</code> in our case, you might want to correct this in Wicd's Preferences. === User note === In order to access the wicd client utilities, your user must also be in the netdev group. Add your user to the netdev group, logout and login to make it effective, then you can run the wicd client utilities as your user. For the CLI based tool, there is wicd-cli and wicd-curses. For the GUI client, ther is wicd-client and wicd-gtk. 9602ae0af77f289abf6c213a93861eb8f2dc1103 Talk:Broadcom Wireless 1 315 905 2014-04-03T03:44:05Z Rworkman 13 Explanation of changes wrt /etc/modprobe.d/ wikitext text/x-wiki I just made a couple of relatively minor edits to the page (20140402): First, admins shouldn't edit files in /lib/modprobe.d/ - those get overwritten on package upgrades; only /etc/modprobe.d/ or /run/modprobe.d/ should be used for local sysadmin edits, as they are not overwritten on upgrades. However, /run is on a tmpfs, so it is not persistent across reboots; as such, it would applicable for e.g. rules that are auto-generated on system startup based on some nonstable attributes (whether that's a good idea is another discussion entirely, but I think not). Given all of that, /etc/modprobe.d/ is the best location -- its intent is for sysadmins to copy files from /lib/modprobe.d/ and edit the copies if needed (same-named files in both /etc/modprobe.d/ and /lib/modprobe.d/ are handled such that the file in /etc/modprobe.d/ takes precedence). This leads up to my second point: Second, since there's no need in this particular case to override *all* of what's in /lib/modprobe.d/blacklist.conf (you only want to *add* content to it), it's a bit cleaner to just create a new file in /etc/modprobe.d/ with a sensible name and put what you want in it. e7aba4da0c121a7e0c36e38f48cb1e6ce20ca544 906 905 2014-04-03T03:44:38Z Rworkman 13 wikitext text/x-wiki I just made a couple of relatively minor edits to the page (20140402): First, admins shouldn't edit files in /lib/modprobe.d/ - those get overwritten on package upgrades; only /etc/modprobe.d/ or /run/modprobe.d/ should be used for local sysadmin edits, as they are not overwritten on upgrades. However, /run is on a tmpfs, so it is not persistent across reboots; as such, it would applicable for e.g. rules that are auto-generated on system startup based on some nonstable attributes (whether that's a good idea is another discussion entirely, but I think not). Given all of that, /etc/modprobe.d/ is the best location -- its intent is for sysadmins to copy files from /lib/modprobe.d/ and edit the copies if needed (same-named files in both /etc/modprobe.d/ and /lib/modprobe.d/ are handled such that the file in /etc/modprobe.d/ takes precedence). This leads up to my second point: Second, since there's no need in this particular case to override *all* of what's in /lib/modprobe.d/blacklist.conf (you only want to *add* content to it), it's a bit cleaner to just create a new file in /etc/modprobe.d/ with a sensible name and put what you want in it. --rworkman ed7c40a4602d046b3ab4e1c62274c16f23eda157 Utf-8 linux console 0 177 907 415 2014-05-09T17:36:30Z Dive 19 /* A Quick Look at Using UTF-8 in the Linux Console (without X) */ wikitext text/x-wiki [[Category:Tutorials]] ''by Dive'' == A Quick Look at Using UTF-8 in the Linux Console (without X) == A few people have asked about this in ##slackware lately so I though I'd put down a few notes on how I got utf-8 up and running. Feel free to add any further info. In these days of high powered X desktop environments with all their flashy composite bells and whistles it may seem strange to worry about how the plain Linux console behaves, but we need to remember that there are some very nice applications that live in the console and can be just as (or even more) productive than the X Windows counterparts. I'm thinking of screen, irssi, mutt, elinks, vim/vi, mplayer (using svga), links, zgv and slrn to name but a few. And of course we have to mention Slackware tools like pgktool, slackpkg and sbopkg. Once you get hooked on using the console it is hard to go back. Anyway here we go ... == The Console == The first thing to do is configure the console. There is a kernel parameter we can add to /etc/lilo.conf to do this: append="vt.default_utf8=1" Here's an example from mine: # Linux bootable partition config begins image = /boot/vmlinuz-2.6.27.7-custom root = /dev/hda1 label = Linux-custom append="resume=/dev/hda2 vt.default_utf8=1" read-only # Linux bootable partition config ends Once you have saved lilo.conf and run '''lilo''' a quick reboot is needed. == LANG environment variable == I find that typing multibyte characters like "ä" and erasing them with backspace, I can erase much more than what I wrote. It helps to set the LANG variable, preferably by editing /etc/profile.d/lang.sh (or lang.csh) to set it to en_US.UTF-8 or similar. == Fonts == After that we need to find a font that actually contains the characters you want to see. My 'font of the moment' is lat9w-16. This contains the British £ (pound) and € (euro) symbols that I need, plus a lot of useful accented characters. But what is just as important are the correct drawing characters so that curses programs like pkgtool and sbopkg are printed on the screen correctly. If you experiment with the '''setconsolefont''' command you will find that some fonts draw curses box borders as squares or question marks, so check out some fonts and see which ones work and which don't. The '''setconsolefont''' command will put your chosen font into /etc/rc.d/rc.font so it will load at bootup. == Keyboard == Ok, great you can now read characters correctly, but you need the correct keymap to be able to type them. That's a little harder. If you can find a utf-8 keymap for your locale/hardware then that's fine. Personally I didn't find any of the installed keymaps suitable so I looked around for an alternative. I found a uk-utf8 keymap on the intertubes, but this was unfortunately missing all the Ctrl+[a-z] keys so I edited it and added my own. I also added some AltGr+[a-z] (well not all of those) for accented characters. You may find this keymap useful as a starting point to create your own if you cannot find a more suitable one. Have a look through the comments and the codes and you should pick up the method. To add your own combinations you will need to know the correct codes for the characters you need. You can find a table of utf-8 characters here: [http://home.tiscali.nl/t876506/utf8tbl.html]http://home.tiscali.nl/t876506/utf8tbl.html Look up the code in that table and convert it to hex. E.G. è is 232 in decimal, E8 in hex; é is code 233 in decimal, E9 in hex, so the entry in your keymap should be: # key = normal shifted AltGr+e AltGr+shift+e keycode 18 = e E U+00E8 U+00E9 # prints: e E è é You can find the keycodes with the '''showkey''' program. Once edited you can load the map with the '''loadkeys''' program. Loadkeys will update /etc/rc.d/rc.keymap but you will need to copy the keymap to /usr/share/kbd/keymaps/i386/qwerty/ so it is found on bootup. Here is a link to my updated uk-utf8 map: [http://www.unrealize.co.uk/source/uk-utf.map.gz]http://www.unrealize.co.uk/source/uk-utf.map.gz You can load this ungzipped but it's better to gzip it back after editing to keep things consistent. == Conclusion == By now you should have a fully usable keyboard/console correctly printing unicode characters. You will probably need to tell some programs like mutt and irrsi that you are using a utf-8 system. Note: There exists two shell scripts - '''unicode_start''' and '''unicode_stop'''. Typing '''unicode_start [font]''' will load the required font and set up keyboard correctly for unicode input. Bye for now, [[User:Dive|Dive]] 02:33, 20 March 2009 (UTC) 76a7e301c82a1512ad9d2e3ecc318ab7a8358fa4 Antivirus 0 52 908 73 2014-07-04T15:49:46Z DanS 353 wikitext text/x-wiki = Antivirus = Why would you want antivirus software on a Linux box, when there are so few Linux viruses out there? Maybe you don't want to spread them to Windows boxes, or maybe you're worried about getting windows viruses via Windows emulation software, or maybe you want a little extra insurance. The next question is which one? Depends on what you're looking for. A good thread on this is [http://www.linuxquestions.org/questions/slackware-14/antivirus-636562/?highlight=antivirus]. I'll talk about installing 2 antivirus programs, Clam and Antivir. '''Clam''': I haven't used it, but it has a command line scanner and a manual updater. Go to [http://www.slackbuilds.org] and search for clamav. Follow the instructions. '''Antivir''': The good: updates virus definitions automatically, and scans files in realtime on open/close (can also scan on execute). You can run scans manually from the command line, and there's a GUI if you want to use it. The bad: complicated setup, I don't think the free version scans samba shares, has spyware protection, and it won't automatically scan archive files until you extract them. **Update** [http://www.avira.com/en/support-for-home-knowledgebase-detail/kbid/1491 Ending Support] The rest of this tutorial helps you setup Antivir for Slackware 12.1 and Slackware 12.0. This is a compilation of information from dazuko.org, the Antivir user manual, and my own personal experience. ==You need:== #latest dazuko kernel module from [http://www.dazuko.org/indexold.shtml] #antivir from [http://www.avira.com] #some time to kill ==Slackware 12.1== ===Dazuko=== *Extract dazuko somewhere: <code>tar xzvf dazuko-2.3.4.tar.gz</code>. There are 2 ways to install the kernel module, either via LSM or syscall hooks. The recommended way is via LSM, but I wasn't able to configure the Slackware 2.6.24.5 kernel to compile capabilities as a module (make menuconfig->Security Options->Default Linux Capabilities). I was able to do this with the old kernel in Slackware 12.0, but not the new one. View the FAQ at dazuko.org for more info. Also view <dazuko_dir>/README.linux26 for info on using syscall hooks. *Recompile the kernel (Tested). You only need to do this if you're using an SMP (multi-processor capable) kernel. I won't go into detail on how to recompile the kernel, as that's covered here [http://slackwiki.org/Kernel_Compilation]. Anyway, before you make the kernel, <code>cd /usr/src/linux</code>, and patch the kernel like this: **<code>patch fs/dcache.c <dazuko_dir>/patch_dpath.diff</code> **Finish recompiling the kernel, make sure everything boots up OK. **<code>cd <dazuko_dir></code> **<code>./configure --enable-syscalls --mapfile=/boot/System.map --disable-local-dpath</code> *if you don't need to recompile the kernel (non-SMP), do this: **<code>./configure --enable-syscalls --mapfile=/boot/System.map</code> *Don't recompile the kernel, and pass in different flags to <code>./configure</code> (Untested). I'm not totally sure if you lose any functionality by doing this, but up to you. **<code>cd <dazuko_dir></code> **<code>./configure --enable-syscalls --mapfile=/boot/System.map --disable-chroot-support</code> *<code>make</code> *<code>cd example_c</code> *<code>make</code> *<code>example /tmp</code> *in another terminal, create a test file in your /tmp directory. if you see output from example, dazuko is working correctly. *<code>cd ..</code> *<code>make test</code> *<code>make install</code> ===Antivir=== *Extract antivir somewhere. There is documentation under <code><antivir_dir>/doc/avserver_en.pdf</code>, along with some readmes. *Install with <code>./install</code>. Make sure that you specify to let antivir load the dazuko module (easier). The path to it is <code>/lib/modules/`uname -r`/extra/dazuko.ko</code>. You probably want the default options, including the 2 hr updates. *add users to the antivir group. <code>vim /etc/group</code>, and add usernames to the antivir group. *my personal preference is to move infected files to /home/quarantine. here's how you set it up: **<code>mkdir /home/quarantine</code> **<code>chown nobody:antivir /home/quarantine</code> **<code>chmod 775 /home/quarantine</code> *under <code>/etc/avguard.conf</code>, add/edit these lines: **<code>MoveConcerningFilesTo /home/quarantine</code> **<code>IncludePath /opt/downloads</code> (where I put all my downloads, /home already scanned by default) *restart avguard with <code>/usr/sbin/avguard restart</code> *test that it works by going to [http://www.eicar.org]. There's a link for downloading sample viruses. If everything works, the file should be moved immediately to <code>/home/quarantine</code>. For archive files (.zip, .tar, etc.), you will have to extract them before antivir will catch them. Lame free restriction. *files to remember: **<code>/etc/avguard.conf</code> **<code>/etc/avupdater.conf</code> **<code>/var/log/avguard.log</code> **<code>/var/log/avupdater.log</code> **<code>/usr/bin/antivir</code> **<code>/usr/bin/antivir-gui</code> **<code>/usr/sbin/avguard</code> **<code>/usr/sbin/avupdater</code> *commands to remember **to do a manual update ***<code>antivir --update</code> **to scan a directory manually, and all subdirectories, extracting archive files ***<code>antivir --allfiles -s -z --moveto=/home/quarantine <directory_to_scan></code> ==Slackware 12.0== ===Dazuko=== *Extract dazuko somewhere: tar xzvf dazuko-2.3.4.tar.gz. We can install this the recommended way, via LSM. You shouldn't need to recompile the kernel, as capabilities should be a module. To check, do this: **<code>lsmod | grep capab</code> **If you see it there, you're in luck. Otherwise you need to recompile the kernel with this option: ***make menuconfig->Security Options-><M>Default Linux Capabilities. *<code>cd <dazuko_dir></code> *<code>./configure</code> *<code>make</code> (probably need to be root) *<code>rmmod capability</code> (unload this for a second so we can try out dazuko). *<code>make test</code> *<code>cd example_c</code> *<code>make</code> *<code>example /tmp</code> *in another terminal, create a test file in your /tmp directory. if you see output from example, dazuko is working correctly. *<code>cd ..</code> *<code>make install</code> *<code>modprobe capability</code> (reload into memory) *edit <code>/etc/rc.d/rc.modules</code>, and add this line before the capability module is loaded: **<code>/sbin/modprobe dazuko</code> *There is an issue when the capability module is loaded first. The steps above load the dazuko module first, which should fix the problem. ===Antivir=== *Same as above, except tell antivir that the kernel will load the module. This is so that you can load dazuko before capabilities in <code>/etc/rc.d/rc.modules</code>. [[Category:Tutorials]] fe6ea239a6a9b09ee415d57a1ef5a3c983b9e45c Apc8750 0 316 909 2014-08-03T14:17:24Z Gv 356 Created page with " JUST PREPARING THE PAGE Installing Slackware on apc-8750 http://apc.io/products/8750a/ http://apc.io/library/ https://github.com/linux-wmt/linux-vtwm http://arm.slackware..." wikitext text/x-wiki JUST PREPARING THE PAGE Installing Slackware on apc-8750 http://apc.io/products/8750a/ http://apc.io/library/ https://github.com/linux-wmt/linux-vtwm http://arm.slackware.com/getslack/ http://ftp.arm.slackware.com/slackwarearm/ Creating a bootable micro sd card problem solution Installing slackware Creating a bootable micro sd card For this you need a custom built kernel and a initramfs image from slackware for arm distribution - uinitrd-kirkwood.img Preparing the micro sd card You need at least three partitions, one vfat, one or more Linux partitions, and a Linux swap partition. Here is how the partitions I used look like under fdisk ran on host. Disk /dev/sdc: 15.9 GB, 15931539456 bytes 64 heads, 32 sectors/track, 15193 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdc1 * 2048 206847 102400 c W95 FAT32 (LBA) /dev/sdc2 206848 28878847 14336000 83 Linux /dev/sdc3 28878848 31116287 1118720 82 Linux swap 1st partition: make it bootable, and create a file system using mkfs.vfat 2nd partition: create a reiserfs ( or other ) file system using mkreiserfs Now you need to make a custom kernel for booting into. I used linux-vtwm-testing available at https://github.com/linux-wmt/linux-vtwm Please refer to the link: for the config file which was used. also require a small initramfs image prepared from the boot media aviable at apc.io library. download it from here : initramfs_data.cpio.gz or use the following init scrip with the initrd.gz from apc.io library. init: #!/bin/busybox sh /bin/busybox mount -t proc /proc /bin/busybox mount -t sys /sys /bin/busybox echo /sbin/mdev > /proc/sys/kernel/hotplug /bin/busybox mdev -s /bin/busybox --install mkfs.ext2 /dev/ram0 mkdir /root mount /dev/ram0 /root cd /root mkdir /flash mount /dev/mmcblk0p1 /flash cpio -id < /flash/initrd-kirkwood.cpio exec chroot /root /bin/busybox init exec /bin/busybox init Copy the initramfs_data.cpio.gz for to $KERNEL_SRC/usr area. In case you are building it on your own: gunzip initrd.gz mkdir initramfs_dat mountpoint initramfs_data || mount -o loop initrd fs create initramfs_data/init as shown above chmod a+x initramfs_data/init sync (cd initramfs_data ; find . | cpio -o -H newc | gzip > ../initramfs_data.cpio.gz ) Please note that the kernel uses a CONFIG_CMDLINE= for vga: CONFIG_CMDLINE=" mem=440M console=tty0 mbtotal=52M" for serial: CONFIG_CMDLINE=" mem=440M console=ttyWMT0,115200n8 mbtotal=52M" kernel is compiled on the host, using arm-2014.05 from arm. Eg: export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackinst.vga $OBJ/.config cp initramfs_data.cpio.gz $KERNEL_SRC/usr make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb > $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n "My Linux" -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin Preparing the cpio archive: dd if=./uinitrd-kirkwood.img bs=64 skip=1 of=initrd-kirkwood.cpio.gz gunzip initrd-kirkwood.cpio.gz Once both uzImage.bin and initrd-kirkwood.cpio copy them to the bootable vfat partition. create a slackware14.1 directory in the reiserfs partition of the micro sd card. copy slackware for arm distribution to the slackware14.1 directory. Now you are ready to boot the new disk, and install slackware from the pre mounted directory under /mnt/slackware14.1/slackware ( which is automounted as the selection for target is done ). 4294ace4b61033232da12cf94d30177b9ecf0151 910 909 2014-08-03T14:45:20Z Gv 356 wikitext text/x-wiki == Trial Edition == == Installing Slackware on apc-8750 == == Creating a bootable micro sd card == For this you need a custom built kernel and a initramfs image from slackware for arm distribution - uinitrd-kirkwood.img === Preparing the micro sd card === You need at least three partitions, one vfat, one or more Linux partitions, and a Linux swap partition. Here is how the partitions I used look like under fdisk ran on host. <pre> Disk /dev/sdc: 15.9 GB, 15931539456 bytes 64 heads, 32 sectors/track, 15193 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdc1 * 2048 206847 102400 c W95 FAT32 (LBA) /dev/sdc2 206848 28878847 14336000 83 Linux /dev/sdc3 28878848 31116287 1118720 82 Linux swap </pre> Creating filesystem: * 1st partition: make it bootable, and create a file system using mkfs.vfat * 2nd partition: create a reiserfs ( or other ) file system using mkreiserfs Now you need to make a custom kernel for booting into. I used linux-vtwm-testing available at https://github.com/linux-wmt/linux-vtwm Please refer to the link: for the config file which was used. also require a small initramfs image prepared from the boot media aviable at apc.io library. download it from here : initramfs_data.cpio.gz or use the following init scrip with the initrd.gz from apc.io library. init: <pre> #!/bin/busybox sh /bin/busybox mount -t proc /proc /bin/busybox mount -t sys /sys /bin/busybox echo /sbin/mdev > /proc/sys/kernel/hotplug /bin/busybox mdev -s /bin/busybox --install mkfs.ext2 /dev/ram0 mkdir /root mount /dev/ram0 /root cd /root mkdir /flash mount /dev/mmcblk0p1 /flash cpio -id < /flash/initrd-kirkwood.cpio exec chroot /root /bin/busybox init exec /bin/busybox init </pre> Copy the initramfs_data.cpio.gz for to $KERNEL_SRC/usr area. In case you are building it on your own: <pre> gunzip initrd.gz mkdir initramfs_dat mountpoint initramfs_data || mount -o loop initrd fs create initramfs_data/init as shown above chmod a+x initramfs_data/init sync (cd initramfs_data ; find . | cpio -o -H newc | gzip > ../initramfs_data.cpio.gz ) </pre> Please note that the kernel uses a CONFIG_CMDLINE= for vga: * CONFIG_CMDLINE=" mem=440M console=tty0 mbtotal=52M" for serial: * CONFIG_CMDLINE=" mem=440M console=ttyWMT0,115200n8 mbtotal=52M" kernel is compiled on the host, using arm-2014.05 from arm. Eg: <pre> export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackinst.vga $OBJ/.config cp initramfs_data.cpio.gz $KERNEL_SRC/usr make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb > $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n "My Linux" -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin </pre> Preparing the cpio archive: <pre> dd if=./uinitrd-kirkwood.img bs=64 skip=1 of=initrd-kirkwood.cpio.gz gunzip initrd-kirkwood.cpio.gz </pre> Once both uzImage.bin and initrd-kirkwood.cpio copy them to the bootable vfat partition. Create a slackware14.1 directory in the reiserfs partition of the micro sd card. Copy slackware for arm distribution to the slackware14.1 directory. Now you are ready to boot the new disk, and install slackware from the pre mounted directory under /mnt/slackware14.1/slackware ( which is automounted as the selection for target is done ). === Configuration === For X Windows, use a window manager like fluxbox. == links == http://apc.io/products/8750a/ http://apc.io/library/ https://github.com/linux-wmt/linux-vtwm http://arm.slackware.com/getslack/ http://ftp.arm.slackware.com/slackwarearm/ 154b9bf6dabc6101cea231ee52e115b83e34a09f 911 910 2014-08-03T17:05:42Z Gv 356 /* Creating a bootable micro sd card */ wikitext text/x-wiki == Trial Edition == == Installing Slackware on apc-8750 == == Creating a bootable micro sd card == For this you need a custom built kernel and a initramfs image from slackware for arm distribution - uinitrd-kirkwood.img * uzImage.bin [[Detailed description of how uzImage.bin was prepared.]] * initrd-kirkwood.cpio [[Detailed description of how initrd-kirkwood.cpio was prepared.]] Download and keep these files ready === Preparing the micro sd card === You need at least three partitions, one vfat, one or more Linux partitions, and a Linux swap partition for this method of installation. Here is how the partitions I used look like under fdisk ran on host. <pre> Disk /dev/sdc: 15.9 GB, 15931539456 bytes 64 heads, 32 sectors/track, 15193 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdc1 * 2048 206847 102400 c W95 FAT32 (LBA) /dev/sdc2 206848 28878847 14336000 83 Linux /dev/sdc3 28878848 31116287 1118720 82 Linux swap </pre> Creating filesystem: * 1st partition: make it bootable, and create a file system using mkfs.vfat * 2nd partition: create a reiserfs ( or other ) file system using mkreiserfs ==== Detailed description of how uzImage.bin was prepared. ==== I used linux-vtwm-testing available at https://github.com/linux-wmt/linux-vtwm Please refer to the link [[config.slackinstall.vga]] for the config file which was used. This method also require a small initramfs image prepared from the boot media aviable at apc.io library. download it from here : [[initramfs_data.cpio.gz]] or use the following init scrip with the initrd.gz from apc.io library. init: <pre> #!/bin/busybox sh /bin/busybox mount -t proc /proc /bin/busybox mount -t sys /sys /bin/busybox echo /sbin/mdev > /proc/sys/kernel/hotplug /bin/busybox mdev -s /bin/busybox --install mkfs.ext2 /dev/ram0 mkdir /root mount /dev/ram0 /root cd /root mkdir /flash mount /dev/mmcblk0p1 /flash cpio -id < /flash/initrd-kirkwood.cpio exec chroot /root /bin/busybox init exec /bin/busybox init </pre> Copy the initramfs_data.cpio.gz for to $KERNEL_SRC/usr area. ===== Details of how initramfs_data.cpio.gz was prepared. ===== <pre> gunzip initrd.gz mkdir initramfs_data mount -o loop initrd initramfs_data create initramfs_data/init as shown above chmod a+x initramfs_data/init sync (cd initramfs_data ; find . | cpio -o -H newc | gzip > ../initramfs_data.cpio.gz ) </pre> Please note that the kernel uses a CONFIG_CMDLINE= for vga: * CONFIG_CMDLINE=" mem=440M console=tty0 mbtotal=52M" for serial: * CONFIG_CMDLINE=" mem=440M console=ttyWMT0,115200n8 mbtotal=52M" kernel is compiled on the host, using arm-2014.05 from arm. kernel build procedure: <pre> export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackinst.vga $OBJ/.config cp initramfs_data.cpio.gz $KERNEL_SRC/usr make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb > $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n "My Linux" -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin </pre> Preparing the cpio archive: <pre> download uinitrd-kirkwood.img dd if=./uinitrd-kirkwood.img bs=64 skip=1 of=initrd-kirkwood.cpio.gz gunzip initrd-kirkwood.cpio.gz </pre> === Copying slackware install files onto second partition === Create a slackware14.1 directory in the reiserfs partition of the micro sd card. Copy slackware for arm distribution to the slackware14.1 directory. === Booting and installing slackware === Now you are ready to boot the new disk, and install slackware from the pre mounted directory under /mnt/slackware14.1/slackware ( which is automounted as the selection for target is done ). === Configuration === For X Windows, use a window manager like fluxbox. == links == http://apc.io/products/8750a/ http://apc.io/library/ https://github.com/linux-wmt/linux-vtwm http://arm.slackware.com/getslack/ http://ftp.arm.slackware.com/slackwarearm/ 89c7c2a440d493c4e714d5161bf989faf6b223d0 912 911 2014-08-03T17:58:39Z Gv 356 wikitext text/x-wiki == Installing Slackware on apc-8750 == Mainline linux kernel lacks support for Wondermedia 8750 currently. However linux-vtwm kernel available at github has support for Wondermedia 8750 SOC. Since the kernel failed to load initrd cpio archive the normal way, a special method was used for loading the setup image. * Create three partitions, first bootable vfat, second reiserfs and third Linux swap. * Download and copy uzImage.bin and initrd-kirkwood.cpio to first vfat partition * Download and copy Slackware installation files over to second partition * Boot from the micro sd card prepared, install, and configure Slackware * Download and replace the boot kernel with new uzImage.bin for booting from second partition. == Creating a bootable micro sd card == For this you need a custom built kernel and a initramfs image from Slackware for arm distribution - uinitrd-kirkwood.img * uzImage.bin [[Detailed description of how uzImage.bin was prepared.]] * initrd-kirkwood.cpio [[Detailed description of how initrd-kirkwood.cpio was prepared.]] Download and keep these files ready === Preparing the micro sd card === You need at least three partitions, one vfat, one or more Linux partitions, and a Linux swap partition for this method of installation. Here is how the partitions I used look like under fdisk ran on host. <pre> Disk /dev/sdc: 15.9 GB, 15931539456 bytes 64 heads, 32 sectors/track, 15193 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdc1 * 2048 206847 102400 c W95 FAT32 (LBA) /dev/sdc2 206848 28878847 14336000 83 Linux /dev/sdc3 28878848 31116287 1118720 82 Linux swap </pre> Creating filesystem: * 1st partition: make it bootable, and create a file system using mkfs.vfat * 2nd partition: create a reiserfs ( or other ) file system using mkreiserfs ==== Detailed description of how Slackware install kernel was prepared. ==== I used linux-vtwm-testing available at https://github.com/linux-wmt/linux-vtwm Zipfile you download from the site may cause problem when extracting - few files may be missing!. One option is to use p7zip or other unzip program instead of the default zip utility in Slackware. You may also get a tar.gz file using <pre> wget --no-check-certificate \ https://github.com/linux-wmt/linux-vtwm/archive/testing.tar.gz </pre> Please refer to the link [[config.slackinstall.vga]] for the config file which was used. This method also require a small initramfs image prepared from the boot media available at apc.io library. download it from here : [[initramfs_data.cpio.gz]] or use the following init scrip with the initrd.gz from apc.io library. init: <pre> #!/bin/busybox sh /bin/busybox mount -t proc /proc /bin/busybox mount -t sys /sys /bin/busybox echo /sbin/mdev > /proc/sys/kernel/hotplug /bin/busybox mdev -s /bin/busybox --install mkfs.ext2 /dev/ram0 mkdir /root mount /dev/ram0 /root cd /root mkdir /flash mount /dev/mmcblk0p1 /flash cpio -id < /flash/initrd-kirkwood.cpio exec chroot /root /bin/busybox init exec /bin/busybox init </pre> Copy the initramfs_data.cpio.gz for to $KERNEL_SRC/usr area. ===== Details of how initramfs_data.cpio.gz was prepared. ===== <pre> gunzip initrd.gz mkdir initramfs_data mount -o loop initrd initramfs_data create initramfs_data/init as shown above chmod a+x initramfs_data/init sync (cd initramfs_data ; find . | cpio -o -H newc | gzip > ../initramfs_data.cpio.gz ) </pre> Please note that the kernel uses a CONFIG_CMDLINE= for vga: <pre> CONFIG_CMDLINE=" mem=440M console=tty0 mbtotal=52M" CONFIG_CMDLINE_FORCE=y </pre> for serial: <pre> CONFIG_CMDLINE=" mem=440M console=ttyWMT0,115200n8 mbtotal=52M" CONFIG_CMDLINE_FORCE=y </pre> kernel is compiled on the host, using arm-2014.05 from arm. kernel build procedure: <pre> export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackinst.vga $OBJ/.config cp initramfs_data.cpio.gz $KERNEL_SRC/usr make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb > $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n "My Linux" -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin </pre> Preparing the cpio archive: <pre> download http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.1/isolinux/uinitrd-kirkwood.img dd if=./uinitrd-kirkwood.img bs=64 skip=1 of=initrd-kirkwood.cpio.gz gunzip initrd-kirkwood.cpio.gz </pre> == Copying Slackware install files onto second partition == Create a slackware14.1 directory in the reiserfs partition of the micro sd card. Copy Slackware for arm distribution to the slackware14.1 directory, from http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.1/ sdc1: /uzImage.bin /initrd-kirkwood.cpio sdc2: /slackware14.1/ == Booting with the installer and installing Slackware == Now you are ready to boot the from the new disk just prepared, and install Slackware from the pre mounted directory under /mnt/slackware14.1/slackware ( which is automounted as the selection for target is done ). Put the newly prepared micro sd card in the slot and reboot apc-8750. Once you get the Slackware login prompt, proceed as usual. === Configuration === For X Windows, use a window manager like fluxbox. == Post installation preparation == After the installation is done, you need to replace the kernel uzImage.bin with a new one, this time with no initramfs_data.cpio.gz, and CONFIG_CMDLINE= changed for bootin from partition 2. <pre> CONFIG_CMDLINE=" mem=460M root=/dev/mmcblk0p2 rootwait nonitrd ro console=tty0" CONFIG_CMDLINE_FORCE=y </pre> For this, download uzImage.bin from here, and copy over to the first partition ( bootable vfat one ). Once that is done reboot the machine once again, to get Slackware going! === Procedure used for preparing the Slackware boot kernel === Please refer to the link [[config.slackboot.vga]] for the config file which was used. <pre> export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackboot.vga $OBJ/.config rm $KERNEL_SRC/usr/initramfs_data.cpio.g make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb > $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n "My Linux" -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin </pre> Once Slackware is installed, and the new uzImage.bin is copied over sdc1: /uzImage.bin /initrd-kirkwood.cpio => not required anymore sdc2: /bin /boot /cdrom /dev/ /etc/ /home/ /proc/ /slackware14.1 => not required anymore /usr/ /var/ You may remove files which are not required anymore, and free up some space. Once that is done, reboot apc-8750. == links == http://apc.io/products/8750a/ http://apc.io/library/ https://github.com/linux-wmt/linux-vtwm http://arm.slackware.com/getslack/ http://ftp.arm.slackware.com/slackwarearm/ f3ed39fe0e1e7b16a2c98b1f804aa82f4ab73934 913 912 2014-08-03T18:21:24Z Gv 356 /* links */ wikitext text/x-wiki == Installing Slackware on apc-8750 == Mainline linux kernel lacks support for Wondermedia 8750 currently. However linux-vtwm kernel available at github has support for Wondermedia 8750 SOC. Since the kernel failed to load initrd cpio archive the normal way, a special method was used for loading the setup image. * Create three partitions, first bootable vfat, second reiserfs and third Linux swap. * Download and copy uzImage.bin and initrd-kirkwood.cpio to first vfat partition * Download and copy Slackware installation files over to second partition * Boot from the micro sd card prepared, install, and configure Slackware * Download and replace the boot kernel with new uzImage.bin for booting from second partition. == Creating a bootable micro sd card == For this you need a custom built kernel and a initramfs image from Slackware for arm distribution - uinitrd-kirkwood.img * uzImage.bin [[Detailed description of how uzImage.bin was prepared.]] * initrd-kirkwood.cpio [[Detailed description of how initrd-kirkwood.cpio was prepared.]] Download and keep these files ready === Preparing the micro sd card === You need at least three partitions, one vfat, one or more Linux partitions, and a Linux swap partition for this method of installation. Here is how the partitions I used look like under fdisk ran on host. <pre> Disk /dev/sdc: 15.9 GB, 15931539456 bytes 64 heads, 32 sectors/track, 15193 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdc1 * 2048 206847 102400 c W95 FAT32 (LBA) /dev/sdc2 206848 28878847 14336000 83 Linux /dev/sdc3 28878848 31116287 1118720 82 Linux swap </pre> Creating filesystem: * 1st partition: make it bootable, and create a file system using mkfs.vfat * 2nd partition: create a reiserfs ( or other ) file system using mkreiserfs ==== Detailed description of how Slackware install kernel was prepared. ==== I used linux-vtwm-testing available at https://github.com/linux-wmt/linux-vtwm Zipfile you download from the site may cause problem when extracting - few files may be missing!. One option is to use p7zip or other unzip program instead of the default zip utility in Slackware. You may also get a tar.gz file using <pre> wget --no-check-certificate \ https://github.com/linux-wmt/linux-vtwm/archive/testing.tar.gz </pre> Please refer to the link [[config.slackinstall.vga]] for the config file which was used. This method also require a small initramfs image prepared from the boot media available at apc.io library. download it from here : [[initramfs_data.cpio.gz]] or use the following init scrip with the initrd.gz from apc.io library. init: <pre> #!/bin/busybox sh /bin/busybox mount -t proc /proc /bin/busybox mount -t sys /sys /bin/busybox echo /sbin/mdev > /proc/sys/kernel/hotplug /bin/busybox mdev -s /bin/busybox --install mkfs.ext2 /dev/ram0 mkdir /root mount /dev/ram0 /root cd /root mkdir /flash mount /dev/mmcblk0p1 /flash cpio -id < /flash/initrd-kirkwood.cpio exec chroot /root /bin/busybox init exec /bin/busybox init </pre> Copy the initramfs_data.cpio.gz for to $KERNEL_SRC/usr area. ===== Details of how initramfs_data.cpio.gz was prepared. ===== <pre> gunzip initrd.gz mkdir initramfs_data mount -o loop initrd initramfs_data create initramfs_data/init as shown above chmod a+x initramfs_data/init sync (cd initramfs_data ; find . | cpio -o -H newc | gzip > ../initramfs_data.cpio.gz ) </pre> Please note that the kernel uses a CONFIG_CMDLINE= for vga: <pre> CONFIG_CMDLINE=" mem=440M console=tty0 mbtotal=52M" CONFIG_CMDLINE_FORCE=y </pre> for serial: <pre> CONFIG_CMDLINE=" mem=440M console=ttyWMT0,115200n8 mbtotal=52M" CONFIG_CMDLINE_FORCE=y </pre> kernel is compiled on the host, using arm-2014.05 from arm. kernel build procedure: <pre> export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackinst.vga $OBJ/.config cp initramfs_data.cpio.gz $KERNEL_SRC/usr make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb > $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n "My Linux" -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin </pre> Preparing the cpio archive: <pre> download http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.1/isolinux/uinitrd-kirkwood.img dd if=./uinitrd-kirkwood.img bs=64 skip=1 of=initrd-kirkwood.cpio.gz gunzip initrd-kirkwood.cpio.gz </pre> == Copying Slackware install files onto second partition == Create a slackware14.1 directory in the reiserfs partition of the micro sd card. Copy Slackware for arm distribution to the slackware14.1 directory, from http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.1/ sdc1: /uzImage.bin /initrd-kirkwood.cpio sdc2: /slackware14.1/ == Booting with the installer and installing Slackware == Now you are ready to boot the from the new disk just prepared, and install Slackware from the pre mounted directory under /mnt/slackware14.1/slackware ( which is automounted as the selection for target is done ). Put the newly prepared micro sd card in the slot and reboot apc-8750. Once you get the Slackware login prompt, proceed as usual. === Configuration === For X Windows, use a window manager like fluxbox. == Post installation preparation == After the installation is done, you need to replace the kernel uzImage.bin with a new one, this time with no initramfs_data.cpio.gz, and CONFIG_CMDLINE= changed for bootin from partition 2. <pre> CONFIG_CMDLINE=" mem=460M root=/dev/mmcblk0p2 rootwait nonitrd ro console=tty0" CONFIG_CMDLINE_FORCE=y </pre> For this, download uzImage.bin from here, and copy over to the first partition ( bootable vfat one ). Once that is done reboot the machine once again, to get Slackware going! === Procedure used for preparing the Slackware boot kernel === Please refer to the link [[config.slackboot.vga]] for the config file which was used. <pre> export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackboot.vga $OBJ/.config rm $KERNEL_SRC/usr/initramfs_data.cpio.g make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb > $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n "My Linux" -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin </pre> Once Slackware is installed, and the new uzImage.bin is copied over sdc1: /uzImage.bin /initrd-kirkwood.cpio => not required anymore sdc2: /bin /boot /cdrom /dev/ /etc/ /home/ /proc/ /slackware14.1 => not required anymore /usr/ /var/ You may remove files which are not required anymore, and free up some space. Once that is done, reboot apc-8750. == links == http://apc.io/products/8750a/ http://apc.io/library/ https://github.com/linux-wmt/linux-vtwm http://arm.slackware.com/getslack/ http://ftp.arm.slackware.com/slackwarearm/ https://github.com/gv1/apc8750 937cc3530a0c1c662ce74ba220b36aabeaf305d3 914 913 2014-08-04T03:11:36Z Gv 356 /* links */ wikitext text/x-wiki == Installing Slackware on apc-8750 == Mainline linux kernel lacks support for Wondermedia 8750 currently. However linux-vtwm kernel available at github has support for Wondermedia 8750 SOC. Since the kernel failed to load initrd cpio archive the normal way, a special method was used for loading the setup image. * Create three partitions, first bootable vfat, second reiserfs and third Linux swap. * Download and copy uzImage.bin and initrd-kirkwood.cpio to first vfat partition * Download and copy Slackware installation files over to second partition * Boot from the micro sd card prepared, install, and configure Slackware * Download and replace the boot kernel with new uzImage.bin for booting from second partition. == Creating a bootable micro sd card == For this you need a custom built kernel and a initramfs image from Slackware for arm distribution - uinitrd-kirkwood.img * uzImage.bin [[Detailed description of how uzImage.bin was prepared.]] * initrd-kirkwood.cpio [[Detailed description of how initrd-kirkwood.cpio was prepared.]] Download and keep these files ready === Preparing the micro sd card === You need at least three partitions, one vfat, one or more Linux partitions, and a Linux swap partition for this method of installation. Here is how the partitions I used look like under fdisk ran on host. <pre> Disk /dev/sdc: 15.9 GB, 15931539456 bytes 64 heads, 32 sectors/track, 15193 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdc1 * 2048 206847 102400 c W95 FAT32 (LBA) /dev/sdc2 206848 28878847 14336000 83 Linux /dev/sdc3 28878848 31116287 1118720 82 Linux swap </pre> Creating filesystem: * 1st partition: make it bootable, and create a file system using mkfs.vfat * 2nd partition: create a reiserfs ( or other ) file system using mkreiserfs ==== Detailed description of how Slackware install kernel was prepared. ==== I used linux-vtwm-testing available at https://github.com/linux-wmt/linux-vtwm Zipfile you download from the site may cause problem when extracting - few files may be missing!. One option is to use p7zip or other unzip program instead of the default zip utility in Slackware. You may also get a tar.gz file using <pre> wget --no-check-certificate \ https://github.com/linux-wmt/linux-vtwm/archive/testing.tar.gz </pre> Please refer to the link [[config.slackinstall.vga]] for the config file which was used. This method also require a small initramfs image prepared from the boot media available at apc.io library. download it from here : [[initramfs_data.cpio.gz]] or use the following init scrip with the initrd.gz from apc.io library. init: <pre> #!/bin/busybox sh /bin/busybox mount -t proc /proc /bin/busybox mount -t sys /sys /bin/busybox echo /sbin/mdev > /proc/sys/kernel/hotplug /bin/busybox mdev -s /bin/busybox --install mkfs.ext2 /dev/ram0 mkdir /root mount /dev/ram0 /root cd /root mkdir /flash mount /dev/mmcblk0p1 /flash cpio -id < /flash/initrd-kirkwood.cpio exec chroot /root /bin/busybox init exec /bin/busybox init </pre> Copy the initramfs_data.cpio.gz for to $KERNEL_SRC/usr area. ===== Details of how initramfs_data.cpio.gz was prepared. ===== <pre> gunzip initrd.gz mkdir initramfs_data mount -o loop initrd initramfs_data create initramfs_data/init as shown above chmod a+x initramfs_data/init sync (cd initramfs_data ; find . | cpio -o -H newc | gzip > ../initramfs_data.cpio.gz ) </pre> Please note that the kernel uses a CONFIG_CMDLINE= for vga: <pre> CONFIG_CMDLINE=" mem=440M console=tty0 mbtotal=52M" CONFIG_CMDLINE_FORCE=y </pre> for serial: <pre> CONFIG_CMDLINE=" mem=440M console=ttyWMT0,115200n8 mbtotal=52M" CONFIG_CMDLINE_FORCE=y </pre> kernel is compiled on the host, using arm-2014.05 from arm. kernel build procedure: <pre> export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackinst.vga $OBJ/.config cp initramfs_data.cpio.gz $KERNEL_SRC/usr make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb > $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n "My Linux" -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin </pre> Preparing the cpio archive: <pre> download http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.1/isolinux/uinitrd-kirkwood.img dd if=./uinitrd-kirkwood.img bs=64 skip=1 of=initrd-kirkwood.cpio.gz gunzip initrd-kirkwood.cpio.gz </pre> == Copying Slackware install files onto second partition == Create a slackware14.1 directory in the reiserfs partition of the micro sd card. Copy Slackware for arm distribution to the slackware14.1 directory, from http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.1/ sdc1: /uzImage.bin /initrd-kirkwood.cpio sdc2: /slackware14.1/ == Booting with the installer and installing Slackware == Now you are ready to boot the from the new disk just prepared, and install Slackware from the pre mounted directory under /mnt/slackware14.1/slackware ( which is automounted as the selection for target is done ). Put the newly prepared micro sd card in the slot and reboot apc-8750. Once you get the Slackware login prompt, proceed as usual. === Configuration === For X Windows, use a window manager like fluxbox. == Post installation preparation == After the installation is done, you need to replace the kernel uzImage.bin with a new one, this time with no initramfs_data.cpio.gz, and CONFIG_CMDLINE= changed for bootin from partition 2. <pre> CONFIG_CMDLINE=" mem=460M root=/dev/mmcblk0p2 rootwait nonitrd ro console=tty0" CONFIG_CMDLINE_FORCE=y </pre> For this, download uzImage.bin from here, and copy over to the first partition ( bootable vfat one ). Once that is done reboot the machine once again, to get Slackware going! === Procedure used for preparing the Slackware boot kernel === Please refer to the link [[config.slackboot.vga]] for the config file which was used. <pre> export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackboot.vga $OBJ/.config rm $KERNEL_SRC/usr/initramfs_data.cpio.g make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb > $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n "My Linux" -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin </pre> Once Slackware is installed, and the new uzImage.bin is copied over sdc1: /uzImage.bin /initrd-kirkwood.cpio => not required anymore sdc2: /bin /boot /cdrom /dev/ /etc/ /home/ /proc/ /slackware14.1 => not required anymore /usr/ /var/ You may remove files which are not required anymore, and free up some space. Once that is done, reboot apc-8750. == links == http://apc.io/products/8750a/ http://apc.io/library/ https://github.com/linux-wmt/linux-vtwm http://arm.slackware.com/getslack/ http://ftp.arm.slackware.com/slackwarearm/ http://sourceforge.net/projects/slackwareonapc8750/files/ http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download http://sourceforge.net/projects/slackwareonapc8750/files/install/vga/uzImage.bin/download http://sourceforge.net/projects/slackwareonapc8750/files/boot/vga/uzImage.bin/download http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackinst.vga/download http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackboot.vga/download http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackinst.ttyWMT0/download http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackboot.ttyWMT0/download http://sourceforge.net/projects/slackwareonapc8750/files/initramfs_data.cpio.gz/download 19882d6ff78bd1ae8c1d05903b2ab99debced7f5 915 914 2014-08-07T07:37:54Z Gv 356 wikitext text/x-wiki == Installing Slackware on APC-8750 == [[Image:http://apc.io/media/apc/img/apc-products-8750.jpg|APC 8750]]<br />[http://apc.io/media/apc/img/apc-angle.jpg Another photograph of APC 8750] [https://sourceforge.net/p/slackwareonapc8750 Project Area] Mainline Linux kernel lacks support for [http://www.wondermedia.com.tw/en/products/platform/soc/wm8750/ Wondermedia WM 8750] currently. However [https://github.com/linux-wmt/linux-vtwm linux-vtwm-testing] kernel available at github has support for Wondermedia 8750 SOC. Since the kernel failed to load initrd cpio archive the normal way, a special method was used for loading the Slackware setup image. ( Installer Kernel booting from embedded initramfs image creates a filesystem on ramdisk, extracts Slackware setup initrd image and chroots to the filesystem on ramdisk ). Briefly, the steps followed in installing Slackware on APC 8750 are : # '''Installing Slackware.''' ## Prepare boot media: Create three partitions, first bootable vfat, second reiserfs and third Linux swap. ## Copy installer boot files: Download and copy uzImage.bin and initrd-kirkwood.cpio to first vfat partition. ## Download and copy Slackware installation files over to second partition. ## Boot from the micro sd card prepared, install, and configure Slackware. # '''Making new installtion bootable.''' ## Download and replace the installer kernel with new uzImage.bin for booting from second partition. ## Reboot. === Creating a bootable micro sd card for installation === For this you need a custom built kernel and a initramfs image from Slackware for arm distribution - [http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.1/isolinux/uinitrd-kirkwood.img uinitrd-kirkwood.img]. * [http://sourceforge.net/projects/slackwareonapc8750/files/install/vga/uzImage.bin/download uzImage.bin] for console on VGA monitor.<br />If this kernel is chosen boot messages will appear on VGA monitor. or * [http://sourceforge.net/projects/slackwareonapc8750/files/install/ttyWMT0/uzImage.bin/download uzImage.bin] for console on serial port.<br />If this kernel is chosen boot messages will appear on the serial port. * [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio.gz] initramfs cpio archive.<br />Download and gunzip this image file. * Download [http://arm.slackware.com/getslack/ Slackware 14.1 for arm].<br />If you prefer, you may download this to micro sd card directly, under slackware14.1 directory. Download and keep these ready. ==== Preparing the micro sd card. ==== You need at least three partitions, one vfat, one or more Linux partitions, and a Linux swap partition for this method of installation. Here is how the partitions I used look like under fdisk ran on host. <pre> Disk /dev/sdc: 15.9 GB, 15931539456 bytes 64 heads, 32 sectors/track, 15193 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdc1 * 2048 206847 102400 c W95 FAT32 (LBA) /dev/sdc2 206848 28878847 14336000 83 Linux /dev/sdc3 28878848 31116287 1118720 82 Linux swap </pre> ==== Creating filesystems. ==== * 1st partition - make it bootable, and create a file system using mkfs.vfat * 2nd partition - create a reiserfs file system using mkreiserfs ( or other tools for other types ) ==== Copying Slackware install files onto second partition. ==== Create a slackware14.1 directory in the reiserfs partition of the micro sd card. Copy Slackware for arm distribution to the slackware14.1 directory, from http://arm.slackware.com/getslack/. Once the preparation is over, <pre>sdc1: /uzImage.bin /initrd-kirkwood.cpio sdc2: /slackware14.1/</pre> ==== Booting with the installer and installing Slackware. ==== Now you are ready to boot from the new disk just prepared, and install Slackware from the pre mounted directory under /mnt/slackware14.1/slackware ( which is automounted as the selection for target is done ). Put the newly prepared micro sd card in the slot and reboot APC-8750. Once you get the Slackware login prompt, proceed for installation as usual. ==== Configuration ==== For X Windows, use a lightweight window manager like Fluxbox. === Post installation preparation. === After the installation is done, you need to replace the kernel uzImage.bin with a new one, this time with no initramfs_data.cpio.gz, and CONFIG_CMDLINE= changed for booting from partition 2: <pre>CONFIG_CMDLINE=&quot; mem=460M root=/dev/mmcblk0p2 rootwait nonitrd ro console=tty0&quot; CONFIG_CMDLINE_FORCE=y</pre> For this, download one of * [http://sourceforge.net/projects/slackwareonapc8750/files/boot/vga/uzImage.bin/download uzImage.bin] for console on VGA. Or * [http://sourceforge.net/projects/slackwareonapc8750/files/boot/ttyWMT0/uzImage.bin/download uzImage.bin] for console on serial port. and copy over to the first partition ( bootable vfat one ). Once Slackware is installed, and the new uzImage.bin is copied over, <pre>sdc1: /uzImage.bin /initrd-kirkwood.cpio =&gt; not required anymore sdc2: /bin /boot /cdrom /dev/ /etc/ /home/ /proc/ /slackware14.1 =&gt; not required anymore /usr/ /var/</pre> You may remove files which are not required anymore, and free up some space. Once that is done, reboot APC-8750 to get Slackware up and running. === Information on building kernel and other images. === Please also refer to [http://sourceforge.net/projects/slackwareonapc8750/files/build.sh/download build.sh] script used to help the build procedure. ==== Detailed description of how Slackware install kernel was prepared. ==== ===== Getting the Kernel source code. ===== I used [https://github.com/linux-wmt/linux-vtwm linux-vtwm-testing]. Zipfile you download from the site may cause problem when extracting on Linux. In my case couple of files were missing. One option is to use p7zip or other unzip program instead of the default zip utility in Slackware. You may also get a tar.gz file using: <pre>wget --no-check-certificate \ https://github.com/linux-wmt/linux-vtwm/archive/testing.tar.gz</pre> Please refer to the link [http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackinst.vga/download config.slackinst.vga] or [http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackinst.ttyWMT0/download config.slackinst.ttyWMT0] for the config file which was used. ===== Details of how initramfs_data.cpio.gz was prepared. ===== This method also require a small initramfs image prepared from the boot media available at [http://apc.io/library/ apc.io library]. Download it from here [http://sourceforge.net/projects/slackwareonapc8750/files/initramfs_data.cpio.gz/download initramfs_data.cpio.gz]<br />or<br />Use the following init scrip with a stripped down version of initrd.gz in [http://apc.io/media/apc/library/8750/apc-firmware-v1.0.2.zip apc-firmware-v1.0.2] from [http://apc.io/library/ apc.io library]. init: <pre>#!/bin/busybox sh /bin/busybox mount -t proc /proc /bin/busybox mount -t sys /sys /bin/busybox echo /sbin/mdev &gt; /proc/sys/kernel/hotplug /bin/busybox mdev -s /bin/busybox --install mkfs.ext2 /dev/ram0 mkdir /root mount /dev/ram0 /root cd /root mkdir /flash mount /dev/mmcblk0p1 /flash cpio -id &lt; /flash/initrd-kirkwood.cpio umount /flash exec chroot /root /bin/busybox init exec /bin/busybox init</pre> Commands to build initramfs_data.cpio.gz: <pre>gunzip initrd.gz mkdir initramfs_data mount -o loop initrd initramfs_data # create initramfs_data/init as shown above sh build.sh init chmod a+x initramfs_data/init sync (cd initramfs_data ; find . | cpio -o -H newc | gzip &gt; ../initramfs_data.cpio.gz )</pre> Copy [http://sourceforge.net/projects/slackwareonapc8750/files/initramfs_data.cpio.gz/download initramfs_data.cpio.gz] cpio archive to $KERNEL_SRC/usr area. Please note that the kernel uses a CONFIG_CMDLINE= for VGA: <pre>CONFIG_CMDLINE=&quot; mem=440M console=tty0 mbtotal=52M&quot; CONFIG_CMDLINE_FORCE=y</pre> for serial: <pre>CONFIG_CMDLINE=&quot; mem=440M console=ttyWMT0,115200n8 mbtotal=52M&quot; CONFIG_CMDLINE_FORCE=y</pre> kernel is compiled on the host, using a cross compiler [http://www.elinux.org/ARMCompilers Sourcery CodeBench Lite 2014.05-28] for [http://www.arm.com/ arm]. For mkimage tool refer to [http://github.com/apc-io/apc-8750 Kernel and Bootloader] link at apc-io page at github. ===== kernel build procedure: ===== <pre>export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackinst.vga $OBJ/.config cp initramfs_data.cpio.gz $KERNEL_SRC/usr make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb &gt; $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n &quot;My Linux&quot; -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin</pre> ===== Preparing the cpio archive: ===== <pre>wget -c http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.1/isolinux/uinitrd-kirkwood.img dd if=./uinitrd-kirkwood.img bs=64 skip=1 of=initrd-kirkwood.cpio.gz gunzip initrd-kirkwood.cpio.gz </pre> ==== Procedure used for preparing the Slackware boot kernel. ==== Please refer to the link [http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackboot.vga/download config.slackboot.vga] or [http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackboot.ttyWMT0/download config.slackboot.ttyWMT0] for the config file which was used. Download and copy this file as .config in $OBJ area before starting the build ===== Kernel build procedure: ===== <pre>export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackboot.vga $OBJ/.config rm $KERNEL_SRC/usr/initramfs_data.cpio.g make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb &gt; $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n &quot;My Linux&quot; -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin</pre> === Additional info === From original boot messages on ttyS0: <pre>Kernel command line: mem=460M root=/dev/mtdblock11 noinitrd rootfstype=yaffs2 rw console=ttyS0,115200n8 mbtotal=52M init=/init Linux version 2.6.32.9-default (root@Ryan-VM-Ubuntu) (gcc version 4.5.2 (Sourcery G++ Lite 2011.03-41) ) #1 Wed Dec 5 19:29:52 CST 2012 CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387f ... Memory: 460MB = 460MB total Memory: 460288KB available (5188K code, 1069K data, 136K init, 0K highmem) ... Creating 6 MTD partitions on &quot;mtdsf device&quot;: 0x000000000000-0x000000d00000 : &quot;filesystem-SF&quot; 0x000000d00000-0x000000f80000 : &quot;kernel-SF&quot; 0x000000f80000-0x000000fd0000 : &quot;u-boot-SF&quot; 0x000000fd0000-0x000000fe0000 : &quot;u-boot env. cfg. 1-SF&quot; 0x000000fe0000-0x000000ff0000 : &quot;u-boot env. cfg. 2-SF&quot; 0x000000ff0000-0x000001000000 : &quot;w-load-SF&quot; wmt sf controller initial ok ... NAND device: Manufacturer ID: 0xec, Chip ID: 0xd59476 (Samsung K9GAG08U0F) Bad block at 16 Bad block at 17 Bad block at 89 Bad block at 613 Bad block at 880 Bad block at 1583 WMT_nand: uboot no dynamic partitions defined, use default static Creating 11 MTD partitions on &quot;WMT.nand&quot;: 0x000000000000-0x000000100000 : &quot;w-load-NAND&quot; 0x000000100000-0x000000a00000 : &quot;u-boot env. cfg. 1-NAND&quot; 0x000000a00000-0x000001300000 : &quot;u-boot-NAND&quot; 0x000001300000-0x000001b00000 : &quot;kernel-NAND&quot; 0x000001b00000-0x000002100000 : &quot;initrd-NAND&quot; 0x000002100000-0x000012100000 : &quot;filesystem-NAND&quot; 0x000012100000-0x000012300000 : &quot;u-boot-logo&quot; 0x000012300000-0x000012700000 : &quot;kernel-logo&quot; 0x000012700000-0x000052700000 : &quot;android-data&quot; 0x000052700000-0x00005a700000 : &quot;android-cache&quot; 0x00005a700000-0x000080000000 : &quot;LocalDisk&quot; nand initialised ok ... VIA Networking Velocity Family Gigabit Ethernet Adapter Driver Ver. 1.14 ... eth0: VIA Networking Velocity Family Gigabit Ethernet Adapter ... WMT_SOC: dai_name=i2s, codec_name=vt1603 WMT_SOC: single, wmt_i2s_rate=44100 ... VT1603 Audio Codec 0.10 wmt.audio.i2s = vt1603:f2:f2:f1:f1:100 ...</pre> 2ad267fc298d79c035dbb51dd0bd1a241b368629 916 915 2014-08-07T08:22:11Z Gv 356 /* Additional info */ wikitext text/x-wiki == Installing Slackware on APC-8750 == [[Image:http://apc.io/media/apc/img/apc-products-8750.jpg|APC 8750]]<br />[http://apc.io/media/apc/img/apc-angle.jpg Another photograph of APC 8750] [https://sourceforge.net/p/slackwareonapc8750 Project Area] Mainline Linux kernel lacks support for [http://www.wondermedia.com.tw/en/products/platform/soc/wm8750/ Wondermedia WM 8750] currently. However [https://github.com/linux-wmt/linux-vtwm linux-vtwm-testing] kernel available at github has support for Wondermedia 8750 SOC. Since the kernel failed to load initrd cpio archive the normal way, a special method was used for loading the Slackware setup image. ( Installer Kernel booting from embedded initramfs image creates a filesystem on ramdisk, extracts Slackware setup initrd image and chroots to the filesystem on ramdisk ). Briefly, the steps followed in installing Slackware on APC 8750 are : # '''Installing Slackware.''' ## Prepare boot media: Create three partitions, first bootable vfat, second reiserfs and third Linux swap. ## Copy installer boot files: Download and copy uzImage.bin and initrd-kirkwood.cpio to first vfat partition. ## Download and copy Slackware installation files over to second partition. ## Boot from the micro sd card prepared, install, and configure Slackware. # '''Making new installtion bootable.''' ## Download and replace the installer kernel with new uzImage.bin for booting from second partition. ## Reboot. === Creating a bootable micro sd card for installation === For this you need a custom built kernel and a initramfs image from Slackware for arm distribution - [http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.1/isolinux/uinitrd-kirkwood.img uinitrd-kirkwood.img]. * [http://sourceforge.net/projects/slackwareonapc8750/files/install/vga/uzImage.bin/download uzImage.bin] for console on VGA monitor.<br />If this kernel is chosen boot messages will appear on VGA monitor. or * [http://sourceforge.net/projects/slackwareonapc8750/files/install/ttyWMT0/uzImage.bin/download uzImage.bin] for console on serial port.<br />If this kernel is chosen boot messages will appear on the serial port. * [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio.gz] initramfs cpio archive.<br />Download and gunzip this image file. * Download [http://arm.slackware.com/getslack/ Slackware 14.1 for arm].<br />If you prefer, you may download this to micro sd card directly, under slackware14.1 directory. Download and keep these ready. ==== Preparing the micro sd card. ==== You need at least three partitions, one vfat, one or more Linux partitions, and a Linux swap partition for this method of installation. Here is how the partitions I used look like under fdisk ran on host. <pre> Disk /dev/sdc: 15.9 GB, 15931539456 bytes 64 heads, 32 sectors/track, 15193 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdc1 * 2048 206847 102400 c W95 FAT32 (LBA) /dev/sdc2 206848 28878847 14336000 83 Linux /dev/sdc3 28878848 31116287 1118720 82 Linux swap </pre> ==== Creating filesystems. ==== * 1st partition - make it bootable, and create a file system using mkfs.vfat * 2nd partition - create a reiserfs file system using mkreiserfs ( or other tools for other types ) ==== Copying Slackware install files onto second partition. ==== Create a slackware14.1 directory in the reiserfs partition of the micro sd card. Copy Slackware for arm distribution to the slackware14.1 directory, from http://arm.slackware.com/getslack/. Once the preparation is over, <pre>sdc1: /uzImage.bin /initrd-kirkwood.cpio sdc2: /slackware14.1/</pre> ==== Booting with the installer and installing Slackware. ==== Now you are ready to boot from the new disk just prepared, and install Slackware from the pre mounted directory under /mnt/slackware14.1/slackware ( which is automounted as the selection for target is done ). Put the newly prepared micro sd card in the slot and reboot APC-8750. Once you get the Slackware login prompt, proceed for installation as usual. ==== Configuration ==== For X Windows, use a lightweight window manager like Fluxbox. === Post installation preparation. === After the installation is done, you need to replace the kernel uzImage.bin with a new one, this time with no initramfs_data.cpio.gz, and CONFIG_CMDLINE= changed for booting from partition 2: <pre>CONFIG_CMDLINE=&quot; mem=460M root=/dev/mmcblk0p2 rootwait nonitrd ro console=tty0&quot; CONFIG_CMDLINE_FORCE=y</pre> For this, download one of * [http://sourceforge.net/projects/slackwareonapc8750/files/boot/vga/uzImage.bin/download uzImage.bin] for console on VGA. Or * [http://sourceforge.net/projects/slackwareonapc8750/files/boot/ttyWMT0/uzImage.bin/download uzImage.bin] for console on serial port. and copy over to the first partition ( bootable vfat one ). Once Slackware is installed, and the new uzImage.bin is copied over, <pre>sdc1: /uzImage.bin /initrd-kirkwood.cpio =&gt; not required anymore sdc2: /bin /boot /cdrom /dev/ /etc/ /home/ /proc/ /slackware14.1 =&gt; not required anymore /usr/ /var/</pre> You may remove files which are not required anymore, and free up some space. Once that is done, reboot APC-8750 to get Slackware up and running. === Information on building kernel and other images. === Please also refer to [http://sourceforge.net/projects/slackwareonapc8750/files/build.sh/download build.sh] script used to help the build procedure. ==== Detailed description of how Slackware install kernel was prepared. ==== ===== Getting the Kernel source code. ===== I used [https://github.com/linux-wmt/linux-vtwm linux-vtwm-testing]. Zipfile you download from the site may cause problem when extracting on Linux. In my case couple of files were missing. One option is to use p7zip or other unzip program instead of the default zip utility in Slackware. You may also get a tar.gz file using: <pre>wget --no-check-certificate \ https://github.com/linux-wmt/linux-vtwm/archive/testing.tar.gz</pre> Please refer to the link [http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackinst.vga/download config.slackinst.vga] or [http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackinst.ttyWMT0/download config.slackinst.ttyWMT0] for the config file which was used. ===== Details of how initramfs_data.cpio.gz was prepared. ===== This method also require a small initramfs image prepared from the boot media available at [http://apc.io/library/ apc.io library]. Download it from here [http://sourceforge.net/projects/slackwareonapc8750/files/initramfs_data.cpio.gz/download initramfs_data.cpio.gz]<br />or<br />Use the following init scrip with a stripped down version of initrd.gz in [http://apc.io/media/apc/library/8750/apc-firmware-v1.0.2.zip apc-firmware-v1.0.2] from [http://apc.io/library/ apc.io library]. init: <pre>#!/bin/busybox sh /bin/busybox mount -t proc /proc /bin/busybox mount -t sys /sys /bin/busybox echo /sbin/mdev &gt; /proc/sys/kernel/hotplug /bin/busybox mdev -s /bin/busybox --install mkfs.ext2 /dev/ram0 mkdir /root mount /dev/ram0 /root cd /root mkdir /flash mount /dev/mmcblk0p1 /flash cpio -id &lt; /flash/initrd-kirkwood.cpio umount /flash exec chroot /root /bin/busybox init exec /bin/busybox init</pre> Commands to build initramfs_data.cpio.gz: <pre>gunzip initrd.gz mkdir initramfs_data mount -o loop initrd initramfs_data # create initramfs_data/init as shown above sh build.sh init chmod a+x initramfs_data/init sync (cd initramfs_data ; find . | cpio -o -H newc | gzip &gt; ../initramfs_data.cpio.gz )</pre> Copy [http://sourceforge.net/projects/slackwareonapc8750/files/initramfs_data.cpio.gz/download initramfs_data.cpio.gz] cpio archive to $KERNEL_SRC/usr area. Please note that the kernel uses a CONFIG_CMDLINE= for VGA: <pre>CONFIG_CMDLINE=&quot; mem=440M console=tty0 mbtotal=52M&quot; CONFIG_CMDLINE_FORCE=y</pre> for serial: <pre>CONFIG_CMDLINE=&quot; mem=440M console=ttyWMT0,115200n8 mbtotal=52M&quot; CONFIG_CMDLINE_FORCE=y</pre> kernel is compiled on the host, using a cross compiler [http://www.elinux.org/ARMCompilers Sourcery CodeBench Lite 2014.05-28] for [http://www.arm.com/ arm]. For mkimage tool refer to [http://github.com/apc-io/apc-8750 Kernel and Bootloader] link at apc-io page at github. ===== kernel build procedure: ===== <pre>export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackinst.vga $OBJ/.config cp initramfs_data.cpio.gz $KERNEL_SRC/usr make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb &gt; $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n &quot;My Linux&quot; -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin</pre> ===== Preparing the cpio archive: ===== <pre>wget -c http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.1/isolinux/uinitrd-kirkwood.img dd if=./uinitrd-kirkwood.img bs=64 skip=1 of=initrd-kirkwood.cpio.gz gunzip initrd-kirkwood.cpio.gz </pre> ==== Procedure used for preparing the Slackware boot kernel. ==== Please refer to the link [http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackboot.vga/download config.slackboot.vga] or [http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackboot.ttyWMT0/download config.slackboot.ttyWMT0] for the config file which was used. Download and copy this file as .config in $OBJ area before starting the build ===== Kernel build procedure: ===== <pre>export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackboot.vga $OBJ/.config rm $KERNEL_SRC/usr/initramfs_data.cpio.g make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb &gt; $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n &quot;My Linux&quot; -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin</pre> === Additional info === From Slackware-14.1 boot messages: <pre>Linux version 3.13.0-rc8 (ahoh@tampa) (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-28) ) #23 Mon Aug 4 07 :40:48 IST 2014 Kernel command line: mem=460M root=/dev/mmcblk0p2 rootwait nonitrd ro console=tty0</pre> From original boot messages on ttyS0: <pre>Linux version 2.6.32.9-default (root@Ryan-VM-Ubuntu) (gcc version 4.5.2 (Sourcery G++ Lite 2011.03-41) ) #1 Wed Dec 5 19:29:52 CST 2012 Kernel command line: mem=460M root=/dev/mtdblock11 noinitrd rootfstype=yaffs2 rw console=ttyS0,115200n8 mbtotal=52M init=/init CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387f ... Memory: 460MB = 460MB total Memory: 460288KB available (5188K code, 1069K data, 136K init, 0K highmem) ... Creating 6 MTD partitions on &quot;mtdsf device&quot;: 0x000000000000-0x000000d00000 : &quot;filesystem-SF&quot; 0x000000d00000-0x000000f80000 : &quot;kernel-SF&quot; 0x000000f80000-0x000000fd0000 : &quot;u-boot-SF&quot; 0x000000fd0000-0x000000fe0000 : &quot;u-boot env. cfg. 1-SF&quot; 0x000000fe0000-0x000000ff0000 : &quot;u-boot env. cfg. 2-SF&quot; 0x000000ff0000-0x000001000000 : &quot;w-load-SF&quot; wmt sf controller initial ok ... NAND device: Manufacturer ID: 0xec, Chip ID: 0xd59476 (Samsung K9GAG08U0F) Bad block at 16 Bad block at 17 Bad block at 89 Bad block at 613 Bad block at 880 Bad block at 1583 WMT_nand: uboot no dynamic partitions defined, use default static Creating 11 MTD partitions on &quot;WMT.nand&quot;: 0x000000000000-0x000000100000 : &quot;w-load-NAND&quot; 0x000000100000-0x000000a00000 : &quot;u-boot env. cfg. 1-NAND&quot; 0x000000a00000-0x000001300000 : &quot;u-boot-NAND&quot; 0x000001300000-0x000001b00000 : &quot;kernel-NAND&quot; 0x000001b00000-0x000002100000 : &quot;initrd-NAND&quot; 0x000002100000-0x000012100000 : &quot;filesystem-NAND&quot; 0x000012100000-0x000012300000 : &quot;u-boot-logo&quot; 0x000012300000-0x000012700000 : &quot;kernel-logo&quot; 0x000012700000-0x000052700000 : &quot;android-data&quot; 0x000052700000-0x00005a700000 : &quot;android-cache&quot; 0x00005a700000-0x000080000000 : &quot;LocalDisk&quot; nand initialised ok ... VIA Networking Velocity Family Gigabit Ethernet Adapter Driver Ver. 1.14 ... eth0: VIA Networking Velocity Family Gigabit Ethernet Adapter ... WMT_SOC: dai_name=i2s, codec_name=vt1603 WMT_SOC: single, wmt_i2s_rate=44100 ... VT1603 Audio Codec 0.10 wmt.audio.i2s = vt1603:f2:f2:f1:f1:100 ...</pre> f03e47d8e10203227e1b8155c90bb8a9918c41af 917 916 2014-08-09T06:33:30Z Gv 356 /* Installing Slackware on APC-8750 */ wikitext text/x-wiki == Installing Slackware on APC-8750 == [[Image:http://apc.io/media/apc/img/apc-products-8750.jpg|APC 8750]]<br />[http://apc.io/media/apc/img/apc-angle.jpg Another photograph of APC 8750] [https://sourceforge.net/p/slackwareonapc8750 Project Area] [http://sourceforge.net/p/slackwareonapc8750/wiki/Home/ wiki @ sourceforge] Check this for latest updates [http://sourceforge.net/p/slackwareonapc8750/code/ helper scripts] / [https://github.com/gv1/apc8750 helper scripts] Mainline Linux kernel lacks support for [http://www.wondermedia.com.tw/en/products/platform/soc/wm8750/ Wondermedia WM 8750] currently. However [https://github.com/linux-wmt/linux-vtwm linux-vtwm-testing] kernel available at github has support for Wondermedia 8750 SOC. Since the kernel failed to load initrd cpio archive the normal way, a special method was used for loading the Slackware setup image. ( Installer Kernel booting from embedded initramfs image creates a filesystem on ramdisk, extracts Slackware setup initrd image and chroots to the filesystem on ramdisk ). Briefly, the steps followed in installing Slackware on APC 8750 are : # '''Installing Slackware.''' ## Prepare boot media: Create three partitions, first bootable vfat, second reiserfs and third Linux swap. ## Copy installer boot files: Download and copy uzImage.bin and initrd-kirkwood.cpio to first vfat partition. ## Download and copy Slackware installation files over to second partition. ## Boot from the micro sd card prepared, install, and configure Slackware. # '''Making new installtion bootable.''' ## Download and replace the installer kernel with new uzImage.bin for booting from second partition. ## Reboot. === Creating a bootable micro sd card for installation === For this you need a custom built kernel and a initramfs image from Slackware for arm distribution - [http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.1/isolinux/uinitrd-kirkwood.img uinitrd-kirkwood.img]. * [http://sourceforge.net/projects/slackwareonapc8750/files/install/vga/uzImage.bin/download uzImage.bin] for console on VGA monitor.<br />If this kernel is chosen boot messages will appear on VGA monitor. or * [http://sourceforge.net/projects/slackwareonapc8750/files/install/ttyWMT0/uzImage.bin/download uzImage.bin] for console on serial port.<br />If this kernel is chosen boot messages will appear on the serial port. * [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio.gz] initramfs cpio archive.<br />Download and gunzip this image file. * Download [http://arm.slackware.com/getslack/ Slackware 14.1 for arm].<br />If you prefer, you may download this to micro sd card directly, under slackware14.1 directory. Download and keep these ready. ==== Preparing the micro sd card. ==== You need at least three partitions, one vfat, one or more Linux partitions, and a Linux swap partition for this method of installation. Here is how the partitions I used look like under fdisk ran on host. <pre> Disk /dev/sdc: 15.9 GB, 15931539456 bytes 64 heads, 32 sectors/track, 15193 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdc1 * 2048 206847 102400 c W95 FAT32 (LBA) /dev/sdc2 206848 28878847 14336000 83 Linux /dev/sdc3 28878848 31116287 1118720 82 Linux swap </pre> ==== Creating filesystems. ==== * 1st partition - make it bootable, and create a file system using mkfs.vfat * 2nd partition - create a reiserfs file system using mkreiserfs ( or other tools for other types ) ==== Copying Slackware install files onto second partition. ==== Create a slackware14.1 directory in the reiserfs partition of the micro sd card. Copy Slackware for arm distribution to the slackware14.1 directory, from http://arm.slackware.com/getslack/. Once the preparation is over, <pre>sdc1: /uzImage.bin /initrd-kirkwood.cpio sdc2: /slackware14.1/</pre> ==== Booting with the installer and installing Slackware. ==== Now you are ready to boot from the new disk just prepared, and install Slackware from the pre mounted directory under /mnt/slackware14.1/slackware ( which is automounted as the selection for target is done ). Put the newly prepared micro sd card in the slot and reboot APC-8750. Once you get the Slackware login prompt, proceed for installation as usual. ==== Configuration ==== For X Windows, use a lightweight window manager like Fluxbox. === Post installation preparation. === After the installation is done, you need to replace the kernel uzImage.bin with a new one, this time with no initramfs_data.cpio.gz, and CONFIG_CMDLINE= changed for booting from partition 2: <pre>CONFIG_CMDLINE=&quot; mem=460M root=/dev/mmcblk0p2 rootwait nonitrd ro console=tty0&quot; CONFIG_CMDLINE_FORCE=y</pre> For this, download one of * [http://sourceforge.net/projects/slackwareonapc8750/files/boot/vga/uzImage.bin/download uzImage.bin] for console on VGA. Or * [http://sourceforge.net/projects/slackwareonapc8750/files/boot/ttyWMT0/uzImage.bin/download uzImage.bin] for console on serial port. and copy over to the first partition ( bootable vfat one ). Once Slackware is installed, and the new uzImage.bin is copied over, <pre>sdc1: /uzImage.bin /initrd-kirkwood.cpio =&gt; not required anymore sdc2: /bin /boot /cdrom /dev/ /etc/ /home/ /proc/ /slackware14.1 =&gt; not required anymore /usr/ /var/</pre> You may remove files which are not required anymore, and free up some space. Once that is done, reboot APC-8750 to get Slackware up and running. === Information on building kernel and other images. === Please also refer to [http://sourceforge.net/projects/slackwareonapc8750/files/build.sh/download build.sh] script used to help the build procedure. ==== Detailed description of how Slackware install kernel was prepared. ==== ===== Getting the Kernel source code. ===== I used [https://github.com/linux-wmt/linux-vtwm linux-vtwm-testing]. Zipfile you download from the site may cause problem when extracting on Linux. In my case couple of files were missing. One option is to use p7zip or other unzip program instead of the default zip utility in Slackware. You may also get a tar.gz file using: <pre>wget --no-check-certificate \ https://github.com/linux-wmt/linux-vtwm/archive/testing.tar.gz</pre> Please refer to the link [http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackinst.vga/download config.slackinst.vga] or [http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackinst.ttyWMT0/download config.slackinst.ttyWMT0] for the config file which was used. ===== Details of how initramfs_data.cpio.gz was prepared. ===== This method also require a small initramfs image prepared from the boot media available at [http://apc.io/library/ apc.io library]. Download it from here [http://sourceforge.net/projects/slackwareonapc8750/files/initramfs_data.cpio.gz/download initramfs_data.cpio.gz]<br />or<br />Use the following init scrip with a stripped down version of initrd.gz in [http://apc.io/media/apc/library/8750/apc-firmware-v1.0.2.zip apc-firmware-v1.0.2] from [http://apc.io/library/ apc.io library]. init: <pre>#!/bin/busybox sh /bin/busybox mount -t proc /proc /bin/busybox mount -t sys /sys /bin/busybox echo /sbin/mdev &gt; /proc/sys/kernel/hotplug /bin/busybox mdev -s /bin/busybox --install mkfs.ext2 /dev/ram0 mkdir /root mount /dev/ram0 /root cd /root mkdir /flash mount /dev/mmcblk0p1 /flash cpio -id &lt; /flash/initrd-kirkwood.cpio umount /flash exec chroot /root /bin/busybox init exec /bin/busybox init</pre> Commands to build initramfs_data.cpio.gz: <pre>gunzip initrd.gz mkdir initramfs_data mount -o loop initrd initramfs_data # create initramfs_data/init as shown above sh build.sh init chmod a+x initramfs_data/init sync (cd initramfs_data ; find . | cpio -o -H newc | gzip &gt; ../initramfs_data.cpio.gz )</pre> Copy [http://sourceforge.net/projects/slackwareonapc8750/files/initramfs_data.cpio.gz/download initramfs_data.cpio.gz] cpio archive to $KERNEL_SRC/usr area. Please note that the kernel uses a CONFIG_CMDLINE= for VGA: <pre>CONFIG_CMDLINE=&quot; mem=440M console=tty0 mbtotal=52M&quot; CONFIG_CMDLINE_FORCE=y</pre> for serial: <pre>CONFIG_CMDLINE=&quot; mem=440M console=ttyWMT0,115200n8 mbtotal=52M&quot; CONFIG_CMDLINE_FORCE=y</pre> kernel is compiled on the host, using a cross compiler [http://www.elinux.org/ARMCompilers Sourcery CodeBench Lite 2014.05-28] for [http://www.arm.com/ arm]. For mkimage tool refer to [http://github.com/apc-io/apc-8750 Kernel and Bootloader] link at apc-io page at github. ===== kernel build procedure: ===== <pre>export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackinst.vga $OBJ/.config cp initramfs_data.cpio.gz $KERNEL_SRC/usr make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb &gt; $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n &quot;My Linux&quot; -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin</pre> ===== Preparing the cpio archive: ===== <pre>wget -c http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.1/isolinux/uinitrd-kirkwood.img dd if=./uinitrd-kirkwood.img bs=64 skip=1 of=initrd-kirkwood.cpio.gz gunzip initrd-kirkwood.cpio.gz </pre> ==== Procedure used for preparing the Slackware boot kernel. ==== Please refer to the link [http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackboot.vga/download config.slackboot.vga] or [http://sourceforge.net/projects/slackwareonapc8750/files/configs/config.slackboot.ttyWMT0/download config.slackboot.ttyWMT0] for the config file which was used. Download and copy this file as .config in $OBJ area before starting the build ===== Kernel build procedure: ===== <pre>export OBJ=/src/apc.io/obj.testing export KERNEL_SRC=/src/apc.io/linux-vtwm-testing export PATH=~/apc.io/apc-8750-master/u-boot/tools:$PATH export PATH=/opt/local/arm/arm-2014.05/bin:$PATH cp config.slackboot.vga $OBJ/.config rm $KERNEL_SRC/usr/initramfs_data.cpio.g make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage -j 3 mv $OBJ/arch/arm/boot/zImage $1/$2/ ; make -C $KERNEL_SRC O=$OBJ ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs cat $1/$2/zImage $OBJ/arch/arm/boot/dts/wm8750-apc8750.dtb &gt; $1/$2/zImage_w_dtb mkimage -A arm -O linux -T kernel -C none -a 0x8000 \ -e 0x8000 -n &quot;My Linux&quot; -d $1/$2/zImage_w_dtb $1/$2/uzImage.bin</pre> === Additional info === From Slackware-14.1 boot messages: <pre>Linux version 3.13.0-rc8 (ahoh@tampa) (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-28) ) #23 Mon Aug 4 07 :40:48 IST 2014 Kernel command line: mem=460M root=/dev/mmcblk0p2 rootwait nonitrd ro console=tty0</pre> From original boot messages on ttyS0: <pre>Linux version 2.6.32.9-default (root@Ryan-VM-Ubuntu) (gcc version 4.5.2 (Sourcery G++ Lite 2011.03-41) ) #1 Wed Dec 5 19:29:52 CST 2012 Kernel command line: mem=460M root=/dev/mtdblock11 noinitrd rootfstype=yaffs2 rw console=ttyS0,115200n8 mbtotal=52M init=/init CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387f ... Memory: 460MB = 460MB total Memory: 460288KB available (5188K code, 1069K data, 136K init, 0K highmem) ... Creating 6 MTD partitions on &quot;mtdsf device&quot;: 0x000000000000-0x000000d00000 : &quot;filesystem-SF&quot; 0x000000d00000-0x000000f80000 : &quot;kernel-SF&quot; 0x000000f80000-0x000000fd0000 : &quot;u-boot-SF&quot; 0x000000fd0000-0x000000fe0000 : &quot;u-boot env. cfg. 1-SF&quot; 0x000000fe0000-0x000000ff0000 : &quot;u-boot env. cfg. 2-SF&quot; 0x000000ff0000-0x000001000000 : &quot;w-load-SF&quot; wmt sf controller initial ok ... NAND device: Manufacturer ID: 0xec, Chip ID: 0xd59476 (Samsung K9GAG08U0F) Bad block at 16 Bad block at 17 Bad block at 89 Bad block at 613 Bad block at 880 Bad block at 1583 WMT_nand: uboot no dynamic partitions defined, use default static Creating 11 MTD partitions on &quot;WMT.nand&quot;: 0x000000000000-0x000000100000 : &quot;w-load-NAND&quot; 0x000000100000-0x000000a00000 : &quot;u-boot env. cfg. 1-NAND&quot; 0x000000a00000-0x000001300000 : &quot;u-boot-NAND&quot; 0x000001300000-0x000001b00000 : &quot;kernel-NAND&quot; 0x000001b00000-0x000002100000 : &quot;initrd-NAND&quot; 0x000002100000-0x000012100000 : &quot;filesystem-NAND&quot; 0x000012100000-0x000012300000 : &quot;u-boot-logo&quot; 0x000012300000-0x000012700000 : &quot;kernel-logo&quot; 0x000012700000-0x000052700000 : &quot;android-data&quot; 0x000052700000-0x00005a700000 : &quot;android-cache&quot; 0x00005a700000-0x000080000000 : &quot;LocalDisk&quot; nand initialised ok ... VIA Networking Velocity Family Gigabit Ethernet Adapter Driver Ver. 1.14 ... eth0: VIA Networking Velocity Family Gigabit Ethernet Adapter ... WMT_SOC: dai_name=i2s, codec_name=vt1603 WMT_SOC: single, wmt_i2s_rate=44100 ... VT1603 Audio Codec 0.10 wmt.audio.i2s = vt1603:f2:f2:f1:f1:100 ...</pre> c0ee9556f332a82fc7e5fe5fd7a102e233fbd790 Linux-vserver 0 317 918 2014-08-20T22:44:17Z Jlehtira 358 Linux-VServer info for Slackware. For now, the gotchas I ran into ! wikitext text/x-wiki [http://en.wikipedia.org/wiki/Linux-vserver Linux-VServer] is a virtual private server implementation that was created by adding operating system-level virtualization capabilities to the Linux kernel. === Setting up a Linux-VServer host on Slackware === Linux-Vserver requires a patched kernel and specific utilities. Installation is outlined [http://linux-vserver.org/Installation_on_Linux_2.6 here]. The required steps for installing on Slackware are: * Download a vanilla kernel source and a matching vserver patch [http://linux-vserver.org/Downloads#Kernel_Patches here] * Unpack the kernel sources and apply the VServer patch. Copy .config file from Slackware's own kernel sources, just in case. Then use "make menuconfig" and check the [http://linux-vserver.org/Installation_on_Linux_2.6#Configuring_the_Kernel Linux VServer] settings, making sure to enable it. * make && make modules_install && make install for easy kernel installation. * Download and compile dietlibc. It is required, and Linux_Vserver will fail silently without it. It is available in [http://slackbuilds.org/repository/14.1/libraries/dietlibc/?search=dietlibc Slackbuilds.org] and easiest to install from there. The slackbuild puts it in /opt/diet . * Download, compile and install [https://savannah.nongnu.org/projects/util-vserver/ util-vserver]. You should do "DIET=/opt/diet/bin/diet ./configure", otherwise the dietlibc isn't found. === Setting up a Slackware guest OS === Check up [http://notes.sagredo.eu/node/7 Roberto Puzzanghera's blog] for installation scripts. '''To be continued''' [[Category:Tutorials]] a43ae3a9885840d2de7e15a092086e6c897f54cc User:AndDT 2 305 919 838 2014-08-24T13:48:18Z AndDT 319 wikitext text/x-wiki Slackware user :) First met Slackware 20120328. * Real Name: Andrew * IRC Nickname: AndDT * E-Mail: anddt@ukr.net * My SlackBuilds: https://github.com/AndDT/SlackBuilds/ ce02b12ef8c1607d860cbddb4419a9d2ba26b2a6 SlackwareOnMt6582Tablet 0 318 920 2014-08-25T07:56:17Z Gv 356 Created page with " == specifications for the Tablet PC which was used here : == <pre> Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC..." wikitext text/x-wiki == specifications for the Tablet PC which was used here : == <pre> Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean </pre> == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, <pre> mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl </pre> If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. <pre> (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) </pre> [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. <pre> cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc </pre> and plug it into the device. Once that is done, === chroot to installer: === Now plug the card in tablet pc, boot, from host computer, <pre> adb shell su cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt </pre> === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware/slackware <pre> setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware/slackware </pre> === Complete installation, and configure. Once the installation is done, === <pre> umount proc umount sys umount dev sync cd ../.. umount slackware </pre> == Getting into installed Slackware: == <pre> mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/bash </pre> From here you can do normal Slackware activities. == Testing the framebuffer == Stop android "Surfaceflinger": make sure the display is on ( not blank ) and issue: <pre> adb shell su stop </pre> Now the display goes blank, still with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. from Slackware shell: <pre> gcc fbtest.c ./a.out </pre> once done, go back to android su shell from adb, and: <pre> start </pre> After few seconds android display will be back on. == Getting mali driver for Xorg == All these compilations are done under the chrooted slackware environment on the Tablet PC, using gcc <pre> gcc version 4.8.2 (GCC) ( arm-slackware-linux-gnueabi-gcc ) </pre> [http://malideveloper.arm.com/downloads/drivers/DX910 Open Source Mali-200/300/400/450 GPU Kernel Dev] [http://malideveloper.arm.com/develop-for-mali/drivers/open-source-mali-gpus-linux-exadri2-and-x11-display-drivers/ Open Source Mali GPUs Linux EXA/DRI2 and X11 Display Drivers] Get [http://malideveloper.arm.com/downloads/drivers/DX910/r4p1-01rel0/DX910-SW-99003-r4p1-01rel0.tgz DX910-SW-99003-r4p1-01rel0] or choose another version Once downloaded: <pre> tar xf DX910-SW-99003-r4p1-01rel0.tgz cd DX910-SW-99003-r4p1-01rel0/x11/xf86-video-mali-0.0.1 ./autogen.sh in src/Makefile: # mali_drv_la_LDFLAGS = -module -avoid-version -L$(MALI_DDK)/lib -lMali -lUMP -lpthread for now. mali_drv_la_LDFLAGS = -module -avoid-version -L$(MALI_DDK)/lib -lUMP -lpthread </pre> also get [http://malideveloper.arm.com/develop-for-mali/drivers/open-source-mali-gpus-ump-user-space-drivers-source-code-2 ] [http://malideveloper.arm.com/downloads/drivers/DX910/r4p1-01rel0/DX910-SW-99006-r4p1-01rel0.tgz]. <pre> make/install </pre> Once make/install is done for both, <pre> cp src/.libs/mali_drv.* /usr/lib/xorg/modules/drivers/ ldconfig </pre> And do startx ( fails with following error ). <pre> [ 9131.458] (II) LoadModule: "mali" [ 9131.461] (II) Loading /usr/lib/xorg/modules/drivers/mali_drv.so [ 9131.461] (II) Module mali: vendor="X.Org Foundation" [ 9131.462] compiled for 1.14.3, module version = 0.4.2 [ 9131.462] ABI class: X.Org Video Driver, version 14.1 [ 9131.462] (II) MALI: driver for Mali Framebuffer: mali [ 9131.462] (EE) Fatal server error: [ 9131.462] (EE) xf86OpenConsole: Cannot open /dev/tty0 (No such file or direct ory) [ 9131.463] (EE) [ 9131.463] (EE) </pre> No further tests until I get to unlock bootloader or get a X server which requires no ttys! 9cebc7bbf0b2faa9bd2671852a72eadda4f1e0ba 921 920 2014-08-25T11:29:50Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == <pre> Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? </pre> == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, <pre> mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl </pre> If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. <pre> mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) </pre> [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. <pre> cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc </pre> and plug it into the device. Once that is done, === chroot to installer: === Now plug the card in tablet pc, boot, from host computer, <pre> adb shell su cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt </pre> === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware <pre> setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware </pre> === Complete installation, and configuration === Once the complete installation is done, <pre> umount proc umount sys umount dev sync cd ../.. umount slackware </pre> == Getting into installed Slackware: == <pre> mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/bash </pre> From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs that require no X windows worked fine. I ran couple of frame buffer tests too. == Testing the framebuffer == For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. <pre> adb shell su stop </pre> Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: <pre> gcc fbtest.c ./a.out </pre> once done, go back to android su shell from adb, and: <pre> start </pre> After few seconds android display will be back on. == Failed test of running an Xorg session == === Getting Mali driver for Xorg === All these compilations are done under the chrooted Slackware environment on the Tablet PC, using gcc <pre> gcc version 4.8.2 (GCC) ( arm-slackware-linux-gnueabi-gcc ) </pre> [http://malideveloper.arm.com/downloads/drivers/DX910 Open Source Mali-200/300/400/450 GPU Kernel Dev] [http://malideveloper.arm.com/develop-for-mali/drivers/open-source-mali-gpus-linux-exadri2-and-x11-display-drivers/ Open Source Mali GPUs Linux EXA/DRI2 and X11 Display Drivers] Get [http://malideveloper.arm.com/downloads/drivers/DX910/r4p1-01rel0/DX910-SW-99003-r4p1-01rel0.tgz DX910-SW-99003-r4p1-01rel0] or choose another version Once downloaded, and adb pushed to tablet: <pre> tar xf DX910-SW-99003-r4p1-01rel0.tgz cd DX910-SW-99003-r4p1-01rel0/x11/xf86-video-mali-0.0.1 ./autogen.sh in src/Makefile: # mali_drv_la_LDFLAGS = -module -avoid-version -L$(MALI_DDK)/lib -lMali -lUMP -lpthread for now. mali_drv_la_LDFLAGS = -module -avoid-version -L$(MALI_DDK)/lib -lUMP -lpthread </pre> also get [http://malideveloper.arm.com/develop-for-mali/drivers/open-source-mali-gpus-ump-user-space-drivers-source-code-2 ump] <pre> make and install </pre> Once make/install is done for both, <pre> cp src/.libs/mali_drv.* /usr/lib/xorg/modules/drivers/ ldconfig </pre> === Run Xorg === And run startx, which fails with the following error. <pre> [ 9131.458] (II) LoadModule: "mali" [ 9131.461] (II) Loading /usr/lib/xorg/modules/drivers/mali_drv.so [ 9131.461] (II) Module mali: vendor="X.Org Foundation" [ 9131.462] compiled for 1.14.3, module version = 0.4.2 [ 9131.462] ABI class: X.Org Video Driver, version 14.1 [ 9131.462] (II) MALI: driver for Mali Framebuffer: mali [ 9131.462] (EE) Fatal server error: [ 9131.462] (EE) xf86OpenConsole: Cannot open /dev/tty0 (No such file or direct ory) [ 9131.463] (EE) [ 9131.463] (EE) </pre> No further tests until I get to unlock bootloader or get a X server which requires no ttys! 63d8f96ec4388192e2c86c30f63c79c2ac405a15 922 921 2014-09-03T07:36:56Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == <pre> Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? </pre> == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, <pre> mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl </pre> If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. <pre> mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) </pre> [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. <pre> cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc </pre> and plug it into the device. Once that is done, === chroot to installer: === Now plug the card in tablet pc, boot, from host computer, <pre> adb shell su cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt </pre> === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware <pre> setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware </pre> === Complete installation, and configuration === Once the complete installation is done, <pre> umount proc umount sys umount dev sync cd ../.. umount slackware </pre> == Getting into installed Slackware: == <pre> mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/bash </pre> From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs that require no X windows worked fine. I ran couple of frame buffer tests too. == Testing the framebuffer == For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. <pre> adb shell su stop </pre> Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: <pre> gcc fbtest.c ./a.out </pre> once done, go back to android su shell from adb, and: <pre> start </pre> After few seconds android display will be back on. == Failed test of running an Xorg session == === Getting Mali driver for Xorg === All these compilations are done under the chrooted Slackware environment on the Tablet PC, using gcc <pre> gcc version 4.8.2 (GCC) ( arm-slackware-linux-gnueabi-gcc ) </pre> [http://malideveloper.arm.com/downloads/drivers/DX910 Open Source Mali-200/300/400/450 GPU Kernel Dev] [http://malideveloper.arm.com/develop-for-mali/drivers/open-source-mali-gpus-linux-exadri2-and-x11-display-drivers/ Open Source Mali GPUs Linux EXA/DRI2 and X11 Display Drivers] Get [http://malideveloper.arm.com/downloads/drivers/DX910/r4p1-01rel0/DX910-SW-99003-r4p1-01rel0.tgz DX910-SW-99003-r4p1-01rel0] or choose another version Once downloaded, and adb pushed to tablet: <pre> tar xf DX910-SW-99003-r4p1-01rel0.tgz cd DX910-SW-99003-r4p1-01rel0/x11/xf86-video-mali-0.0.1 ./autogen.sh in src/Makefile: # mali_drv_la_LDFLAGS = -module -avoid-version -L$(MALI_DDK)/lib -lMali -lUMP -lpthread for now. mali_drv_la_LDFLAGS = -module -avoid-version -L$(MALI_DDK)/lib -lUMP -lpthread </pre> also get [http://malideveloper.arm.com/develop-for-mali/drivers/open-source-mali-gpus-ump-user-space-drivers-source-code-2 ump] <pre> make and install </pre> Once make/install is done for both, <pre> cp src/.libs/mali_drv.* /usr/lib/xorg/modules/drivers/ ldconfig </pre> === Run Xorg === And run startx, which fails with the following error. <pre> [ 9131.458] (II) LoadModule: "mali" [ 9131.461] (II) Loading /usr/lib/xorg/modules/drivers/mali_drv.so [ 9131.461] (II) Module mali: vendor="X.Org Foundation" [ 9131.462] compiled for 1.14.3, module version = 0.4.2 [ 9131.462] ABI class: X.Org Video Driver, version 14.1 [ 9131.462] (II) MALI: driver for Mali Framebuffer: mali [ 9131.462] (EE) Fatal server error: [ 9131.462] (EE) xf86OpenConsole: Cannot open /dev/tty0 (No such file or direct ory) [ 9131.463] (EE) [ 9131.463] (EE) </pre> == Compiling and getting Xfbdev running! - Partially == Finally I found that the X VT requirement can be removed. In the first test, No keyboard and mouse, but startx opens a nice fluxbox window. I can set DISPLAY=:0, and run xterm and other applications from adb shell onto the X windows running on LCD. Here is what I did: Procedure: Get xorg-server-1.12.2 and required files from : http://xorg.freedesktop.org/archive /X11R7.7/ Apply patch to hw/kdrive/linux/linux.c ( basically make most of the functions just e mpty, so that no tty open etc are done - first step to test :-) ) refer to the patch at the end. configure: <pre> export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/usr/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH # autoreconf --force -v --install || exit 1 ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --enabl e-config-udev --disable-aiglx --disable-glx --disable-dri --disable-dri2 --disab le-libdrm --disable-record --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xk b-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default- xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --di sable-xorg --enable-xnest --disable-dmx --disable-xquartz --disable-xwin --disab le-xephyr --disable-config-udev make -j 3 make install Also install xkeyboard-config-2.11 cd /opt/local/sw/share/X11/xkb/rules/ ln -s base /opt/local/sw/share/X11/xkb/rules/base xorg If this is not done, you will get: XKB: Failed to compile keymap Once installed, run: startx -- ./Xfbdev -fb /dev/graphics/fb0 </pre> See the frame grab with scrot x.png x2.png === /hw/kdrive/linux/linux.c patch: === <pre> --- linux.c 2014-09-03 08:29:11.000000000 +0530 +++ linux.c.org 2012-05-17 22:39:03.000000000 +0530 @@ -65,7 +65,6 @@ static void LinuxCheckChown(char *file) { -#ifdef GV struct stat st; __uid_t u; __gid_t g; @@ -76,13 +75,11 @@ g = getgid(); if (st.st_uid != u || st.st_gid != g) chown(file, u, g); -#endif } static int LinuxInit(void) { -#ifdef GV int fd = -1; char vtname[11]; struct vt_stat vts; @@ -130,14 +127,13 @@ if (ioctl(LinuxConsoleFd, VT_GETSTATE, &vts) == 0) { activeVT = vts.v_active; } -#endif + return 1; } static void LinuxSetSwitchMode(int mode) { -#ifdef GV struct sigaction act; struct vt_mode VT; @@ -168,7 +164,6 @@ if (ioctl(LinuxConsoleFd, VT_SETMODE, &VT) < 0) { FatalError("LinuxInit: VT_SETMODE failed\n"); } -#endif } static void @@ -181,7 +176,6 @@ static void LinuxApmWakeup(pointer blockData, int result, pointer pReadmask) { -#ifdef GV fd_set *readmask = (fd_set *) pReadmask; if (result > 0 && LinuxApmFd >= 0 && FD_ISSET(LinuxApmFd, readmask)) { @@ -219,7 +213,6 @@ ioctl(LinuxApmFd, cmd, 0); } } -#endif } #ifdef FNONBLOCK @@ -231,7 +224,6 @@ static void LinuxEnable(void) { -#ifdef GV if (enabled) return; if (kdSwitchPending) { @@ -265,14 +257,12 @@ if (ioctl(LinuxConsoleFd, KDSETMODE, KD_GRAPHICS) < 0) { FatalError("LinuxInit: KDSETMODE KD_GRAPHICS failed\n"); } -#endif enabled = TRUE; } static void LinuxDisable(void) { -#ifdef GV ioctl(LinuxConsoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */ if (kdSwitchPending) { kdSwitchPending = FALSE; @@ -285,13 +275,11 @@ close(LinuxApmFd); LinuxApmFd = -1; } -#endif } static void LinuxFini(void) { -#ifdef GV struct vt_mode VT; struct vt_stat vts; int fd; @@ -339,7 +327,6 @@ close(fd); } return; -#endif } void @@ -365,11 +352,9 @@ static void LinuxBell(int volume, int pitch, int duration) { -#ifdef GV if (volume && pitch) ioctl(LinuxConsoleFd, KDMKTONE, ((1193190 / pitch) & 0xffff) | (((unsigned long) duration * volume / 50) << 16)); -#endif } KdOsFuncs LinuxFuncs = { </pre> 5ef905964f09251920225f3a10c980b805e39542 923 922 2014-09-03T12:36:44Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == <pre> Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? </pre> == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, <pre> mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl </pre> If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. <pre> mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) </pre> [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. <pre> cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc </pre> and plug it into the device. Once that is done, === chroot to installer: === Now plug the card in tablet pc, boot, from host computer, <pre> adb shell su cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt </pre> === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware <pre> setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware </pre> === Complete installation, and configuration === Once the complete installation is done, <pre> umount proc umount sys umount dev sync cd ../.. umount slackware </pre> == Getting into installed Slackware: == <pre> mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/bash </pre> From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs that require no X windows worked fine. I ran couple of frame buffer tests too. == Testing the framebuffer == For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. <pre> adb shell su stop </pre> Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: <pre> gcc fbtest.c ./a.out </pre> once done, go back to android su shell from adb, and: <pre> start </pre> After few seconds android display will be back on. == Failed test of running an Xorg session == === Getting Mali driver for Xorg === All these compilations are done under the chrooted Slackware environment on the Tablet PC, using gcc <pre> gcc version 4.8.2 (GCC) ( arm-slackware-linux-gnueabi-gcc ) </pre> [http://malideveloper.arm.com/downloads/drivers/DX910 Open Source Mali-200/300/400/450 GPU Kernel Dev] [http://malideveloper.arm.com/develop-for-mali/drivers/open-source-mali-gpus-linux-exadri2-and-x11-display-drivers/ Open Source Mali GPUs Linux EXA/DRI2 and X11 Display Drivers] Get [http://malideveloper.arm.com/downloads/drivers/DX910/r4p1-01rel0/DX910-SW-99003-r4p1-01rel0.tgz DX910-SW-99003-r4p1-01rel0] or choose another version Once downloaded, and adb pushed to tablet: <pre> tar xf DX910-SW-99003-r4p1-01rel0.tgz cd DX910-SW-99003-r4p1-01rel0/x11/xf86-video-mali-0.0.1 ./autogen.sh in src/Makefile: # mali_drv_la_LDFLAGS = -module -avoid-version -L$(MALI_DDK)/lib -lMali -lUMP -lpthread for now. mali_drv_la_LDFLAGS = -module -avoid-version -L$(MALI_DDK)/lib -lUMP -lpthread </pre> also get [http://malideveloper.arm.com/develop-for-mali/drivers/open-source-mali-gpus-ump-user-space-drivers-source-code-2 ump] <pre> make and install </pre> Once make/install is done for both, <pre> cp src/.libs/mali_drv.* /usr/lib/xorg/modules/drivers/ ldconfig </pre> === Run Xorg === And run startx, which fails with the following error. <pre> [ 9131.458] (II) LoadModule: "mali" [ 9131.461] (II) Loading /usr/lib/xorg/modules/drivers/mali_drv.so [ 9131.461] (II) Module mali: vendor="X.Org Foundation" [ 9131.462] compiled for 1.14.3, module version = 0.4.2 [ 9131.462] ABI class: X.Org Video Driver, version 14.1 [ 9131.462] (II) MALI: driver for Mali Framebuffer: mali [ 9131.462] (EE) Fatal server error: [ 9131.462] (EE) xf86OpenConsole: Cannot open /dev/tty0 (No such file or direct ory) [ 9131.463] (EE) [ 9131.463] (EE) </pre> == Compiling and getting Xfbdev running! - Partially == Finally I found that the X VT requirement can be removed. In the first test, No keyboard and mouse, but startx opens a nice fluxbox window. I can set DISPLAY=:0, and run xterm and other applications from adb shell onto the X windows running on LCD. Here is what I did: Procedure: Get xorg-server-1.12.2 and required files from : http://xorg.freedesktop.org/archive/X11R7.7/ Apply patch to hw/kdrive/linux/linux.c ( As first step, basically make most of the functions just empty, so that no tty open etc are done.) Refer to the patch at the end. configure: <pre> export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/usr/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH # autoreconf --force -v --install || exit 1 ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --disab le-aiglx --disable-glx --disable-dri --disable-dri2 --disable-libdrm --disable-r ecord --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with -default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xorg --enable-x nest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --enable-co nfig-udev --enable-tslib LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/incl ude make -j 3 make install </pre> Also install xkeyboard-config-2.11. Once it is installed: <pre> cd /opt/local/sw/share/X11/xkb/rules/ ln -s base /opt/local/sw/share/X11/xkb/rules/base xorg If this is not done, you will get error: XKB: Failed to compile keymap </pre> Once installed, run X: <pre> Makesure the display is on. Stop Surfaceflinger from adb shell ( as root ): stop If "stop" step is not done, X will show up, but as soon as the screen is touched, it will disappear. From Slackware shell ( as root ), run: startx -- /opt/local/sw/bin/Xfbdev -fb /dev/graphics/fb0 Once done, restart Surfaceflinger from adb shell ( as root ): start </pre> See the frame grab with scrot x.png x2.png === /hw/kdrive/linux/linux.c patch: === <pre> --- linux.c.org 2012-05-17 22:39:03.000000000 +0530 +++ linux.c 2014-09-03 08:29:11.000000000 +0530 @@ -65,6 +65,7 @@ static void LinuxCheckChown(char *file) { +#ifdef GV struct stat st; __uid_t u; __gid_t g; @@ -75,11 +76,13 @@ g = getgid(); if (st.st_uid != u || st.st_gid != g) chown(file, u, g); +#endif } static int LinuxInit(void) { +#ifdef GV int fd = -1; char vtname[11]; struct vt_stat vts; @@ -127,13 +130,14 @@ if (ioctl(LinuxConsoleFd, VT_GETSTATE, &vts) == 0) { activeVT = vts.v_active; } - +#endif return 1; } static void LinuxSetSwitchMode(int mode) { +#ifdef GV struct sigaction act; struct vt_mode VT; @@ -164,6 +168,7 @@ if (ioctl(LinuxConsoleFd, VT_SETMODE, &VT) < 0) { FatalError("LinuxInit: VT_SETMODE failed\n"); } +#endif } static void @@ -176,6 +181,7 @@ static void LinuxApmWakeup(pointer blockData, int result, pointer pReadmask) { +#ifdef GV fd_set *readmask = (fd_set *) pReadmask; if (result > 0 && LinuxApmFd >= 0 && FD_ISSET(LinuxApmFd, readmask)) { @@ -213,6 +219,7 @@ ioctl(LinuxApmFd, cmd, 0); } } +#endif } #ifdef FNONBLOCK @@ -224,6 +231,7 @@ static void LinuxEnable(void) { +#ifdef GV if (enabled) return; if (kdSwitchPending) { @@ -257,12 +265,14 @@ if (ioctl(LinuxConsoleFd, KDSETMODE, KD_GRAPHICS) < 0) { FatalError("LinuxInit: KDSETMODE KD_GRAPHICS failed\n"); } +#endif enabled = TRUE; } static void LinuxDisable(void) { +#ifdef GV ioctl(LinuxConsoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */ if (kdSwitchPending) { kdSwitchPending = FALSE; @@ -275,11 +285,13 @@ close(LinuxApmFd); LinuxApmFd = -1; } +#endif } static void LinuxFini(void) { +#ifdef GV struct vt_mode VT; struct vt_stat vts; int fd; @@ -327,6 +339,7 @@ close(fd); } return; +#endif } void @@ -352,9 +365,11 @@ static void LinuxBell(int volume, int pitch, int duration) { +#ifdef GV if (volume && pitch) ioctl(LinuxConsoleFd, KDMKTONE, ((1193190 / pitch) & 0xffff) | (((unsigned long) duration * volume / 50) << 16)); +#endif } KdOsFuncs LinuxFuncs = { </pre> e70d700159ba90ee5802eaa6deedb4851f92bd2a 924 923 2014-09-05T06:45:24Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == <pre> Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? </pre> == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, <pre> mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl </pre> If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. <pre> mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) </pre> [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. <pre> cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc </pre> and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== <pre> adb shell su </pre> ==== chroot to installe ==== <pre> cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt </pre> === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware <pre> setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware </pre> === Complete installation, and configuration === Once the complete installation is done, <pre> umount proc umount sys umount dev sync cd ../.. umount slackware </pre> == Getting into installed Slackware: == ==== Running slackware su shell ==== <pre> adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/bash su - </pre> From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs that require no X windows worked fine. I ran couple of frame buffer tests too. == Testing the framebuffer == For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: <pre> adb shell su stop </pre> Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: <pre> gcc fbtest.c ./a.out </pre> once done, go back to android su shell from adb, and: ==== Getting back to android ==== <pre> start </pre> After few seconds android display will be back on. == Getting Xorg up - at least partially == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. ==== synaptics ==== synaptics driver fails with error message relating to Protocol. xf86-input-synaptics-1.6.1.tar.bz2 ./configure --prefix=/opt/local/sw CFLAGS=-I/opt/local/sw/include/xorg LDFLAGS=-L/opt/local/sw/lib make -j 3 make install When running Xorg, [ 4784.385] (EE) synaptics: mytouchscreen: Synaptics driver unable to detect protocol === Running X === make sure display is on, and From adb shell as su: stop From slackware chroot environment in adb shell [ see section ]: startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Once Finished, from adb shell as su: start === Files === ==== xorg.conf ==== <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" \# InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" Option "Protocol" "Auto" EndSection </pre> ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> == Running some tests == === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) GV: read 112 Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.148724, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.148730, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.148734, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.148738, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.148742, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.148745, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.164975, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.164981, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.164985, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.164989, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.164994, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.164997, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.180722, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.180727, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.180731, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.180736, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.180740, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.180743, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.196495, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.196501, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.196505, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.196510, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.196514, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.196517, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.211803, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.211809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.211813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.211818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.211822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.211825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.225500, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.225504, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.225507, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.466531, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.466536, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.466540, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.466545, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.466549, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.466553, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.466556, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.482028, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.482033, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.482038, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.482042, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.482046, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.482049, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.497971, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.497977, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.497981, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.497986, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.497990, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.497993, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.514030, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.514036, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.514040, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.514044, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.514048, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.514051, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.530188, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.530194, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.530198, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.530202, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.530206, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.530210, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.545804, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.545809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.545813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.545818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.545822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.545825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.559686, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.559690, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.559693, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.880062, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.880067, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.880072, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.880076, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.880080, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.880084, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.880088, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.895834, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.895839, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.895844, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.895848, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.895852, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.895855, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.911757, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.911762, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.911767, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.911771, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.911775, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.911778, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.927833, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.927838, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 680 Event: time 1409845467.927842, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.927847, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.927851, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.927854, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.944420, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.944426, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845467.944430, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.944434, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.944438, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.944442, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.959239, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.959244, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 683 Event: time 1409845467.959249, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.959253, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.959257, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.959260, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.974974, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.974980, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 685 Event: time 1409845467.974984, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.974988, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.974992, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.974996, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.989318, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.989321, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.989324, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.246567, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.246571, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.246576, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.246580, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.246584, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.246589, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.246592, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.262652, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.262657, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.262662, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.262666, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.262670, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.262673, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.278454, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.278460, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.278464, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.278468, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.278473, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.278476, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.293932, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.293938, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 653 Event: time 1409845468.293942, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.293946, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.293950, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.293953, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.309429, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.309434, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 639 Event: time 1409845468.309438, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 416 Event: time 1409845468.309443, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.309447, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.309450, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.323482, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.323486, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.323489, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.596393, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.596397, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.596402, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.596406, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.596410, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.596414, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.596417, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.612126, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.612132, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.612136, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.612140, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.612144, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.612147, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.628256, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.628262, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.628266, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.628271, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.628275, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.628278, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.644136, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.644142, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.644146, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.644151, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.644155, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.644158, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.659867, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.659873, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.659877, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.659882, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.659886, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.659889, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.673538, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.673541, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.673544, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.946001, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.946005, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.946010, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.946014, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.946018, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.946022, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.946025, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.962071, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.962077, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.962081, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.962085, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.962089, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.962093, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.977741, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.977747, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.977751, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.977755, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.977759, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.977762, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.993678, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.993684, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.993688, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.993692, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.993696, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.993700, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.010083, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.010089, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845469.010093, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.010097, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.010101, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.010104, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.026187, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.026193, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 665 Event: time 1409845469.026197, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.026201, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.026205, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.026209, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.041432, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.041437, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 640 Event: time 1409845469.041442, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.041446, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.041450, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.041453, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.057294, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.057299, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 581 Event: time 1409845469.057304, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.057308, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.057312, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.057315, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.073883, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.073889, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 540 Event: time 1409845469.073893, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.073897, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.073901, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.073905, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.089886, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.089892, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 496 Event: time 1409845469.089896, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.089900, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.089904, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.089908, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.105335, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.105340, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 450 Event: time 1409845469.105344, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.105349, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.105353, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.105356, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.121183, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.121188, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 404 Event: time 1409845469.121192, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.121197, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.121201, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.121204, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.136794, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.136799, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 360 Event: time 1409845469.136803, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.136808, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.136812, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.136815, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.152605, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.152611, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 312 Event: time 1409845469.152615, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.152619, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.152623, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.152626, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.169594, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.169599, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 270 Event: time 1409845469.169604, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 366 Event: time 1409845469.169608, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.169612, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.169615, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.185263, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.185268, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 236 Event: time 1409845469.185273, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 373 Event: time 1409845469.185277, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.185281, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.185284, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.200843, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.200848, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.200853, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.200857, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.200861, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.200864, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 572e575a8c79724bd232b1dac41dfea818c042dc 925 924 2014-09-05T06:57:06Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installe ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/bash su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs that require no X windows worked fine. I ran couple of frame buffer tests too. == Testing the framebuffer == For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. == Getting Xorg up - at least partially == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. ==== synaptics ==== synaptics driver fails with error message relating to Protocol. xf86-input-synaptics-1.6.1.tar.bz2 ./configure --prefix=/opt/local/sw CFLAGS=-I/opt/local/sw/include/xorg LDFLAGS=-L/opt/local/sw/lib make -j 3 make install When running Xorg, [ 4784.385] (EE) synaptics: mytouchscreen: Synaptics driver unable to detect protocol === Running X === make sure display is on, and From adb shell as su: stop From slackware chroot environment in adb shell [ see section ]: startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Once Finished, from adb shell as su: start === Files === ==== xorg.conf ==== <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" Option "Protocol" "Auto" EndSection </pre> ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> == Running some tests == === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) GV: read 112 Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.148724, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.148730, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.148734, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.148738, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.148742, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.148745, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.164975, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.164981, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.164985, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.164989, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.164994, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.164997, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.180722, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.180727, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.180731, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.180736, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.180740, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.180743, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.196495, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.196501, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.196505, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.196510, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.196514, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.196517, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.211803, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.211809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.211813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.211818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.211822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.211825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.225500, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.225504, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.225507, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.466531, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.466536, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.466540, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.466545, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.466549, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.466553, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.466556, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.482028, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.482033, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.482038, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.482042, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.482046, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.482049, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.497971, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.497977, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.497981, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.497986, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.497990, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.497993, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.514030, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.514036, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.514040, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.514044, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.514048, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.514051, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.530188, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.530194, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.530198, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.530202, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.530206, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.530210, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.545804, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.545809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.545813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.545818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.545822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.545825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.559686, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.559690, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.559693, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.880062, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.880067, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.880072, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.880076, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.880080, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.880084, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.880088, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.895834, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.895839, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.895844, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.895848, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.895852, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.895855, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.911757, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.911762, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.911767, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.911771, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.911775, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.911778, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.927833, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.927838, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 680 Event: time 1409845467.927842, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.927847, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.927851, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.927854, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.944420, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.944426, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845467.944430, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.944434, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.944438, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.944442, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.959239, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.959244, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 683 Event: time 1409845467.959249, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.959253, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.959257, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.959260, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.974974, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.974980, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 685 Event: time 1409845467.974984, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.974988, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.974992, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.974996, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.989318, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.989321, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.989324, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.246567, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.246571, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.246576, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.246580, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.246584, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.246589, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.246592, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.262652, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.262657, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.262662, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.262666, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.262670, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.262673, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.278454, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.278460, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.278464, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.278468, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.278473, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.278476, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.293932, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.293938, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 653 Event: time 1409845468.293942, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.293946, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.293950, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.293953, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.309429, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.309434, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 639 Event: time 1409845468.309438, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 416 Event: time 1409845468.309443, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.309447, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.309450, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.323482, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.323486, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.323489, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.596393, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.596397, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.596402, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.596406, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.596410, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.596414, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.596417, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.612126, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.612132, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.612136, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.612140, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.612144, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.612147, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.628256, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.628262, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.628266, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.628271, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.628275, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.628278, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.644136, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.644142, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.644146, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.644151, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.644155, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.644158, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.659867, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.659873, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.659877, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.659882, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.659886, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.659889, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.673538, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.673541, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.673544, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.946001, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.946005, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.946010, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.946014, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.946018, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.946022, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.946025, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.962071, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.962077, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.962081, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.962085, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.962089, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.962093, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.977741, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.977747, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.977751, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.977755, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.977759, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.977762, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.993678, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.993684, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.993688, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.993692, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.993696, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.993700, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.010083, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.010089, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845469.010093, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.010097, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.010101, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.010104, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.026187, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.026193, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 665 Event: time 1409845469.026197, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.026201, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.026205, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.026209, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.041432, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.041437, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 640 Event: time 1409845469.041442, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.041446, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.041450, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.041453, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.057294, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.057299, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 581 Event: time 1409845469.057304, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.057308, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.057312, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.057315, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.073883, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.073889, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 540 Event: time 1409845469.073893, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.073897, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.073901, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.073905, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.089886, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.089892, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 496 Event: time 1409845469.089896, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.089900, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.089904, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.089908, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.105335, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.105340, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 450 Event: time 1409845469.105344, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.105349, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.105353, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.105356, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.121183, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.121188, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 404 Event: time 1409845469.121192, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.121197, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.121201, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.121204, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.136794, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.136799, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 360 Event: time 1409845469.136803, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.136808, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.136812, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.136815, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.152605, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.152611, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 312 Event: time 1409845469.152615, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.152619, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.152623, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.152626, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.169594, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.169599, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 270 Event: time 1409845469.169604, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 366 Event: time 1409845469.169608, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.169612, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.169615, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.185263, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.185268, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 236 Event: time 1409845469.185273, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 373 Event: time 1409845469.185277, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.185281, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.185284, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.200843, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.200848, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.200853, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.200857, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.200861, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.200864, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> a45c75669dfa2734f491e6425104b5f20af52917 926 925 2014-09-05T08:34:14Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installe ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/bash su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs that require no X windows worked fine. I ran couple of frame buffer tests too. == Testing the framebuffer == For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. == Getting Xorg up - at least partially == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. ==== synaptics ==== synaptics driver fails with error message relating to Protocol. xf86-input-synaptics-1.6.1.tar.bz2 ./configure --prefix=/opt/local/sw CFLAGS=-I/opt/local/sw/include/xorg LDFLAGS=-L/opt/local/sw/lib make -j 3 make install When running Xorg, [ 4784.385] (EE) synaptics: mytouchscreen: Synaptics driver unable to detect protocol === Running X === make sure display is on, and From adb shell as su: stop From slackware chroot environment in adb shell [ see section ]: startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Once Finished, from adb shell as su: start === Virtual Keyboard === ==== http://homepage3.nifty.com/tsato/xvkbd/ ==== Download [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], install xmkf make make install and run: xvkbd === Files === ==== xorg.conf ==== <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" Option "Protocol" "Auto" EndSection </pre> ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> == Running some tests == === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) GV: read 112 Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.148724, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.148730, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.148734, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.148738, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.148742, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.148745, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.164975, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.164981, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.164985, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.164989, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.164994, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.164997, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.180722, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.180727, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.180731, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.180736, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.180740, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.180743, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.196495, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.196501, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.196505, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.196510, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.196514, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.196517, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.211803, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.211809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.211813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.211818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.211822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.211825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.225500, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.225504, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.225507, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.466531, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.466536, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.466540, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.466545, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.466549, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.466553, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.466556, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.482028, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.482033, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.482038, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.482042, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.482046, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.482049, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.497971, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.497977, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.497981, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.497986, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.497990, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.497993, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.514030, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.514036, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.514040, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.514044, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.514048, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.514051, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.530188, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.530194, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.530198, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.530202, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.530206, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.530210, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.545804, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.545809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.545813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.545818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.545822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.545825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.559686, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.559690, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.559693, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.880062, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.880067, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.880072, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.880076, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.880080, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.880084, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.880088, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.895834, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.895839, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.895844, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.895848, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.895852, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.895855, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.911757, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.911762, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.911767, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.911771, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.911775, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.911778, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.927833, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.927838, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 680 Event: time 1409845467.927842, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.927847, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.927851, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.927854, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.944420, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.944426, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845467.944430, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.944434, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.944438, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.944442, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.959239, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.959244, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 683 Event: time 1409845467.959249, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.959253, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.959257, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.959260, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.974974, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.974980, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 685 Event: time 1409845467.974984, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.974988, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.974992, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.974996, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.989318, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.989321, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.989324, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.246567, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.246571, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.246576, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.246580, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.246584, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.246589, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.246592, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.262652, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.262657, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.262662, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.262666, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.262670, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.262673, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.278454, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.278460, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.278464, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.278468, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.278473, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.278476, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.293932, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.293938, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 653 Event: time 1409845468.293942, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.293946, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.293950, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.293953, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.309429, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.309434, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 639 Event: time 1409845468.309438, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 416 Event: time 1409845468.309443, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.309447, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.309450, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.323482, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.323486, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.323489, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.596393, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.596397, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.596402, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.596406, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.596410, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.596414, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.596417, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.612126, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.612132, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.612136, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.612140, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.612144, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.612147, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.628256, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.628262, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.628266, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.628271, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.628275, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.628278, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.644136, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.644142, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.644146, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.644151, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.644155, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.644158, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.659867, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.659873, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.659877, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.659882, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.659886, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.659889, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.673538, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.673541, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.673544, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.946001, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.946005, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.946010, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.946014, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.946018, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.946022, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.946025, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.962071, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.962077, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.962081, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.962085, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.962089, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.962093, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.977741, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.977747, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.977751, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.977755, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.977759, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.977762, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.993678, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.993684, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.993688, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.993692, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.993696, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.993700, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.010083, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.010089, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845469.010093, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.010097, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.010101, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.010104, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.026187, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.026193, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 665 Event: time 1409845469.026197, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.026201, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.026205, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.026209, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.041432, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.041437, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 640 Event: time 1409845469.041442, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.041446, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.041450, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.041453, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.057294, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.057299, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 581 Event: time 1409845469.057304, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.057308, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.057312, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.057315, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.073883, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.073889, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 540 Event: time 1409845469.073893, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.073897, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.073901, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.073905, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.089886, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.089892, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 496 Event: time 1409845469.089896, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.089900, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.089904, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.089908, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.105335, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.105340, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 450 Event: time 1409845469.105344, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.105349, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.105353, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.105356, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.121183, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.121188, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 404 Event: time 1409845469.121192, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.121197, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.121201, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.121204, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.136794, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.136799, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 360 Event: time 1409845469.136803, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.136808, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.136812, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.136815, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.152605, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.152611, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 312 Event: time 1409845469.152615, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.152619, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.152623, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.152626, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.169594, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.169599, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 270 Event: time 1409845469.169604, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 366 Event: time 1409845469.169608, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.169612, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.169615, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.185263, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.185268, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 236 Event: time 1409845469.185273, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 373 Event: time 1409845469.185277, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.185281, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.185284, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.200843, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.200848, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.200853, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.200857, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.200861, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.200864, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 572eb9d35cda7bbe3db1b3135b87383aada1c6c3 927 926 2014-09-05T08:43:50Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installe ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/bash su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs that require no X windows worked fine. I ran couple of frame buffer tests too. == Testing the framebuffer == For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. ==== synaptics ==== synaptics driver fails with error message relating to Protocol. xf86-input-synaptics-1.6.1.tar.bz2 ./configure --prefix=/opt/local/sw CFLAGS=-I/opt/local/sw/include/xorg LDFLAGS=-L/opt/local/sw/lib make -j 3 make install When running Xorg, [ 4784.385] (EE) synaptics: mytouchscreen: Synaptics driver unable to detect protocol === Running X === make sure display is on, and From adb shell as su: stop From slackware chroot environment in adb shell [ see section ]: startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Once Finished, from adb shell as su: start === Virtual Keyboard === ==== http://homepage3.nifty.com/tsato/xvkbd/ ==== Download [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], install xmkf make make install and run: xvkbd === Files === ==== xorg.conf ==== <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" Option "Protocol" "Auto" EndSection </pre> ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> == Running some tests == === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) GV: read 112 Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.148724, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.148730, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.148734, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.148738, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.148742, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.148745, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.164975, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.164981, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.164985, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.164989, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.164994, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.164997, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.180722, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.180727, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.180731, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.180736, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.180740, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.180743, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.196495, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.196501, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.196505, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.196510, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.196514, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.196517, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.211803, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.211809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.211813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.211818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.211822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.211825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.225500, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.225504, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.225507, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.466531, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.466536, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.466540, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.466545, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.466549, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.466553, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.466556, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.482028, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.482033, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.482038, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.482042, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.482046, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.482049, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.497971, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.497977, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.497981, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.497986, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.497990, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.497993, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.514030, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.514036, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.514040, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.514044, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.514048, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.514051, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.530188, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.530194, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.530198, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.530202, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.530206, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.530210, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.545804, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.545809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.545813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.545818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.545822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.545825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.559686, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.559690, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.559693, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.880062, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.880067, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.880072, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.880076, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.880080, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.880084, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.880088, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.895834, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.895839, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.895844, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.895848, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.895852, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.895855, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.911757, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.911762, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.911767, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.911771, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.911775, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.911778, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.927833, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.927838, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 680 Event: time 1409845467.927842, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.927847, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.927851, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.927854, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.944420, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.944426, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845467.944430, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.944434, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.944438, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.944442, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.959239, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.959244, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 683 Event: time 1409845467.959249, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.959253, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.959257, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.959260, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.974974, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.974980, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 685 Event: time 1409845467.974984, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.974988, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.974992, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.974996, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.989318, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.989321, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.989324, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.246567, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.246571, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.246576, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.246580, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.246584, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.246589, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.246592, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.262652, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.262657, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.262662, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.262666, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.262670, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.262673, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.278454, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.278460, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.278464, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.278468, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.278473, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.278476, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.293932, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.293938, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 653 Event: time 1409845468.293942, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.293946, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.293950, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.293953, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.309429, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.309434, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 639 Event: time 1409845468.309438, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 416 Event: time 1409845468.309443, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.309447, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.309450, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.323482, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.323486, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.323489, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.596393, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.596397, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.596402, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.596406, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.596410, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.596414, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.596417, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.612126, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.612132, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.612136, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.612140, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.612144, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.612147, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.628256, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.628262, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.628266, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.628271, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.628275, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.628278, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.644136, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.644142, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.644146, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.644151, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.644155, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.644158, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.659867, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.659873, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.659877, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.659882, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.659886, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.659889, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.673538, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.673541, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.673544, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.946001, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.946005, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.946010, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.946014, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.946018, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.946022, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.946025, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.962071, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.962077, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.962081, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.962085, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.962089, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.962093, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.977741, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.977747, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.977751, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.977755, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.977759, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.977762, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.993678, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.993684, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.993688, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.993692, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.993696, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.993700, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.010083, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.010089, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845469.010093, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.010097, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.010101, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.010104, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.026187, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.026193, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 665 Event: time 1409845469.026197, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.026201, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.026205, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.026209, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.041432, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.041437, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 640 Event: time 1409845469.041442, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.041446, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.041450, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.041453, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.057294, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.057299, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 581 Event: time 1409845469.057304, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.057308, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.057312, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.057315, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.073883, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.073889, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 540 Event: time 1409845469.073893, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.073897, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.073901, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.073905, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.089886, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.089892, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 496 Event: time 1409845469.089896, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.089900, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.089904, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.089908, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.105335, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.105340, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 450 Event: time 1409845469.105344, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.105349, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.105353, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.105356, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.121183, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.121188, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 404 Event: time 1409845469.121192, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.121197, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.121201, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.121204, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.136794, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.136799, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 360 Event: time 1409845469.136803, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.136808, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.136812, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.136815, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.152605, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.152611, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 312 Event: time 1409845469.152615, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.152619, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.152623, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.152626, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.169594, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.169599, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 270 Event: time 1409845469.169604, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 366 Event: time 1409845469.169608, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.169612, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.169615, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.185263, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.185268, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 236 Event: time 1409845469.185273, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 373 Event: time 1409845469.185277, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.185281, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.185284, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.200843, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.200848, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.200853, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.200857, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.200861, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.200864, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 5b966b862324ef05154d6139053caa82b6c1da9e 928 927 2014-09-05T08:58:36Z Gv 356 /* xorg.conf */ wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installe ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/bash su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs that require no X windows worked fine. I ran couple of frame buffer tests too. == Testing the framebuffer == For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. ==== synaptics ==== synaptics driver fails with error message relating to Protocol. xf86-input-synaptics-1.6.1.tar.bz2 ./configure --prefix=/opt/local/sw CFLAGS=-I/opt/local/sw/include/xorg LDFLAGS=-L/opt/local/sw/lib make -j 3 make install When running Xorg, [ 4784.385] (EE) synaptics: mytouchscreen: Synaptics driver unable to detect protocol === Running X === make sure display is on, and From adb shell as su: stop From slackware chroot environment in adb shell [ see section ]: startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Once Finished, from adb shell as su: start === Virtual Keyboard === ==== http://homepage3.nifty.com/tsato/xvkbd/ ==== Download [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], install xmkf make make install and run: xvkbd === Files === ==== xorg.conf ==== <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" # Option "Protocol" "Auto" EndSection </pre> ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> == Running some tests == === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) GV: read 112 Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.148724, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.148730, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.148734, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.148738, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.148742, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.148745, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.164975, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.164981, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.164985, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.164989, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.164994, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.164997, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.180722, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.180727, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.180731, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.180736, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.180740, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.180743, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.196495, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.196501, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.196505, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.196510, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.196514, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.196517, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.211803, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.211809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.211813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.211818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.211822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.211825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.225500, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.225504, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.225507, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.466531, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.466536, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.466540, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.466545, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.466549, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.466553, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.466556, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.482028, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.482033, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.482038, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.482042, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.482046, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.482049, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.497971, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.497977, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.497981, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.497986, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.497990, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.497993, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.514030, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.514036, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.514040, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.514044, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.514048, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.514051, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.530188, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.530194, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.530198, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.530202, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.530206, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.530210, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.545804, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.545809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.545813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.545818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.545822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.545825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.559686, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.559690, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.559693, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.880062, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.880067, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.880072, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.880076, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.880080, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.880084, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.880088, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.895834, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.895839, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.895844, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.895848, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.895852, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.895855, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.911757, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.911762, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.911767, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.911771, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.911775, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.911778, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.927833, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.927838, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 680 Event: time 1409845467.927842, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.927847, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.927851, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.927854, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.944420, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.944426, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845467.944430, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.944434, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.944438, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.944442, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.959239, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.959244, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 683 Event: time 1409845467.959249, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.959253, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.959257, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.959260, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.974974, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.974980, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 685 Event: time 1409845467.974984, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.974988, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.974992, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.974996, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.989318, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.989321, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.989324, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.246567, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.246571, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.246576, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.246580, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.246584, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.246589, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.246592, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.262652, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.262657, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.262662, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.262666, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.262670, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.262673, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.278454, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.278460, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.278464, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.278468, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.278473, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.278476, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.293932, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.293938, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 653 Event: time 1409845468.293942, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.293946, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.293950, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.293953, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.309429, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.309434, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 639 Event: time 1409845468.309438, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 416 Event: time 1409845468.309443, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.309447, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.309450, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.323482, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.323486, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.323489, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.596393, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.596397, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.596402, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.596406, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.596410, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.596414, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.596417, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.612126, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.612132, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.612136, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.612140, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.612144, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.612147, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.628256, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.628262, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.628266, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.628271, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.628275, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.628278, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.644136, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.644142, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.644146, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.644151, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.644155, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.644158, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.659867, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.659873, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.659877, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.659882, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.659886, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.659889, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.673538, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.673541, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.673544, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.946001, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.946005, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.946010, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.946014, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.946018, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.946022, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.946025, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.962071, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.962077, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.962081, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.962085, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.962089, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.962093, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.977741, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.977747, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.977751, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.977755, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.977759, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.977762, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.993678, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.993684, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.993688, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.993692, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.993696, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.993700, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.010083, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.010089, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845469.010093, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.010097, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.010101, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.010104, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.026187, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.026193, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 665 Event: time 1409845469.026197, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.026201, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.026205, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.026209, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.041432, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.041437, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 640 Event: time 1409845469.041442, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.041446, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.041450, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.041453, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.057294, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.057299, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 581 Event: time 1409845469.057304, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.057308, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.057312, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.057315, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.073883, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.073889, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 540 Event: time 1409845469.073893, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.073897, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.073901, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.073905, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.089886, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.089892, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 496 Event: time 1409845469.089896, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.089900, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.089904, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.089908, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.105335, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.105340, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 450 Event: time 1409845469.105344, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.105349, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.105353, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.105356, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.121183, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.121188, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 404 Event: time 1409845469.121192, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.121197, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.121201, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.121204, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.136794, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.136799, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 360 Event: time 1409845469.136803, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.136808, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.136812, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.136815, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.152605, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.152611, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 312 Event: time 1409845469.152615, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.152619, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.152623, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.152626, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.169594, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.169599, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 270 Event: time 1409845469.169604, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 366 Event: time 1409845469.169608, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.169612, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.169615, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.185263, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.185268, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 236 Event: time 1409845469.185273, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 373 Event: time 1409845469.185277, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.185281, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.185284, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.200843, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.200848, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.200853, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.200857, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.200861, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.200864, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 22299b221faabcd27fe0de7cf0981bd57189f3d2 929 928 2014-09-05T09:00:58Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installe ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/bash su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs that require no X windows worked fine. I ran couple of frame buffer tests too. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. ==== synaptics ==== synaptics driver fails with error message relating to Protocol. xf86-input-synaptics-1.6.1.tar.bz2 ./configure --prefix=/opt/local/sw CFLAGS=-I/opt/local/sw/include/xorg LDFLAGS=-L/opt/local/sw/lib make -j 3 make install When running Xorg, [ 4784.385] (EE) synaptics: mytouchscreen: Synaptics driver unable to detect protocol === Running X === make sure display is on, and From adb shell as su: stop From slackware chroot environment in adb shell [ see section ]: startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Once Finished, from adb shell as su: start === Virtual Keyboard === ==== http://homepage3.nifty.com/tsato/xvkbd/ ==== Download [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], install xmkf make make install and run: xvkbd === Files === ==== xorg.conf ==== <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" # Option "Protocol" "Auto" EndSection </pre> ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) GV: read 112 Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.148724, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.148730, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.148734, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.148738, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.148742, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.148745, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.164975, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.164981, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.164985, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.164989, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.164994, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.164997, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.180722, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.180727, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.180731, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.180736, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.180740, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.180743, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.196495, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.196501, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.196505, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.196510, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.196514, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.196517, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.211803, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.211809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.211813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.211818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.211822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.211825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.225500, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.225504, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.225507, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.466531, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.466536, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.466540, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.466545, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.466549, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.466553, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.466556, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.482028, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.482033, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.482038, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.482042, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.482046, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.482049, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.497971, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.497977, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.497981, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.497986, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.497990, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.497993, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.514030, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.514036, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.514040, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.514044, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.514048, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.514051, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.530188, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.530194, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.530198, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.530202, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.530206, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.530210, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.545804, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.545809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.545813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.545818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.545822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.545825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.559686, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.559690, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.559693, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.880062, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.880067, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.880072, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.880076, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.880080, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.880084, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.880088, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.895834, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.895839, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.895844, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.895848, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.895852, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.895855, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.911757, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.911762, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.911767, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.911771, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.911775, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.911778, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.927833, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.927838, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 680 Event: time 1409845467.927842, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.927847, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.927851, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.927854, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.944420, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.944426, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845467.944430, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.944434, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.944438, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.944442, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.959239, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.959244, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 683 Event: time 1409845467.959249, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.959253, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.959257, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.959260, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.974974, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.974980, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 685 Event: time 1409845467.974984, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.974988, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.974992, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.974996, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.989318, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.989321, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.989324, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.246567, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.246571, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.246576, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.246580, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.246584, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.246589, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.246592, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.262652, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.262657, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.262662, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.262666, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.262670, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.262673, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.278454, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.278460, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.278464, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.278468, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.278473, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.278476, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.293932, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.293938, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 653 Event: time 1409845468.293942, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.293946, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.293950, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.293953, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.309429, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.309434, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 639 Event: time 1409845468.309438, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 416 Event: time 1409845468.309443, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.309447, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.309450, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.323482, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.323486, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.323489, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.596393, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.596397, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.596402, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.596406, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.596410, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.596414, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.596417, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.612126, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.612132, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.612136, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.612140, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.612144, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.612147, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.628256, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.628262, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.628266, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.628271, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.628275, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.628278, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.644136, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.644142, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.644146, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.644151, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.644155, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.644158, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.659867, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.659873, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.659877, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.659882, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.659886, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.659889, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.673538, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.673541, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.673544, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.946001, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.946005, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.946010, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.946014, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.946018, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.946022, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.946025, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.962071, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.962077, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.962081, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.962085, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.962089, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.962093, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.977741, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.977747, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.977751, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.977755, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.977759, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.977762, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.993678, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.993684, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.993688, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.993692, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.993696, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.993700, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.010083, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.010089, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845469.010093, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.010097, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.010101, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.010104, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.026187, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.026193, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 665 Event: time 1409845469.026197, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.026201, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.026205, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.026209, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.041432, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.041437, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 640 Event: time 1409845469.041442, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.041446, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.041450, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.041453, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.057294, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.057299, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 581 Event: time 1409845469.057304, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.057308, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.057312, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.057315, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.073883, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.073889, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 540 Event: time 1409845469.073893, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.073897, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.073901, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.073905, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.089886, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.089892, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 496 Event: time 1409845469.089896, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.089900, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.089904, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.089908, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.105335, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.105340, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 450 Event: time 1409845469.105344, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.105349, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.105353, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.105356, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.121183, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.121188, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 404 Event: time 1409845469.121192, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.121197, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.121201, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.121204, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.136794, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.136799, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 360 Event: time 1409845469.136803, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.136808, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.136812, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.136815, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.152605, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.152611, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 312 Event: time 1409845469.152615, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.152619, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.152623, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.152626, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.169594, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.169599, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 270 Event: time 1409845469.169604, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 366 Event: time 1409845469.169608, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.169612, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.169615, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.185263, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.185268, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 236 Event: time 1409845469.185273, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 373 Event: time 1409845469.185277, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.185281, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.185284, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.200843, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.200848, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.200853, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.200857, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.200861, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.200864, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 118c457c9d9f3964a1ae18eb009c5d4768dbf1de 930 929 2014-09-05T09:26:26Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? [http://s28.postimg.org/bco3gbdgt/ss2.png Screenshot] of X windows running. == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installe ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/bash su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs that require no X windows worked fine. I ran couple of frame buffer tests too. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. ==== synaptics ==== synaptics driver fails with error message relating to Protocol. xf86-input-synaptics-1.6.1.tar.bz2 ./configure --prefix=/opt/local/sw CFLAGS=-I/opt/local/sw/include/xorg LDFLAGS=-L/opt/local/sw/lib make -j 3 make install When running Xorg, [ 4784.385] (EE) synaptics: mytouchscreen: Synaptics driver unable to detect protocol === Running X === make sure display is on, and From adb shell as su: stop From slackware chroot environment in adb shell [ see section ]: startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Once Finished, from adb shell as su: start === Virtual Keyboard === ==== http://homepage3.nifty.com/tsato/xvkbd/ ==== Download [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], install xmkf make make install and run: xvkbd === Files === ==== xorg.conf ==== <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" # Option "Protocol" "Auto" EndSection </pre> ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) GV: read 112 Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.148724, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.148730, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.148734, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.148738, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.148742, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.148745, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.164975, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.164981, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.164985, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.164989, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.164994, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.164997, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.180722, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.180727, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.180731, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.180736, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.180740, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.180743, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.196495, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.196501, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.196505, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.196510, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.196514, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.196517, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.211803, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.211809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.211813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.211818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.211822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.211825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.225500, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.225504, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.225507, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.466531, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.466536, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.466540, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.466545, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.466549, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.466553, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.466556, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.482028, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.482033, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.482038, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.482042, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.482046, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.482049, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.497971, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.497977, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.497981, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.497986, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.497990, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.497993, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.514030, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.514036, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.514040, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.514044, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.514048, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.514051, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.530188, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.530194, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.530198, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.530202, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.530206, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.530210, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.545804, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.545809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.545813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.545818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.545822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.545825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.559686, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.559690, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.559693, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.880062, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.880067, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.880072, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.880076, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.880080, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.880084, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.880088, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.895834, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.895839, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.895844, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.895848, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.895852, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.895855, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.911757, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.911762, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.911767, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.911771, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.911775, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.911778, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.927833, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.927838, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 680 Event: time 1409845467.927842, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.927847, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.927851, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.927854, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.944420, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.944426, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845467.944430, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.944434, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.944438, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.944442, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.959239, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.959244, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 683 Event: time 1409845467.959249, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.959253, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.959257, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.959260, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.974974, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.974980, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 685 Event: time 1409845467.974984, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.974988, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.974992, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.974996, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.989318, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.989321, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.989324, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.246567, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.246571, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.246576, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.246580, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.246584, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.246589, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.246592, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.262652, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.262657, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.262662, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.262666, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.262670, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.262673, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.278454, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.278460, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.278464, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.278468, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.278473, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.278476, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.293932, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.293938, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 653 Event: time 1409845468.293942, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.293946, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.293950, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.293953, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.309429, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.309434, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 639 Event: time 1409845468.309438, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 416 Event: time 1409845468.309443, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.309447, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.309450, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.323482, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.323486, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.323489, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.596393, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.596397, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.596402, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.596406, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.596410, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.596414, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.596417, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.612126, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.612132, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.612136, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.612140, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.612144, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.612147, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.628256, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.628262, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.628266, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.628271, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.628275, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.628278, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.644136, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.644142, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.644146, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.644151, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.644155, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.644158, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.659867, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.659873, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.659877, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.659882, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.659886, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.659889, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.673538, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.673541, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.673544, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.946001, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.946005, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.946010, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.946014, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.946018, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.946022, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.946025, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.962071, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.962077, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.962081, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.962085, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.962089, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.962093, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.977741, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.977747, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.977751, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.977755, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.977759, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.977762, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.993678, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.993684, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.993688, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.993692, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.993696, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.993700, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.010083, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.010089, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845469.010093, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.010097, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.010101, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.010104, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.026187, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.026193, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 665 Event: time 1409845469.026197, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.026201, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.026205, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.026209, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.041432, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.041437, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 640 Event: time 1409845469.041442, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.041446, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.041450, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.041453, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.057294, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.057299, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 581 Event: time 1409845469.057304, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.057308, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.057312, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.057315, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.073883, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.073889, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 540 Event: time 1409845469.073893, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.073897, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.073901, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.073905, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.089886, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.089892, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 496 Event: time 1409845469.089896, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.089900, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.089904, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.089908, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.105335, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.105340, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 450 Event: time 1409845469.105344, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.105349, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.105353, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.105356, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.121183, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.121188, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 404 Event: time 1409845469.121192, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.121197, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.121201, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.121204, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.136794, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.136799, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 360 Event: time 1409845469.136803, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.136808, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.136812, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.136815, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.152605, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.152611, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 312 Event: time 1409845469.152615, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.152619, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.152623, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.152626, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.169594, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.169599, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 270 Event: time 1409845469.169604, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 366 Event: time 1409845469.169608, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.169612, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.169615, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.185263, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.185268, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 236 Event: time 1409845469.185273, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 373 Event: time 1409845469.185277, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.185281, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.185284, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.200843, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.200848, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.200853, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.200857, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.200861, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.200864, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> ee956f81c902daa269ddb1f800428bd6a16338ca 931 930 2014-09-05T10:01:50Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? [http://s28.postimg.org/bco3gbdgt/ss2.png Screenshot] of X windows running. == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installe ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/bash su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs that require no X windows worked fine. I ran couple of frame buffer tests too. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. ==== synaptics ==== synaptics driver fails with error message relating to Protocol. xf86-input-synaptics-1.6.1.tar.bz2 ./configure --prefix=/opt/local/sw CFLAGS=-I/opt/local/sw/include/xorg LDFLAGS=-L/opt/local/sw/lib make -j 3 make install When running Xorg, [ 4784.385] (EE) synaptics: mytouchscreen: Synaptics driver unable to detect protocol === Running X === make sure display is on, and From adb shell as su: stop From slackware chroot environment in adb shell [ see section ]: startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Once Finished, from adb shell as su: start === Virtual Keyboard === ==== http://homepage3.nifty.com/tsato/xvkbd/ ==== Download [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], install xmkf make make install and run: xvkbd === An application launcher === ==== http://bbdock.nethence.com/ ==== Download and install [http://bbdock.nethence.com/download/bbdock-0.2.9.tar.gz bbdock-0.2.9.tar.gz] or [http://bbdock.nethence.com/download/ download] .bbdockrc sample : /root/icons/xterm-color.png:xterm::1 Launch bbdock === Files === ==== xorg.conf ==== <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" # Option "Protocol" "Auto" EndSection </pre> ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) GV: read 112 Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.148724, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.148730, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.148734, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.148738, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.148742, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.148745, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.164975, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.164981, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.164985, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.164989, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.164994, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.164997, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.180722, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.180727, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.180731, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.180736, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.180740, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.180743, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.196495, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.196501, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.196505, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.196510, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.196514, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.196517, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.211803, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.211809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.211813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.211818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.211822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.211825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.225500, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.225504, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.225507, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.466531, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.466536, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.466540, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.466545, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.466549, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.466553, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.466556, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.482028, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.482033, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.482038, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.482042, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.482046, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.482049, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.497971, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.497977, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.497981, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.497986, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.497990, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.497993, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.514030, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.514036, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.514040, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.514044, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.514048, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.514051, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.530188, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.530194, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.530198, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.530202, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.530206, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.530210, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.545804, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.545809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.545813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.545818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.545822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.545825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.559686, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.559690, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.559693, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.880062, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.880067, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.880072, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.880076, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.880080, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.880084, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.880088, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.895834, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.895839, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.895844, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.895848, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.895852, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.895855, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.911757, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.911762, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.911767, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.911771, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.911775, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.911778, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.927833, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.927838, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 680 Event: time 1409845467.927842, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.927847, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.927851, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.927854, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.944420, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.944426, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845467.944430, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.944434, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.944438, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.944442, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.959239, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.959244, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 683 Event: time 1409845467.959249, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.959253, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.959257, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.959260, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.974974, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.974980, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 685 Event: time 1409845467.974984, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.974988, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.974992, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.974996, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.989318, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.989321, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.989324, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.246567, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.246571, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.246576, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.246580, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.246584, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.246589, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.246592, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.262652, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.262657, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.262662, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.262666, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.262670, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.262673, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.278454, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.278460, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.278464, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.278468, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.278473, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.278476, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.293932, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.293938, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 653 Event: time 1409845468.293942, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.293946, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.293950, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.293953, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.309429, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.309434, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 639 Event: time 1409845468.309438, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 416 Event: time 1409845468.309443, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.309447, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.309450, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.323482, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.323486, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.323489, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.596393, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.596397, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.596402, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.596406, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.596410, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.596414, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.596417, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.612126, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.612132, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.612136, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.612140, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.612144, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.612147, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.628256, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.628262, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.628266, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.628271, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.628275, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.628278, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.644136, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.644142, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.644146, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.644151, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.644155, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.644158, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.659867, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.659873, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.659877, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.659882, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.659886, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.659889, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.673538, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.673541, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.673544, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.946001, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.946005, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.946010, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.946014, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.946018, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.946022, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.946025, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.962071, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.962077, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.962081, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.962085, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.962089, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.962093, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.977741, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.977747, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.977751, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.977755, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.977759, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.977762, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.993678, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.993684, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.993688, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.993692, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.993696, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.993700, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.010083, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.010089, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845469.010093, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.010097, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.010101, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.010104, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.026187, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.026193, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 665 Event: time 1409845469.026197, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.026201, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.026205, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.026209, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.041432, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.041437, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 640 Event: time 1409845469.041442, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.041446, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.041450, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.041453, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.057294, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.057299, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 581 Event: time 1409845469.057304, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.057308, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.057312, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.057315, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.073883, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.073889, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 540 Event: time 1409845469.073893, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.073897, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.073901, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.073905, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.089886, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.089892, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 496 Event: time 1409845469.089896, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.089900, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.089904, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.089908, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.105335, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.105340, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 450 Event: time 1409845469.105344, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.105349, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.105353, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.105356, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.121183, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.121188, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 404 Event: time 1409845469.121192, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.121197, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.121201, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.121204, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.136794, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.136799, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 360 Event: time 1409845469.136803, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.136808, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.136812, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.136815, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.152605, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.152611, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 312 Event: time 1409845469.152615, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.152619, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.152623, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.152626, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.169594, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.169599, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 270 Event: time 1409845469.169604, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 366 Event: time 1409845469.169608, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.169612, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.169615, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.185263, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.185268, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 236 Event: time 1409845469.185273, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 373 Event: time 1409845469.185277, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.185281, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.185284, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.200843, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.200848, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.200853, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.200857, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.200861, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.200864, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 511647198205b0280c2a5f7c8057b6cf6970345d 932 931 2014-09-06T09:32:57Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. [http://s7.postimg.org/fww1ibfdn/image.png another one]. == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installe ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs that require no X windows worked fine. I ran couple of frame buffer tests too. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. === Running X === make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Try disown / nohup to keep X running when disconnected from PC. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== http://homepage3.nifty.com/tsato/xvkbd/ ==== Download [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], install xmkf make make install and run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== <pre> i: /opt/local/sw/share/pixmaps/wbar/dock.png c: wbar --bpress --above-desk --hbar --pos bottom --isize 48 --idist 5 --nanim 4 --f alfa 65 t: /10 i: /opt/local/sw/share/pixmaps/wbar/wbar.png c: wbar-config t: Config i: /opt/local/sw/share/icons/wm-icons/32x32-gant/terminal.png c: xterm t: Xterm i: /opt/local/sw/share/icons/wm-icons/32x32-gant/keyboard.png c: xvkbd -compact -no-repeat -geometry 800x200 t: Xvkbd i: /opt/local/sw/share/icons/wm-icons/32x32-gant/calculator.png c: xcalc t: XCalc i: /opt/local/sw/share/icons/wm-icons/32x32-gant/restart.png c: /system/bin/start t: Backto Android i: /opt/local/sw/share/icons/wm-icons/32x32-gant/window-close.png c: xkill t: XKill </pre> === Files === ==== xorg.conf ==== <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" # Option "Protocol" "Auto" EndSection </pre> ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) GV: read 112 Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.148724, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.148730, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.148734, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.148738, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.148742, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.148745, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.164975, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.164981, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.164985, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.164989, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.164994, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.164997, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.180722, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.180727, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.180731, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.180736, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.180740, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.180743, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.196495, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.196501, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.196505, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.196510, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.196514, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.196517, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.211803, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.211809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.211813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.211818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.211822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.211825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.225500, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.225504, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.225507, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.466531, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.466536, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.466540, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.466545, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.466549, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.466553, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.466556, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.482028, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.482033, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.482038, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.482042, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.482046, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.482049, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.497971, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.497977, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.497981, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.497986, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.497990, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.497993, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.514030, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.514036, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.514040, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.514044, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.514048, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.514051, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.530188, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.530194, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.530198, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.530202, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.530206, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.530210, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.545804, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.545809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.545813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.545818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.545822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.545825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.559686, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.559690, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.559693, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.880062, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.880067, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.880072, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.880076, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.880080, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.880084, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.880088, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.895834, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.895839, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.895844, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.895848, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.895852, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.895855, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.911757, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.911762, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.911767, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.911771, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.911775, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.911778, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.927833, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.927838, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 680 Event: time 1409845467.927842, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.927847, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.927851, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.927854, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.944420, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.944426, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845467.944430, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.944434, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.944438, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.944442, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.959239, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.959244, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 683 Event: time 1409845467.959249, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.959253, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.959257, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.959260, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.974974, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.974980, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 685 Event: time 1409845467.974984, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.974988, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.974992, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.974996, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.989318, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.989321, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.989324, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.246567, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.246571, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.246576, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.246580, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.246584, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.246589, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.246592, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.262652, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.262657, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.262662, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.262666, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.262670, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.262673, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.278454, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.278460, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.278464, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.278468, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.278473, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.278476, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.293932, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.293938, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 653 Event: time 1409845468.293942, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.293946, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.293950, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.293953, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.309429, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.309434, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 639 Event: time 1409845468.309438, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 416 Event: time 1409845468.309443, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.309447, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.309450, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.323482, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.323486, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.323489, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.596393, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.596397, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.596402, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.596406, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.596410, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.596414, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.596417, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.612126, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.612132, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.612136, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.612140, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.612144, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.612147, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.628256, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.628262, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.628266, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.628271, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.628275, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.628278, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.644136, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.644142, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.644146, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.644151, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.644155, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.644158, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.659867, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.659873, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.659877, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.659882, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.659886, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.659889, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.673538, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.673541, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.673544, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.946001, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.946005, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.946010, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.946014, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.946018, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.946022, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.946025, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.962071, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.962077, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.962081, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.962085, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.962089, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.962093, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.977741, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.977747, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.977751, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.977755, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.977759, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.977762, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.993678, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.993684, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.993688, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.993692, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.993696, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.993700, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.010083, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.010089, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845469.010093, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.010097, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.010101, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.010104, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.026187, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.026193, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 665 Event: time 1409845469.026197, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.026201, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.026205, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.026209, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.041432, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.041437, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 640 Event: time 1409845469.041442, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.041446, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.041450, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.041453, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.057294, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.057299, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 581 Event: time 1409845469.057304, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.057308, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.057312, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.057315, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.073883, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.073889, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 540 Event: time 1409845469.073893, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.073897, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.073901, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.073905, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.089886, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.089892, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 496 Event: time 1409845469.089896, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.089900, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.089904, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.089908, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.105335, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.105340, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 450 Event: time 1409845469.105344, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.105349, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.105353, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.105356, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.121183, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.121188, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 404 Event: time 1409845469.121192, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.121197, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.121201, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.121204, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.136794, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.136799, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 360 Event: time 1409845469.136803, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.136808, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.136812, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.136815, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.152605, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.152611, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 312 Event: time 1409845469.152615, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.152619, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.152623, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.152626, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.169594, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.169599, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 270 Event: time 1409845469.169604, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 366 Event: time 1409845469.169608, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.169612, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.169615, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.185263, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.185268, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 236 Event: time 1409845469.185273, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 373 Event: time 1409845469.185277, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.185281, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.185284, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.200843, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.200848, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.200853, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.200857, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.200861, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.200864, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> ec44800c86ce59ca0b0f407b699ee8bf9372fc62 933 932 2014-09-06T09:36:47Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. [http://s7.postimg.org/fww1ibfdn/image.png another one]. == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installe ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs. I ran couple of frame buffer tests too. Fortunately, removing the VT requirement from Xorg was pretty simple. Here is how it was done. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. === Running X === make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Try disown / nohup to keep X running when disconnected from PC. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== http://homepage3.nifty.com/tsato/xvkbd/ ==== Download [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], install xmkf make make install and run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== <pre> i: /opt/local/sw/share/pixmaps/wbar/dock.png c: wbar --bpress --above-desk --hbar --pos bottom --isize 48 --idist 5 --nanim 4 --f alfa 65 t: /10 i: /opt/local/sw/share/pixmaps/wbar/wbar.png c: wbar-config t: Config i: /opt/local/sw/share/icons/wm-icons/32x32-gant/terminal.png c: xterm t: Xterm i: /opt/local/sw/share/icons/wm-icons/32x32-gant/keyboard.png c: xvkbd -compact -no-repeat -geometry 800x200 t: Xvkbd i: /opt/local/sw/share/icons/wm-icons/32x32-gant/calculator.png c: xcalc t: XCalc i: /opt/local/sw/share/icons/wm-icons/32x32-gant/restart.png c: /system/bin/start t: Backto Android i: /opt/local/sw/share/icons/wm-icons/32x32-gant/window-close.png c: xkill t: XKill </pre> === Files === ==== xorg.conf ==== <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" # Option "Protocol" "Auto" EndSection </pre> ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) GV: read 112 Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.148724, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.148730, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.148734, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.148738, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.148742, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.148745, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.164975, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.164981, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.164985, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.164989, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.164994, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.164997, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.180722, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.180727, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.180731, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.180736, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.180740, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.180743, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.196495, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.196501, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.196505, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.196510, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.196514, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.196517, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.211803, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.211809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.211813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.211818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.211822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.211825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.225500, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.225504, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.225507, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.466531, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.466536, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.466540, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.466545, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.466549, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.466553, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.466556, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.482028, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.482033, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.482038, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.482042, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.482046, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.482049, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.497971, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.497977, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.497981, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.497986, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.497990, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.497993, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.514030, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.514036, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.514040, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.514044, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.514048, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.514051, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.530188, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.530194, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.530198, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.530202, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.530206, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.530210, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.545804, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.545809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.545813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.545818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.545822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.545825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.559686, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.559690, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.559693, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.880062, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.880067, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.880072, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.880076, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.880080, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.880084, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.880088, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.895834, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.895839, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.895844, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.895848, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.895852, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.895855, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.911757, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.911762, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.911767, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.911771, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.911775, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.911778, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.927833, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.927838, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 680 Event: time 1409845467.927842, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.927847, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.927851, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.927854, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.944420, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.944426, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845467.944430, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.944434, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.944438, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.944442, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.959239, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.959244, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 683 Event: time 1409845467.959249, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.959253, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.959257, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.959260, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.974974, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.974980, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 685 Event: time 1409845467.974984, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.974988, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.974992, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.974996, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.989318, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.989321, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.989324, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.246567, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.246571, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.246576, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.246580, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.246584, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.246589, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.246592, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.262652, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.262657, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.262662, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.262666, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.262670, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.262673, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.278454, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.278460, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.278464, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.278468, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.278473, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.278476, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.293932, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.293938, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 653 Event: time 1409845468.293942, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.293946, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.293950, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.293953, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.309429, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.309434, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 639 Event: time 1409845468.309438, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 416 Event: time 1409845468.309443, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.309447, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.309450, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.323482, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.323486, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.323489, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.596393, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.596397, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.596402, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.596406, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.596410, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.596414, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.596417, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.612126, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.612132, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.612136, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.612140, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.612144, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.612147, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.628256, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.628262, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.628266, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.628271, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.628275, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.628278, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.644136, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.644142, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.644146, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.644151, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.644155, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.644158, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.659867, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.659873, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.659877, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.659882, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.659886, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.659889, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.673538, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.673541, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.673544, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.946001, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.946005, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.946010, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.946014, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.946018, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.946022, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.946025, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.962071, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.962077, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.962081, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.962085, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.962089, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.962093, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.977741, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.977747, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.977751, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.977755, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.977759, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.977762, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.993678, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.993684, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.993688, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.993692, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.993696, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.993700, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.010083, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.010089, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845469.010093, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.010097, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.010101, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.010104, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.026187, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.026193, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 665 Event: time 1409845469.026197, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.026201, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.026205, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.026209, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.041432, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.041437, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 640 Event: time 1409845469.041442, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.041446, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.041450, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.041453, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.057294, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.057299, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 581 Event: time 1409845469.057304, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.057308, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.057312, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.057315, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.073883, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.073889, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 540 Event: time 1409845469.073893, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.073897, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.073901, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.073905, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.089886, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.089892, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 496 Event: time 1409845469.089896, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.089900, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.089904, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.089908, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.105335, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.105340, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 450 Event: time 1409845469.105344, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.105349, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.105353, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.105356, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.121183, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.121188, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 404 Event: time 1409845469.121192, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.121197, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.121201, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.121204, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.136794, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.136799, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 360 Event: time 1409845469.136803, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.136808, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.136812, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.136815, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.152605, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.152611, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 312 Event: time 1409845469.152615, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.152619, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.152623, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.152626, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.169594, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.169599, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 270 Event: time 1409845469.169604, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 366 Event: time 1409845469.169608, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.169612, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.169615, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.185263, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.185268, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 236 Event: time 1409845469.185273, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 373 Event: time 1409845469.185277, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.185281, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.185284, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.200843, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.200848, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.200853, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.200857, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.200861, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.200864, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> ba72f9d162b85a48ea071c9c403fe12e7ede3ade 934 933 2014-09-06T09:41:11Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. [http://s15.postimg.org/izdxddkqj/image.png another one]. == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1 - sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installe ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs. I ran couple of frame buffer tests too. Fortunately, removing the VT requirement from Xorg was pretty simple. Here is how it was done. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. === Running X === make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Try disown / nohup to keep X running when disconnected from PC. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== http://homepage3.nifty.com/tsato/xvkbd/ ==== Download [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], install xmkf make make install and run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== <pre> i: /opt/local/sw/share/pixmaps/wbar/dock.png c: wbar --bpress --above-desk --hbar --pos bottom --isize 48 --idist 5 --nanim 4 --f alfa 65 t: /10 i: /opt/local/sw/share/pixmaps/wbar/wbar.png c: wbar-config t: Config i: /opt/local/sw/share/icons/wm-icons/32x32-gant/terminal.png c: xterm t: Xterm i: /opt/local/sw/share/icons/wm-icons/32x32-gant/keyboard.png c: xvkbd -compact -no-repeat -geometry 800x200 t: Xvkbd i: /opt/local/sw/share/icons/wm-icons/32x32-gant/calculator.png c: xcalc t: XCalc i: /opt/local/sw/share/icons/wm-icons/32x32-gant/restart.png c: /system/bin/start t: Backto Android i: /opt/local/sw/share/icons/wm-icons/32x32-gant/window-close.png c: xkill t: XKill </pre> === Files === ==== xorg.conf ==== <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" # Option "Protocol" "Auto" EndSection </pre> ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) GV: read 112 Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.148724, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.148730, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.148734, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.148738, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.148742, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.148745, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.164975, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.164981, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.164985, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.164989, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.164994, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.164997, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.180722, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.180727, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.180731, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.180736, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.180740, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.180743, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.196495, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.196501, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.196505, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.196510, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.196514, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.196517, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.211803, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.211809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.211813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.211818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.211822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.211825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.225500, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.225504, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.225507, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.466531, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.466536, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.466540, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.466545, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.466549, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.466553, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.466556, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.482028, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.482033, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.482038, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.482042, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.482046, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.482049, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.497971, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.497977, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.497981, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.497986, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.497990, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.497993, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.514030, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.514036, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.514040, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.514044, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.514048, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.514051, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.530188, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.530194, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.530198, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.530202, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.530206, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.530210, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.545804, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.545809, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 341 Event: time 1409845467.545813, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 151 Event: time 1409845467.545818, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.545822, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.545825, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.559686, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.559690, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.559693, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845467.880062, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.880067, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.880072, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.880076, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.880080, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.880084, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.880088, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.895834, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.895839, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.895844, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.895848, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.895852, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.895855, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.911757, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.911762, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 678 Event: time 1409845467.911767, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 130 Event: time 1409845467.911771, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.911775, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.911778, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.927833, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.927838, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 680 Event: time 1409845467.927842, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.927847, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.927851, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.927854, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.944420, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.944426, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845467.944430, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.944434, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.944438, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.944442, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.959239, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.959244, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 683 Event: time 1409845467.959249, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.959253, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.959257, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.959260, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845467.974974, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.974980, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 685 Event: time 1409845467.974984, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 129 Event: time 1409845467.974988, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.974992, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.974996, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845467.989318, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845467.989321, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.989324, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.246567, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.246571, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.246576, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.246580, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.246584, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.246589, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.246592, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.262652, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.262657, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.262662, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.262666, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.262670, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.262673, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.278454, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.278460, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 659 Event: time 1409845468.278464, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.278468, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.278473, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.278476, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.293932, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.293938, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 653 Event: time 1409845468.293942, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 419 Event: time 1409845468.293946, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.293950, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.293953, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.309429, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.309434, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 639 Event: time 1409845468.309438, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 416 Event: time 1409845468.309443, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.309447, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.309450, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.323482, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.323486, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.323489, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.596393, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.596397, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.596402, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.596406, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.596410, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.596414, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.596417, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.612126, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.612132, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.612136, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.612140, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.612144, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.612147, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.628256, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.628262, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.628266, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.628271, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.628275, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.628278, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.644136, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.644142, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.644146, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.644151, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.644155, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.644158, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.659867, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.659873, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 226 Event: time 1409845468.659877, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 302 Event: time 1409845468.659882, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.659886, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.659889, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845468.673538, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845468.673541, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.673544, -------------- SYN_REPORT ------------ GV: read 112 Event: time 1409845468.946001, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845468.946005, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.946010, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.946014, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.946018, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.946022, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.946025, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.962071, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.962077, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.962081, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.962085, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.962089, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.962093, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.977741, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.977747, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.977751, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.977755, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.977759, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.977762, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845468.993678, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845468.993684, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845468.993688, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845468.993692, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845468.993696, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845468.993700, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.010083, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.010089, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 681 Event: time 1409845469.010093, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.010097, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.010101, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.010104, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.026187, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.026193, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 665 Event: time 1409845469.026197, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.026201, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.026205, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.026209, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.041432, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.041437, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 640 Event: time 1409845469.041442, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 357 Event: time 1409845469.041446, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.041450, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.041453, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.057294, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.057299, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 581 Event: time 1409845469.057304, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.057308, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.057312, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.057315, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.073883, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.073889, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 540 Event: time 1409845469.073893, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.073897, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.073901, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.073905, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.089886, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.089892, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 496 Event: time 1409845469.089896, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.089900, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.089904, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.089908, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.105335, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.105340, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 450 Event: time 1409845469.105344, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 364 Event: time 1409845469.105349, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.105353, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.105356, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.121183, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.121188, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 404 Event: time 1409845469.121192, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.121197, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.121201, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.121204, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.136794, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.136799, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 360 Event: time 1409845469.136803, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.136808, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.136812, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.136815, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.152605, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.152611, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 312 Event: time 1409845469.152615, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 360 Event: time 1409845469.152619, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.152623, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.152626, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.169594, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.169599, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 270 Event: time 1409845469.169604, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 366 Event: time 1409845469.169608, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.169612, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.169615, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.185263, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.185268, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 236 Event: time 1409845469.185273, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 373 Event: time 1409845469.185277, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.185281, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.185284, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.200843, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.200848, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.200853, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.200857, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.200861, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.200864, -------------- SYN_REPORT ------------ GV: read 96 Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ GV: read 48 Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> a4479a4567df9b3fdf4830a2cfd3e545e2960c3d 935 934 2014-09-06T09:54:35Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. And [http://s15.postimg.org/izdxddkqj/image.png another one]. == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1, sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installer ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs. I ran couple of frame buffer tests too. Fortunately, removing the VT requirement from Xorg was pretty simple. Here is how it was done. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. === Running X === make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Try disown / nohup to keep X running when disconnected from PC. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== xvkbd ==== Download [http://homepage3.nifty.com/tsato/xvkbd/ xvkbd] from [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], and install: xmkf make make install Run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== <pre> i: /opt/local/sw/share/pixmaps/wbar/dock.png c: wbar --bpress --above-desk --hbar --pos bottom --isize 48 --idist 5 --nanim 4 --f alfa 65 t: /10 i: /opt/local/sw/share/pixmaps/wbar/wbar.png c: wbar-config t: Config i: /opt/local/sw/share/icons/wm-icons/32x32-gant/terminal.png c: xterm t: Xterm i: /opt/local/sw/share/icons/wm-icons/32x32-gant/keyboard.png c: xvkbd -compact -no-repeat -geometry 800x200 t: Xvkbd i: /opt/local/sw/share/icons/wm-icons/32x32-gant/calculator.png c: xcalc t: XCalc i: /opt/local/sw/share/icons/wm-icons/32x32-gant/restart.png c: /system/bin/start t: Backto Android i: /opt/local/sw/share/icons/wm-icons/32x32-gant/window-close.png c: xkill t: XKill </pre> === Files === ==== xorg.conf ==== <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" # Option "Protocol" "Auto" EndSection </pre> ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ ... Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 0494c5b49dffcaa819a425093bb508e214a44475 936 935 2014-09-07T05:12:09Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. And [http://s15.postimg.org/izdxddkqj/image.png another one]. == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1, sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installer ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs. I ran couple of frame buffer tests too. Fortunately, removing the VT requirement from Xorg was pretty simple. Here is how it was done. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. === Running X === make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Try disown / nohup to keep X running when disconnected from PC. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== xvkbd ==== Download [http://homepage3.nifty.com/tsato/xvkbd/ xvkbd] from [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], and install: xmkf make make install Run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== <pre> i: /opt/local/sw/share/pixmaps/wbar/dock.png c: wbar --bpress --above-desk --pos bottom --isize 48 --idist 5 --nanim 4 --falfa 65 t: /10 i: /opt/local/sw/share/pixmaps/wbar/wbar.png c: wbar-config t: Config i: /opt/local/sw/share/icons/wm-icons/32x32-gant/terminal.png c: xterm t: Xterm i: /opt/local/sw/share/icons/wm-icons/32x32-gant/keyboard.png c: xvkbd -compact -no-repeat -geometry 800x200 t: Xvkbd i: /opt/local/sw/share/icons/wm-icons/32x32-gant/calculator.png c: xcalc t: XCalc i: /opt/local/sw/share/icons/wm-icons/32x32-gant/restart.png c: LD_LIBRARY_PATH= /system/bin/sh /android.tmp/exitfromslackware.sh t: Backto Android i: /opt/local/sw/share/icons/wm-icons/32x32-gant/window-close.png c: sleep 1 && xkill t: XKill </pre> == Android app to launch X Windows directly from Android == === Create StartX projec === Check [https://www.github.com/gv3/StartX StartX] project at github Create a project: android create project -n StartX -k com.startx.android -a StartXActivity -t 1 -p . Copy StartXActivity.java to src/com/startx/android If required, keytool -genkey -v -keystore gv.keystore \ -alias gv_ks -keyalg RSA -keysize 2048 -validity 10000 Add to project properties: key.store=./gv.keystore key.alias=gv_ks Build and install: ant release install ==== StartXActivity.java ==== <pre> // http://stackoverflow.com/questions/20932102/execute-shell-command-from-android package com.startx.android; import java.lang.*; import java.io.* ; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class StartXActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Process p=null; try { TextView text = new TextView(this); text.setText("Starting X Windows...\n"); setContentView(text); Process su = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(su.getOutputStream()); os.writeBytes("sh /data/local/tmp/chroot2slackware.sh\n"); text.append("done\n"); os.flush(); os.writeBytes("exit\n"); text.append("exit\n"); os.flush(); try { su.waitFor(); } catch(Exception e2) { e2.printStackTrace(); } } catch (IOException e) { e.printStackTrace(); } finally { if(p!=null) p.destroy(); } } } </pre> ==== chroot2slackware.sh ==== Copy this file to /data/local/tmp/ <pre> #!/system/bin/sh export PATH=/data/local/tmp/bin:$PATH test -d /data/local/tmp/sdcard || mkdir /data/local/tmp/sdcard mountpoint /data/local/tmp/sdcard || mount -t ext4 /dev/block/mmcblk1p1 /data/local/tmp/sdcard test -d /data/local/tmp/slackware || mkdir /data/local/tmp/slackware cd /data/local/tmp/slackware for d in sys proc dev system usr bin sbin \ etc tmp boot home root lib \ media mnt opt run sbin srv var android.tmp ; do test -d $d || mkdir $d case $d in proc) mountpoint proc || mount -t proc none proc/ ;; sys) mountpoint sys || mount -t sysfs sys sys/ ;; dev) mountpoint dev || mount -o bind /dev dev/ ;; system) mountpoint system || mount -o bind /system system ;; android.tmp) mountpoint android.tmp || mount -o bind /data/local/tmp android.tmp ;; *) mountpoint $d || mount -o bind /data/local/tmp/sdcard/$d $d ;; esac done export PATH=/usr/bin:/bin:/usr/X11R6/bin:$PATH # chroot . /bin/su - # if non interactive # test -z $PS1 || test -x /data/local/tmp/sdcard/init && chroot . su - -c /init # if interactive # test -z $PS1 && chroot . su - chroot . /bin/bash -x <<'EOF' su - LD_LIBRARY_PATH= /system/bin/setprop ctl.stop surfaceflinger export PATH=/opt/local/sw/bin:/usr/bin:/bin:$PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:/usr/lib:$LD_LIBRARY_PATH killall -9 Xorg sleep 1 # /usr/bin/startx -- /opt/local/sw/bin/Xorg :0 /usr/bin/xinit -- /opt/local/sw/bin/Xorg :0 wait EOF </pre> ==== exitfromslackware.sh ==== This file is called when "Back to Android" wbar button is touched. It doesn't unmount partitions as expected, though Copy this file to /data/local/tmp/ <pre> #/system/bin/sh export PATH=/data/local/tmp/bin:$PATH killall -9 fluxbox killall -9 Xorg killall -9 wbar cd /data/local/tmp/slackware for d in sys proc dev system usr bin sbin etc \ tmp boot home root init lib media mnt opt \ run sbin srv var android.tmp; do echo "umounting $d" mountpoint $d && umount $d done mountpoint /data/local/tmp/sdcard && umount /data/local/tmp/sdcard # setprop ctl.start is not working. # LD_LIBRARY_PATH= /system/bin/setprop ctl.start surfaceflinger LD_LIBRARY_PATH= /system/bin/stop LD_LIBRARY_PATH= /system/bin/start </pre> == Files == === xorg.conf === <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" # Option "Protocol" "Auto" EndSection </pre> === lnx_init.c patch === <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ ... Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> ffbae9f927ae74e22a01adaa9ef95b99655ecf4d 937 936 2014-09-07T05:18:19Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. And [http://s15.postimg.org/izdxddkqj/image.png another one]. == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1, sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installer ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs. I ran couple of frame buffer tests too. Fortunately, removing the VT requirement from Xorg was pretty simple. Here is how it was done. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> ==== Compiling xorg-server-1.12.2 ==== cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. ==== xorg.conf ==== Copy this file to /etc/X11 <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" # Option "Protocol" "Auto" EndSection </pre> === Running X === make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Try disown / nohup to keep X running when disconnected from PC. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== xvkbd ==== Download [http://homepage3.nifty.com/tsato/xvkbd/ xvkbd] from [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], and install: xmkf make make install Run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== <pre> i: /opt/local/sw/share/pixmaps/wbar/dock.png c: wbar --bpress --above-desk --pos bottom --isize 48 --idist 5 --nanim 4 --falfa 65 t: /10 i: /opt/local/sw/share/pixmaps/wbar/wbar.png c: wbar-config t: Config i: /opt/local/sw/share/icons/wm-icons/32x32-gant/terminal.png c: xterm t: Xterm i: /opt/local/sw/share/icons/wm-icons/32x32-gant/keyboard.png c: xvkbd -compact -no-repeat -geometry 800x200 t: Xvkbd i: /opt/local/sw/share/icons/wm-icons/32x32-gant/calculator.png c: xcalc t: XCalc i: /opt/local/sw/share/icons/wm-icons/32x32-gant/restart.png c: LD_LIBRARY_PATH= /system/bin/sh /android.tmp/exitfromslackware.sh t: Backto Android i: /opt/local/sw/share/icons/wm-icons/32x32-gant/window-close.png c: sleep 1 && xkill t: XKill </pre> == Android app to launch X Windows directly from Android == === Create StartX projec === Check [https://www.github.com/gv3/StartX StartX] project at github Create a project: android create project -n StartX -k com.startx.android -a StartXActivity -t 1 -p . Copy StartXActivity.java to src/com/startx/android If required, keytool -genkey -v -keystore gv.keystore \ -alias gv_ks -keyalg RSA -keysize 2048 -validity 10000 Add to project properties: key.store=./gv.keystore key.alias=gv_ks Build and install: ant release install ==== StartXActivity.java ==== <pre> // http://stackoverflow.com/questions/20932102/execute-shell-command-from-android package com.startx.android; import java.lang.*; import java.io.* ; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class StartXActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Process p=null; try { TextView text = new TextView(this); text.setText("Starting X Windows...\n"); setContentView(text); Process su = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(su.getOutputStream()); os.writeBytes("sh /data/local/tmp/chroot2slackware.sh\n"); text.append("done\n"); os.flush(); os.writeBytes("exit\n"); text.append("exit\n"); os.flush(); try { su.waitFor(); } catch(Exception e2) { e2.printStackTrace(); } } catch (IOException e) { e.printStackTrace(); } finally { if(p!=null) p.destroy(); } } } </pre> ==== chroot2slackware.sh ==== Copy this file to /data/local/tmp/ <pre> #!/system/bin/sh export PATH=/data/local/tmp/bin:$PATH test -d /data/local/tmp/sdcard || mkdir /data/local/tmp/sdcard mountpoint /data/local/tmp/sdcard || mount -t ext4 /dev/block/mmcblk1p1 /data/local/tmp/sdcard test -d /data/local/tmp/slackware || mkdir /data/local/tmp/slackware cd /data/local/tmp/slackware for d in sys proc dev system usr bin sbin \ etc tmp boot home root lib \ media mnt opt run sbin srv var android.tmp ; do test -d $d || mkdir $d case $d in proc) mountpoint proc || mount -t proc none proc/ ;; sys) mountpoint sys || mount -t sysfs sys sys/ ;; dev) mountpoint dev || mount -o bind /dev dev/ ;; system) mountpoint system || mount -o bind /system system ;; android.tmp) mountpoint android.tmp || mount -o bind /data/local/tmp android.tmp ;; *) mountpoint $d || mount -o bind /data/local/tmp/sdcard/$d $d ;; esac done export PATH=/usr/bin:/bin:/usr/X11R6/bin:$PATH # chroot . /bin/su - # if non interactive # test -z $PS1 || test -x /data/local/tmp/sdcard/init && chroot . su - -c /init # if interactive # test -z $PS1 && chroot . su - chroot . /bin/bash -x <<'EOF' su - LD_LIBRARY_PATH= /system/bin/setprop ctl.stop surfaceflinger export PATH=/opt/local/sw/bin:/usr/bin:/bin:$PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:/usr/lib:$LD_LIBRARY_PATH killall -9 Xorg sleep 1 # /usr/bin/startx -- /opt/local/sw/bin/Xorg :0 /usr/bin/xinit -- /opt/local/sw/bin/Xorg :0 wait EOF </pre> ==== exitfromslackware.sh ==== This file is called when "Back to Android" wbar button is touched. It doesn't unmount partitions as expected, though Copy this file to /data/local/tmp/ <pre> #/system/bin/sh export PATH=/data/local/tmp/bin:$PATH killall -9 fluxbox killall -9 Xorg killall -9 wbar cd /data/local/tmp/slackware for d in sys proc dev system usr bin sbin etc \ tmp boot home root init lib media mnt opt \ run sbin srv var android.tmp; do echo "umounting $d" mountpoint $d && umount $d done mountpoint /data/local/tmp/sdcard && umount /data/local/tmp/sdcard # setprop ctl.start is not working. # LD_LIBRARY_PATH= /system/bin/setprop ctl.start surfaceflinger LD_LIBRARY_PATH= /system/bin/stop LD_LIBRARY_PATH= /system/bin/start </pre> == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ ... Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 3ec92b3d9ed39ef8f93abcc85a557b0659b8bb16 938 937 2014-09-07T05:21:37Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. And [http://s15.postimg.org/izdxddkqj/image.png another one]. == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1, sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installer ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs. I ran couple of frame buffer tests too. Fortunately, removing the VT requirement from Xorg was pretty simple. Here is how it was done. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> ==== Compiling xorg-server-1.12.2 ==== cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. === xorg.conf === Copy this file to /etc/X11 <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" # Option "Protocol" "Auto" EndSection </pre> === Running X === make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Try disown / nohup to keep X running when disconnected from PC. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== xvkbd ==== Download [http://homepage3.nifty.com/tsato/xvkbd/ xvkbd] from [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], and install: xmkf make make install Run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== <pre> i: /opt/local/sw/share/pixmaps/wbar/dock.png c: wbar --bpress --above-desk --pos bottom --isize 48 --idist 5 --nanim 4 --falfa 65 t: /10 i: /opt/local/sw/share/pixmaps/wbar/wbar.png c: wbar-config t: Config i: /opt/local/sw/share/icons/wm-icons/32x32-gant/terminal.png c: xterm t: Xterm i: /opt/local/sw/share/icons/wm-icons/32x32-gant/keyboard.png c: xvkbd -compact -no-repeat -geometry 800x200 t: Xvkbd i: /opt/local/sw/share/icons/wm-icons/32x32-gant/calculator.png c: xcalc t: XCalc i: /opt/local/sw/share/icons/wm-icons/32x32-gant/restart.png c: LD_LIBRARY_PATH= /system/bin/sh /android.tmp/exitfromslackware.sh t: Backto Android i: /opt/local/sw/share/icons/wm-icons/32x32-gant/window-close.png c: sleep 1 && xkill t: XKill </pre> == Android app to launch X Windows directly from Android == === Create StartX projec === Check [https://www.github.com/gv3/StartX StartX] project at github Create a project: android create project -n StartX -k com.startx.android -a StartXActivity -t 1 -p . Copy StartXActivity.java to src/com/startx/android If required, keytool -genkey -v -keystore gv.keystore \ -alias gv_ks -keyalg RSA -keysize 2048 -validity 10000 Add to project properties: key.store=./gv.keystore key.alias=gv_ks Build and install: ant release install ==== StartXActivity.java ==== <pre> // http://stackoverflow.com/questions/20932102/execute-shell-command-from-android package com.startx.android; import java.lang.*; import java.io.* ; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class StartXActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Process p=null; try { TextView text = new TextView(this); text.setText("Starting X Windows...\n"); setContentView(text); Process su = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(su.getOutputStream()); os.writeBytes("sh /data/local/tmp/chroot2slackware.sh\n"); text.append("done\n"); os.flush(); os.writeBytes("exit\n"); text.append("exit\n"); os.flush(); try { su.waitFor(); } catch(Exception e2) { e2.printStackTrace(); } } catch (IOException e) { e.printStackTrace(); } finally { if(p!=null) p.destroy(); } } } </pre> ==== chroot2slackware.sh ==== Copy this file to /data/local/tmp/ <pre> #!/system/bin/sh export PATH=/data/local/tmp/bin:$PATH test -d /data/local/tmp/sdcard || mkdir /data/local/tmp/sdcard mountpoint /data/local/tmp/sdcard || mount -t ext4 /dev/block/mmcblk1p1 /data/local/tmp/sdcard test -d /data/local/tmp/slackware || mkdir /data/local/tmp/slackware cd /data/local/tmp/slackware for d in sys proc dev system usr bin sbin \ etc tmp boot home root lib \ media mnt opt run sbin srv var android.tmp ; do test -d $d || mkdir $d case $d in proc) mountpoint proc || mount -t proc none proc/ ;; sys) mountpoint sys || mount -t sysfs sys sys/ ;; dev) mountpoint dev || mount -o bind /dev dev/ ;; system) mountpoint system || mount -o bind /system system ;; android.tmp) mountpoint android.tmp || mount -o bind /data/local/tmp android.tmp ;; *) mountpoint $d || mount -o bind /data/local/tmp/sdcard/$d $d ;; esac done export PATH=/usr/bin:/bin:/usr/X11R6/bin:$PATH # chroot . /bin/su - # if non interactive # test -z $PS1 || test -x /data/local/tmp/sdcard/init && chroot . su - -c /init # if interactive # test -z $PS1 && chroot . su - chroot . /bin/bash -x <<'EOF' su - LD_LIBRARY_PATH= /system/bin/setprop ctl.stop surfaceflinger export PATH=/opt/local/sw/bin:/usr/bin:/bin:$PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:/usr/lib:$LD_LIBRARY_PATH killall -9 Xorg sleep 1 # /usr/bin/startx -- /opt/local/sw/bin/Xorg :0 /usr/bin/xinit -- /opt/local/sw/bin/Xorg :0 wait EOF </pre> ==== exitfromslackware.sh ==== This file is called when "Back to Android" wbar button is touched. It doesn't unmount partitions as expected, though Copy this file to /data/local/tmp/ <pre> #/system/bin/sh export PATH=/data/local/tmp/bin:$PATH killall -9 fluxbox killall -9 Xorg killall -9 wbar cd /data/local/tmp/slackware for d in sys proc dev system usr bin sbin etc \ tmp boot home root init lib media mnt opt \ run sbin srv var android.tmp; do echo "umounting $d" mountpoint $d && umount $d done mountpoint /data/local/tmp/sdcard && umount /data/local/tmp/sdcard # setprop ctl.start is not working. # LD_LIBRARY_PATH= /system/bin/setprop ctl.start surfaceflinger LD_LIBRARY_PATH= /system/bin/stop LD_LIBRARY_PATH= /system/bin/start </pre> == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ ... Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 72e67235229eb734548755ba82968f077b2b62f4 939 938 2014-09-07T05:34:21Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. And [http://s15.postimg.org/izdxddkqj/image.png another one]. == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1, sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installer ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs. I ran couple of frame buffer tests too. Fortunately, removing the VT requirement from Xorg was pretty simple. Here is how it was done. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> ==== Compiling xorg-server-1.12.2 ==== cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. === xorg.conf === Copy this file to /etc/X11 <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" # Option "Protocol" "Auto" EndSection </pre> === Running X === make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Try disown / nohup to keep X running when disconnected from PC. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== xvkbd ==== Download [http://homepage3.nifty.com/tsato/xvkbd/ xvkbd] from [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], and install: xmkf make make install Run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== <pre> i: /opt/local/sw/share/pixmaps/wbar/dock.png c: wbar --bpress --above-desk --pos bottom --isize 48 --idist 5 --nanim 4 --falfa 65 t: /10 i: /opt/local/sw/share/pixmaps/wbar/wbar.png c: wbar-config t: Config i: /opt/local/sw/share/icons/wm-icons/32x32-gant/terminal.png c: xterm t: Xterm i: /opt/local/sw/share/icons/wm-icons/32x32-gant/keyboard.png c: xvkbd -compact -no-repeat -geometry 800x200 t: Xvkbd i: /opt/local/sw/share/icons/wm-icons/32x32-gant/calculator.png c: xcalc t: XCalc i: /opt/local/sw/share/icons/wm-icons/32x32-gant/restart.png c: LD_LIBRARY_PATH= /system/bin/sh /android.tmp/exitfromslackware.sh t: Backto Android i: /opt/local/sw/share/icons/wm-icons/32x32-gant/window-close.png c: sleep 1 && xkill t: XKill </pre> == Android app to launch X Windows directly from Android == === Create StartX projec === Check [https://github.com/gv1/SlackwareOnMT6582 SlackwareOnMT6582] project at github Create a project: android create project -n StartX -k com.startx.android -a StartXActivity -t 1 -p . Copy StartXActivity.java to src/com/startx/android If required, keytool -genkey -v -keystore gv.keystore \ -alias gv_ks -keyalg RSA -keysize 2048 -validity 10000 Add to project properties: key.store=./gv.keystore key.alias=gv_ks Build and install: ant release install ==== StartXActivity.java ==== <pre> // http://stackoverflow.com/questions/20932102/execute-shell-command-from-android package com.startx.android; import java.lang.*; import java.io.* ; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class StartXActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Process p=null; try { TextView text = new TextView(this); text.setText("Starting X Windows...\n"); setContentView(text); Process su = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(su.getOutputStream()); os.writeBytes("sh /data/local/tmp/chroot2slackware.sh\n"); text.append("done\n"); os.flush(); os.writeBytes("exit\n"); text.append("exit\n"); os.flush(); try { su.waitFor(); } catch(Exception e2) { e2.printStackTrace(); } } catch (IOException e) { e.printStackTrace(); } finally { if(p!=null) p.destroy(); } } } </pre> ==== chroot2slackware.sh ==== Copy this file to /data/local/tmp/ <pre> #!/system/bin/sh export PATH=/data/local/tmp/bin:$PATH test -d /data/local/tmp/sdcard || mkdir /data/local/tmp/sdcard mountpoint /data/local/tmp/sdcard || mount -t ext4 /dev/block/mmcblk1p1 /data/local/tmp/sdcard test -d /data/local/tmp/slackware || mkdir /data/local/tmp/slackware cd /data/local/tmp/slackware for d in sys proc dev system usr bin sbin \ etc tmp boot home root lib \ media mnt opt run sbin srv var android.tmp ; do test -d $d || mkdir $d case $d in proc) mountpoint proc || mount -t proc none proc/ ;; sys) mountpoint sys || mount -t sysfs sys sys/ ;; dev) mountpoint dev || mount -o bind /dev dev/ ;; system) mountpoint system || mount -o bind /system system ;; android.tmp) mountpoint android.tmp || mount -o bind /data/local/tmp android.tmp ;; *) mountpoint $d || mount -o bind /data/local/tmp/sdcard/$d $d ;; esac done export PATH=/usr/bin:/bin:/usr/X11R6/bin:$PATH # chroot . /bin/su - # if non interactive # test -z $PS1 || test -x /data/local/tmp/sdcard/init && chroot . su - -c /init # if interactive # test -z $PS1 && chroot . su - chroot . /bin/bash -x <<'EOF' su - LD_LIBRARY_PATH= /system/bin/setprop ctl.stop surfaceflinger export PATH=/opt/local/sw/bin:/usr/bin:/bin:$PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:/usr/lib:$LD_LIBRARY_PATH killall -9 Xorg sleep 1 # /usr/bin/startx -- /opt/local/sw/bin/Xorg :0 /usr/bin/xinit -- /opt/local/sw/bin/Xorg :0 wait EOF </pre> ==== exitfromslackware.sh ==== This file is called when "Back to Android" wbar button is touched. It doesn't unmount partitions as expected, though Copy this file to /data/local/tmp/ <pre> #/system/bin/sh export PATH=/data/local/tmp/bin:$PATH killall -9 fluxbox killall -9 Xorg killall -9 wbar cd /data/local/tmp/slackware for d in sys proc dev system usr bin sbin etc \ tmp boot home root init lib media mnt opt \ run sbin srv var android.tmp; do echo "umounting $d" mountpoint $d && umount $d done mountpoint /data/local/tmp/sdcard && umount /data/local/tmp/sdcard # setprop ctl.start is not working. # LD_LIBRARY_PATH= /system/bin/setprop ctl.start surfaceflinger LD_LIBRARY_PATH= /system/bin/stop LD_LIBRARY_PATH= /system/bin/start </pre> == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ ... Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 11eb486dd6658ba9338b537a3160cc5001612468 940 939 2014-09-07T07:12:49Z Gv 356 /* Specifications of the Tablet PC which was used here */ wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? == External Links == [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. And [http://s15.postimg.org/izdxddkqj/image.png another one]. [https://github.com/gv1/SlackwareOnMT6582/releases SlackwareOnMT6582] page at github, includes StartX apk. == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1, sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installer ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs. I ran couple of frame buffer tests too. Fortunately, removing the VT requirement from Xorg was pretty simple. Here is how it was done. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. ==== lnx_init.c patch ==== <pre> --- xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_init.c 2014-09-04 22:53:13.450000054 +0530 +++ xorg-server-1.12.2.org/hw/xfree86/os-support/linux/lnx_init.c 2012-05-17 22:39:03.000000000 +0530 @@ -48,18 +48,15 @@ static void drain_console(int fd, void *closure) { -#ifdef GV errno = 0; if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) { xf86SetConsoleHandler(NULL, NULL); } -#endif } static void switch_to(int vt, const char *from) { -#ifdef GV int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); @@ -69,13 +66,11 @@ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); if (ret < 0) FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); -#endif } void xf86OpenConsole(void) { -#ifdef GV int i, fd = -1, ret; struct vt_mode VT; struct vt_stat vts; @@ -254,13 +249,11 @@ switch_to(xf86Info.vtno, "xf86OpenConsole"); } } -#endif } void xf86CloseConsole(void) { -#ifdef GV struct vt_mode VT; int ret; @@ -307,7 +300,6 @@ } } close(xf86Info.consoleFd); /* make the vt-manager happy */ -#endif } int </pre> ==== Compiling xorg-server-1.12.2 ==== cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. === xorg.conf === Copy this file to /etc/X11 <pre> Section "ServerLayout" Identifier "myLaout" Screen "myScreen" # InputDevice "mymouse" InputDevice "mytouchscreen" EndSection Section "Screen" Identifier "myScreen" Device "myfbdev" DefaultDepth 24 EndSection Section "Device" Identifier "myFbdev" Driver "fbdev" Option "fbdev" "/dev/graphics/fb0" EndSection Section "InputDevice" Identifier "mytouchscreen" Driver "evdev" # Driver "synaptics" Option "Device" "/dev/input/event3" # Option "Protocol" "Auto" EndSection </pre> === Running X === make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Try disown / nohup to keep X running when disconnected from PC. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== xvkbd ==== Download [http://homepage3.nifty.com/tsato/xvkbd/ xvkbd] from [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], and install: xmkf make make install Run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== <pre> i: /opt/local/sw/share/pixmaps/wbar/dock.png c: wbar --bpress --above-desk --pos bottom --isize 48 --idist 5 --nanim 4 --falfa 65 t: /10 i: /opt/local/sw/share/pixmaps/wbar/wbar.png c: wbar-config t: Config i: /opt/local/sw/share/icons/wm-icons/32x32-gant/terminal.png c: xterm t: Xterm i: /opt/local/sw/share/icons/wm-icons/32x32-gant/keyboard.png c: xvkbd -compact -no-repeat -geometry 800x200 t: Xvkbd i: /opt/local/sw/share/icons/wm-icons/32x32-gant/calculator.png c: xcalc t: XCalc i: /opt/local/sw/share/icons/wm-icons/32x32-gant/restart.png c: LD_LIBRARY_PATH= /system/bin/sh /android.tmp/exitfromslackware.sh t: Backto Android i: /opt/local/sw/share/icons/wm-icons/32x32-gant/window-close.png c: sleep 1 && xkill t: XKill </pre> == Android app to launch X Windows directly from Android == === Create StartX projec === Check [https://github.com/gv1/SlackwareOnMT6582 SlackwareOnMT6582] project at github Create a project: android create project -n StartX -k com.startx.android -a StartXActivity -t 1 -p . Copy StartXActivity.java to src/com/startx/android If required, keytool -genkey -v -keystore gv.keystore \ -alias gv_ks -keyalg RSA -keysize 2048 -validity 10000 Add to project properties: key.store=./gv.keystore key.alias=gv_ks Build and install: ant release install ==== StartXActivity.java ==== <pre> // http://stackoverflow.com/questions/20932102/execute-shell-command-from-android package com.startx.android; import java.lang.*; import java.io.* ; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class StartXActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Process p=null; try { TextView text = new TextView(this); text.setText("Starting X Windows...\n"); setContentView(text); Process su = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(su.getOutputStream()); os.writeBytes("sh /data/local/tmp/chroot2slackware.sh\n"); text.append("done\n"); os.flush(); os.writeBytes("exit\n"); text.append("exit\n"); os.flush(); try { su.waitFor(); } catch(Exception e2) { e2.printStackTrace(); } } catch (IOException e) { e.printStackTrace(); } finally { if(p!=null) p.destroy(); } } } </pre> ==== chroot2slackware.sh ==== Copy this file to /data/local/tmp/ <pre> #!/system/bin/sh export PATH=/data/local/tmp/bin:$PATH test -d /data/local/tmp/sdcard || mkdir /data/local/tmp/sdcard mountpoint /data/local/tmp/sdcard || mount -t ext4 /dev/block/mmcblk1p1 /data/local/tmp/sdcard test -d /data/local/tmp/slackware || mkdir /data/local/tmp/slackware cd /data/local/tmp/slackware for d in sys proc dev system usr bin sbin \ etc tmp boot home root lib \ media mnt opt run sbin srv var android.tmp ; do test -d $d || mkdir $d case $d in proc) mountpoint proc || mount -t proc none proc/ ;; sys) mountpoint sys || mount -t sysfs sys sys/ ;; dev) mountpoint dev || mount -o bind /dev dev/ ;; system) mountpoint system || mount -o bind /system system ;; android.tmp) mountpoint android.tmp || mount -o bind /data/local/tmp android.tmp ;; *) mountpoint $d || mount -o bind /data/local/tmp/sdcard/$d $d ;; esac done export PATH=/usr/bin:/bin:/usr/X11R6/bin:$PATH # chroot . /bin/su - # if non interactive # test -z $PS1 || test -x /data/local/tmp/sdcard/init && chroot . su - -c /init # if interactive # test -z $PS1 && chroot . su - chroot . /bin/bash -x <<'EOF' su - LD_LIBRARY_PATH= /system/bin/setprop ctl.stop surfaceflinger export PATH=/opt/local/sw/bin:/usr/bin:/bin:$PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:/usr/lib:$LD_LIBRARY_PATH killall -9 Xorg sleep 1 # /usr/bin/startx -- /opt/local/sw/bin/Xorg :0 /usr/bin/xinit -- /opt/local/sw/bin/Xorg :0 wait EOF </pre> ==== exitfromslackware.sh ==== This file is called when "Back to Android" wbar button is touched. It doesn't unmount partitions as expected, though Copy this file to /data/local/tmp/ <pre> #/system/bin/sh export PATH=/data/local/tmp/bin:$PATH killall -9 fluxbox killall -9 Xorg killall -9 wbar cd /data/local/tmp/slackware for d in sys proc dev system usr bin sbin etc \ tmp boot home root init lib media mnt opt \ run sbin srv var android.tmp; do echo "umounting $d" mountpoint $d && umount $d done mountpoint /data/local/tmp/sdcard && umount /data/local/tmp/sdcard # setprop ctl.start is not working. # LD_LIBRARY_PATH= /system/bin/setprop ctl.start surfaceflinger LD_LIBRARY_PATH= /system/bin/stop LD_LIBRARY_PATH= /system/bin/start </pre> == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ ... Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 8f97a3af8bc46ca6083d161181160759c58151d2 941 940 2014-09-07T11:11:28Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? == External Links == [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. And [http://s15.postimg.org/izdxddkqj/image.png another one]. [https://github.com/gv1/SlackwareOnMT6582/releases SlackwareOnMT6582] page at github, includes StartX apk. == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1, sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installer ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs. I ran couple of frame buffer tests too. Fortunately, removing the VT requirement from Xorg was pretty simple. Here is how it was done. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. ==== lnx_init.c patch ==== [https://github.com/gv1/SlackwareOnMT6582/blob/master/lnx_init.patch lnx_init.patch] ==== Compiling xorg-server-1.12.2 ==== cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. === xorg.conf === Copy this file to /etc/X11 [https://github.com/gv1/SlackwareOnMT6582/blob/master/xorg.conf xorg.conf] === Running X === make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg -pointer mytouchscreen :0 Try disown / nohup to keep X running when disconnected from PC. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== xvkbd ==== Download [http://homepage3.nifty.com/tsato/xvkbd/ xvkbd] from [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], and install: xmkf make make install Run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== Copy this file to /root/.wbar : [https://github.com/gv1/SlackwareOnMT6582/blob/master/wbar .wbar] == Android app to launch X Windows directly from Android == === Create StartX projec === Check [https://github.com/gv1/SlackwareOnMT6582 SlackwareOnMT6582] project at github Create a project: android create project -n StartX -k com.startx.android -a StartXActivity -t 1 -p . Copy [https://github.com/gv1/SlackwareOnMT6582/blob/master/StartXActivity.java StartXActivity.java] to src/com/startx/android If required, keytool -genkey -v -keystore gv.keystore \ -alias gv_ks -keyalg RSA -keysize 2048 -validity 10000 Add to project properties: key.store=./gv.keystore key.alias=gv_ks Build and install: ant release install ==== StartXActivity.java ==== Copy this file to StartX/src/com/startx/android [https://github.com/gv1/SlackwareOnMT6582/blob/master/StartXActivity.java StartXActivity.java] ==== chroot2slackware.sh ==== Copy this file to /data/local/tmp/ [https://github.com/gv1/SlackwareOnMT6582/blob/master/chroot2slackware.sh chroot2slackware.sh] ==== exitfromslackware.sh ==== This file is called when "Back to Android" wbar button is touched. Copy this file to /data/local/tmp/ [https://github.com/gv1/SlackwareOnMT6582/blob/master/exitfromslackware.sh exitfromslackware.sh] == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). For these tests, I had two terminals up on the host PC with one of them running just adb shell with su, and other running chrooted slackware shell. SurfaceFlinger was stopped from su shell, and tests from Slackware shell. Please not Slackware shell is also running as user root. ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: adb shell su stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out once done, go back to android su shell from adb, and: ==== Getting back to android ==== start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== <pre> No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: mtk-kpd /dev/input/event1: ACCDET /dev/input/event2: hwmdata /dev/input/event3: mtk-tpd Select the device event number [0-3]: Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "mtk-tpd" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 800 Resolution 800 Event code 1 (ABS_Y) Value 0 Min 0 Max 480 Resolution 480 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Event code 48 (ABS_MT_TOUCH_MAJOR) Value 0 Min 0 Max 100 Event code 49 (ABS_MT_TOUCH_MINOR) Value 0 Min 0 Max 100 Event code 53 (ABS_MT_POSITION_X) Value 0 Min 0 Max 800 Event code 54 (ABS_MT_POSITION_Y) Value 0 Min 0 Max 480 Event code 57 (ABS_MT_TRACKING_ID) Value 0 Min 0 Max 0 Properties: Property type 1 (INPUT_PROP_DIRECT) Testing ... (interrupt to exit) Event: time 1409845467.116675, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1409845467.116682, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.116687, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.116691, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.116695, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.116699, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.116703, -------------- SYN_REPORT ------------ Event: time 1409845467.133145, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845467.133151, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 115 Event: time 1409845467.133155, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 96 Event: time 1409845467.133160, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845467.133164, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845467.133167, -------------- SYN_REPORT ------------ ... Event: time 1409845469.216857, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 1 Event: time 1409845469.216863, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 207 Event: time 1409845469.216867, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 376 Event: time 1409845469.216871, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1 Event: time 1409845469.216875, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.216878, -------------- SYN_REPORT ------------ Event: time 1409845469.230419, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1409845469.230423, ++++++++++++++ SYN_MT_REPORT ++++++++++++ Event: time 1409845469.230426, -------------- SYN_REPORT ------------ </pre> === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 47ea995046432fd655362f24978bad891e4cde8b 942 941 2014-09-07T11:59:41Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? == External Links == [http://arm.slackware.com/getslack/ Slackware] for arm [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. And [http://s15.postimg.org/izdxddkqj/image.png another one]. [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] [https://github.com/gv1/SlackwareOnMT6582/releases SlackwareOnMT6582] page at github, includes StartX apk. == Rooting the Tablet PC == I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1, sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. So far, command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. Since there is no VTs available was not able to test Xorg, though could get Mali module compiled and loaded. More details below. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installer ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs. I ran couple of frame buffer tests too. Fortunately, removing the VT requirement from Xorg was pretty simple. Here is how it was done. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. ==== lnx_init.c patch ==== [https://github.com/gv1/SlackwareOnMT6582/blob/master/lnx_init.patch lnx_init.patch] ==== Compiling xorg-server-1.12.2 ==== Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw In src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c, comment: // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. === xorg.conf === Copy this file to /etc/X11 [https://github.com/gv1/SlackwareOnMT6582/blob/master/xorg.conf xorg.conf] === Running X === In the final setup, these manual steps to switch between X and Android is not required, StartX app and wbar button "Back to Android" does these tasks. make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg :0 Try disown / nohup to keep X running when disconnected from PC. Or Touch and run "StartX" app. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== xvkbd ==== Download [http://homepage3.nifty.com/tsato/xvkbd/ xvkbd] from [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], and install: xmkf make make install Run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== Copy this file to /root/.wbar : [https://github.com/gv1/SlackwareOnMT6582/blob/master/wbar .wbar] == Android app to launch X Windows directly from Android == === Create StartX projec === Check [https://github.com/gv1/SlackwareOnMT6582 SlackwareOnMT6582] project at github Create a project: android create project -n StartX -k com.startx.android -a StartXActivity -t 1 -p . Copy [https://github.com/gv1/SlackwareOnMT6582/blob/master/StartXActivity.java StartXActivity.java] to src/com/startx/android If required, keytool -genkey -v -keystore gv.keystore \ -alias gv_ks -keyalg RSA -keysize 2048 -validity 10000 Add to project properties: key.store=./gv.keystore key.alias=gv_ks Build and install: ant release install ==== StartXActivity.java ==== Copy this file to StartX/src/com/startx/android [https://github.com/gv1/SlackwareOnMT6582/blob/master/StartXActivity.java StartXActivity.java] ==== chroot2slackware.sh ==== Copy [https://github.com/gv1/SlackwareOnMT6582/blob/master/chroot2slackware.sh chroot2slackware.sh] to /data/local/tmp/ ==== exitfromslackware.sh ==== This file is called when "Back to Android" wbar button is touched. Copy [https://github.com/gv1/SlackwareOnMT6582/blob/master/exitfromslackware.sh exitfromslackware.sh] to /data/local/tmp/ == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: From Slackware shell in adb: stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out ==== Getting back to android ==== Once done, go back to Slackware shell in adb, and: start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== [https://github.com/gv1/SlackwareOnMT6582/blob/master/doc/evtest.log evtest.log] === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 6964b654f20b3af3a4cca4cae9f530b278820b15 943 942 2014-09-07T13:10:49Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? == External Links == Get [http://arm.slackware.com/getslack/ Slackware] for arm [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. And [http://s15.postimg.org/izdxddkqj/image.png another one]. [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] [https://github.com/gv1/SlackwareOnMT6582/releases SlackwareOnMT6582] page at github, includes [https://github.com/gv1/SlackwareOnMT6582/releases StartX] apk. == Rooting the Tablet PC == A tablet with root access is required. I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1, sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. Please not that you can try command line stuff with [http://proot.me/ proot] ( which requires no root access). Xorg however requires root permission since /dev/graphics/fb0 requires root permission. So far, X windows using Xorg, and command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installer ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs were ok. I ran couple of frame buffer tests too. Fortunately, removing the VT requirement from Xorg was pretty simple. Here is how it was done. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. ==== lnx_init.c patch ==== [https://github.com/gv1/SlackwareOnMT6582/blob/master/lnx_init.patch lnx_init.patch] ==== Compiling xorg-server-1.12.2 ==== Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw In src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c, comment: // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. === xorg.conf === Copy this file to /etc/X11 [https://github.com/gv1/SlackwareOnMT6582/blob/master/xorg.conf xorg.conf] === Running X === In the final setup, these manual steps to switch between X and Android is not required, StartX app and wbar button "Back to Android" does these tasks. make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg :0 Try disown / nohup to keep X running when disconnected from PC. Or Touch and run "StartX" app. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== xvkbd ==== Download [http://homepage3.nifty.com/tsato/xvkbd/ xvkbd] from [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], and install: xmkf make make install Run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== Copy this file to /root/.wbar : [https://github.com/gv1/SlackwareOnMT6582/blob/master/wbar .wbar] == Android app to launch X Windows directly from Android == Install [https://github.com/gv1/SlackwareOnMT6582/releases/download/v0.1-alpha/StartXActivity-release.apk StartXActivity-release.apk] for starting X windows from Android. You may use adb to install StartX after downloading it. adb install ./StartXActivity-release.apk === Create StartX projec === To build the the apk from scratch, check [https://github.com/gv1/SlackwareOnMT6582 SlackwareOnMT6582] project at github Create a project: android create project -n StartX -k com.startx.android -a StartXActivity -t 1 -p . Copy [https://github.com/gv1/SlackwareOnMT6582/blob/master/StartXActivity.java StartXActivity.java] to src/com/startx/android If required, keytool -genkey -v -keystore gv.keystore \ -alias gv_ks -keyalg RSA -keysize 2048 -validity 10000 Add to project properties: key.store=./gv.keystore key.alias=gv_ks Build and install: ant release install ==== StartXActivity.java ==== Copy this file to StartX/src/com/startx/android before build. [https://github.com/gv1/SlackwareOnMT6582/blob/master/StartXActivity.java StartXActivity.java] ==== chroot2slackware.sh ==== Copy [https://github.com/gv1/SlackwareOnMT6582/blob/master/chroot2slackware.sh chroot2slackware.sh] to /data/local/tmp/ along with ==== exitfromslackware.sh ==== This file is called when "Back to Android" wbar button is touched. Copy [https://github.com/gv1/SlackwareOnMT6582/blob/master/exitfromslackware.sh exitfromslackware.sh] to /data/local/tmp/ Thse files are used by StartX app to launch X windows. == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: From Slackware shell in adb: stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out ==== Getting back to android ==== Once done, go back to Slackware shell in adb, and: start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== [https://github.com/gv1/SlackwareOnMT6582/blob/master/doc/evtest.log evtest.log] === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> b4986d5655ebc69b86cd82ef36770bfaf1382bf2 944 943 2014-09-07T13:14:06Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? == External Links == Get [http://arm.slackware.com/getslack/ Slackware] for arm [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. And [http://s15.postimg.org/izdxddkqj/image.png another one]. [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] [https://github.com/gv1/SlackwareOnMT6582/releases SlackwareOnMT6582] page at github, includes [https://github.com/gv1/SlackwareOnMT6582/releases StartX] apk. == Rooting the Tablet PC == A tablet with root access is required. I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1, sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. Please not that you can try command line stuff with [http://proot.me/ proot] ( which requires no root access). Xorg however requires root permission since /dev/graphics/fb0 requires root permission. So far, X windows using Xorg, and command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installer ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs were ok. I ran couple of frame buffer tests too. Fortunately, removing the VT requirement from Xorg was pretty simple. Here is how it was done. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. ==== lnx_init.c patch ==== [https://github.com/gv1/SlackwareOnMT6582/blob/master/lnx_init.patch lnx_init.patch] ==== Compiling xorg-server-1.12.2 ==== Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw In src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c, comment: // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. === xorg.conf === Copy this file to /etc/X11 [https://github.com/gv1/SlackwareOnMT6582/blob/master/xorg.conf xorg.conf] === Running X === In the final setup, these manual steps to switch between X and Android is not required, StartX app and wbar button "Back to Android" does these tasks. make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg :0 Try disown / nohup to keep X running when disconnected from PC. Or Touch and run "StartX" app. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== xvkbd ==== Download [http://homepage3.nifty.com/tsato/xvkbd/ xvkbd] from [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], and install: xmkf make make install Run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== Copy this file to /root/.wbar : [https://github.com/gv1/SlackwareOnMT6582/blob/master/wbar .wbar] == Android app to launch X Windows directly from Android == === Install apk ==== Install [https://github.com/gv1/SlackwareOnMT6582/releases/download/v0.1-alpha/StartXActivity-release.apk StartXActivity-release.apk] for starting X windows from Android. You may use adb to install StartX after downloading it. adb install ./StartXActivity-release.apk Or if you prefer, === Create StartX project === To build the the apk from scratch, check [https://github.com/gv1/SlackwareOnMT6582 SlackwareOnMT6582] project at github Create a project: android create project -n StartX -k com.startx.android -a StartXActivity -t 1 -p . Copy [https://github.com/gv1/SlackwareOnMT6582/blob/master/StartXActivity.java StartXActivity.java] to src/com/startx/android If required, keytool -genkey -v -keystore gv.keystore \ -alias gv_ks -keyalg RSA -keysize 2048 -validity 10000 Add to project properties: key.store=./gv.keystore key.alias=gv_ks Build and install: ant release install ==== StartXActivity.java ==== Copy this file to StartX/src/com/startx/android before build. [https://github.com/gv1/SlackwareOnMT6582/blob/master/StartXActivity.java StartXActivity.java] ==== chroot2slackware.sh ==== Copy [https://github.com/gv1/SlackwareOnMT6582/blob/master/chroot2slackware.sh chroot2slackware.sh] to /data/local/tmp/ along with ==== exitfromslackware.sh ==== This file is called when "Back to Android" wbar button is touched. Copy [https://github.com/gv1/SlackwareOnMT6582/blob/master/exitfromslackware.sh exitfromslackware.sh] to /data/local/tmp/ Thse files are used by StartX app to launch X windows. == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: From Slackware shell in adb: stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out ==== Getting back to android ==== Once done, go back to Slackware shell in adb, and: start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== [https://github.com/gv1/SlackwareOnMT6582/blob/master/doc/evtest.log evtest.log] === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> 7f76a557ab8f7f7ab2328114916fa1a19360cb41 945 944 2014-09-07T13:14:59Z Gv 356 wikitext text/x-wiki == Specifications of the Tablet PC which was used here == Processor : Arm Cortex A7, 1.3 GHz dual core. : ARMv7 Processor rev 3 (v7l), Hardware : MT8312 SOC : mt6582. Memory : 512MB RAM Storage : 4GB Built in storage. Micro SD : Slot for upto 32GB Display : 7" WVGA 800x480 OS : Android 4.2 Jelly Bean GPU : Mali? == External Links == Get [http://arm.slackware.com/getslack/ Slackware] for arm [http://s7.postimg.org/fww1ibfdn/image.png Screenshot] of X windows with fluxbox and wbar. And [http://s15.postimg.org/izdxddkqj/image.png another one]. [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] [https://github.com/gv1/SlackwareOnMT6582/releases SlackwareOnMT6582] page at github, includes [https://github.com/gv1/SlackwareOnMT6582/releases StartX] apk. == Rooting the Tablet PC == A tablet with root access is required. I used [http://www.techverse.net/fastest-root-android-phone-computer/ Framaroot-1.9.3.apk] to root the device. == Installing Linux - Slackware 14.1, sort of. == With the problem of not having kernel source for the SOC, and no no bootloader unlock possible yet, next best option was to use a chroot environment. Please not that you can try command line stuff with [http://proot.me/ proot] ( which requires no root access). Xorg however requires root permission since /dev/graphics/fb0 requires root permission. So far, X windows using Xorg, and command line mode works fine. Here is the description of how Slackware was installed on to external micro SD Card. Was able to do some basic tests on the frame buffer display. === Preparing SD Card on host computer === Use fdisk to create one or two partitions, one for ext4 and other ( optional ) swap partition. Once these are created, assuming the device on host is /dev/sdc, mkfs.ext4 /dev/sdc1 sync eject sdc eject -t sdc mkdir slack mount /dev/sdc1 slack cd slack mkdir sl cd sl If you don't have Slackware installation files, [http://arm.slackware.com/getslack/ Get Slackware Arm] first. mkdir slackware14.1 cd slackware14.1 (cd /path..to../slackware14.1 ; tar cfz - *) | (tar xfz - ) [http://sourceforge.net/projects/slackwareonapc8750/files/initrd-kirkwood.cpio.gz/download initrd-kirkwood.cpio] contains the setup program, but since I couldn't boot with custom initrd, sdc1 /sl area is prepared to have the installation files. cpio -id < initrd-kirkwood.cpio sync umount slack Now that the sd card is ready for installation: eject sdc and plug it into the device. Once that is done, === Getting installer ready === Now plug the card in tablet pc, boot, from host computer, ==== starting a adb shell with su ==== adb shell su ==== chroot to installer ==== cd /data/local/tmp mkdir slackware mount /dev/block/mmcblk1p1 slackware cd slackware/sl export PATH=/data/local/tmp/bin:$PATH mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH pushd /dev ln -s /dev/block/mmc1blk* . popd chroot . /bin/bash mount -t ext4 /dev/mmcblk1p1 mnt === Running setup === Install Slackware onto mmcblk1p1, from pre mounted directory, sdc1 : /slackware14.1/slackware setup Proceed and select /dev/mmcblk1p1 as target, no format For source, select pre mounted directory option, /slackware14.1/slackware === Complete installation, and configuration === Once the complete installation is done, umount proc umount sys umount dev sync cd ../.. umount slackware == Getting into installed Slackware: == ==== Running slackware su shell ==== adb shell su mount /dev/block/mmcblk1p1 slackware cd slackware mountpoint proc || mount -t proc none proc/ mountpoint sys || mount -t sysfs sys sys/ mountpoint dev || mount -o bind /dev dev/ test -d system || mkdir system mountpoint system || mount -o bind /system system export PATH=/usr/bin:/bin:/usr/lib/setup:$PATH chroot . /bin/su - From here you can do "normal" Slackware activities, sort of. Main things that were lacking in my case were VTs (ttys). Compiling programs and running programs were ok. I ran couple of frame buffer tests too. Fortunately, removing the VT requirement from Xorg was pretty simple. Here is how it was done. == Getting Xorg up and running - kind of == === Getting Xorg compiled === Ecept for Pointer ( touchscreen ) failure, Xorg seems to be working fine. evtest, xinput tests are showing touchscreen activity, but the cursor seems to be not moving. But if a window like xvkbd or xterm or so is launched, you can move the window using the touch screen!. And kvkbd input also works. ==== lnx_init.c patch ==== [https://github.com/gv1/SlackwareOnMT6582/blob/master/lnx_init.patch lnx_init.patch] ==== Compiling xorg-server-1.12.2 ==== Download [http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2 xorg-server-1.12.2], tar xf xorg-server-1.12.2.tar.bz2 Also make changes to xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx\_init.c so that VT / console related code is disabled. See the patch section. cd xorg-server-1.12.2 export PKG_CONFIG_PATH=/opt/local/sw/share/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/opt/local/sw/lib:$LD_LIBRARY_PATH export PATH=/opt/local/sw/bin:$PATH ./configure --prefix=/opt/local/sw --enable-kdrive --enable-kdrive-evdev --with-xkb-path=/opt/local/sw/share/X11/xkb --with-xkb-output=/var/lib/xkb --with-xkb-bin-directory=/opt/local/sw/bin --with-default-xkb-rules=xorg --with-default-xkb-model=pc104 --with-default-xkb-layout=us --disable-xnest --disable-dmx --disable-xquartz --disable-xwin --disable-xephyr --disable-config-udev --enable-tslib --disable-docs --disable-devel-docs LDFLAGS=-L/opt/local/sw/lib CFLAGS=-I/opt/local/sw/include make -j 3 If all required packages are not on the system, compilation will fail. Download each of the requiered packags , untar, configure and install. ./configure --prefix=/opt/local/sw make -j 3 install Once xorg-server-1.12.2 compilation is succesfull, make install === Compiling additional drivers required === ==== fbdev ==== xf86-video-fbdev-0.4.2 export PKG_CONFIG_PATH=/opt/local/sw/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/opt/local/sw In src/fbdev.c xf86-video-fbdev-0.4.2/src/fbdev.c, comment: // #include "mibstore.h" make -j 3 make install ==== evdev ==== xf86-input-evdev-2.7.0 ./configure --prefix=/opt/local/sw src/Makefile: evdev_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) ( if not done, causes evdev_drv.so: undefined symbol: udev_new when Xorg is ran) make -j 3 make install Once installed make an xorg.conf [ see xorg.conf section ] in /etc/X11/ and run startx as described below. === xorg.conf === Copy this file to /etc/X11 [https://github.com/gv1/SlackwareOnMT6582/blob/master/xorg.conf xorg.conf] === Running X === In the final setup, these manual steps to switch between X and Android is not required, StartX app and wbar button "Back to Android" does these tasks. make sure display is on, From slackware chroot environment in adb shell [ see section ]: /system/bin/stop startx -- /opt/local/sw/bin/Xorg :0 Try disown / nohup to keep X running when disconnected from PC. Or Touch and run "StartX" app. Once Finished, run: /system/bin/start Or touch the "back to android" icon on wbar. to return to Android. === Virtual Keyboard === ==== xvkbd ==== Download [http://homepage3.nifty.com/tsato/xvkbd/ xvkbd] from [http://homepage3.nifty.com/tsato/xvkbd/xvkbd-3.5.tar.gz xvkbd-3.5.tar.gz], and install: xmkf make make install Run: xvkbd === An application launcher === ==== wbar ==== Download [https://github.com/warlockcc/wbar wbar] from [https://code.google.com/p/wbar/downloads/detail?name=wbar-2.3.4.tgz&can=2&q= wbar-2.3.4.tgz] at [https://code.google.com/p/wbar/downloads/list wbar downloads at code.google.com] ==== .wbar ==== Copy this file to /root/.wbar : [https://github.com/gv1/SlackwareOnMT6582/blob/master/wbar .wbar] == Android app to launch X Windows directly from Android == === Install apk === Install [https://github.com/gv1/SlackwareOnMT6582/releases/download/v0.1-alpha/StartXActivity-release.apk StartXActivity-release.apk] for starting X windows from Android. You may use adb to install StartX after downloading it. adb install ./StartXActivity-release.apk Or if you prefer, === Create StartX project === To build the the apk from scratch, check [https://github.com/gv1/SlackwareOnMT6582 SlackwareOnMT6582] project at github Create a project: android create project -n StartX -k com.startx.android -a StartXActivity -t 1 -p . Copy [https://github.com/gv1/SlackwareOnMT6582/blob/master/StartXActivity.java StartXActivity.java] to src/com/startx/android If required, keytool -genkey -v -keystore gv.keystore \ -alias gv_ks -keyalg RSA -keysize 2048 -validity 10000 Add to project properties: key.store=./gv.keystore key.alias=gv_ks Build and install: ant release install ==== StartXActivity.java ==== Copy this file to StartX/src/com/startx/android before build. [https://github.com/gv1/SlackwareOnMT6582/blob/master/StartXActivity.java StartXActivity.java] ==== chroot2slackware.sh ==== Copy [https://github.com/gv1/SlackwareOnMT6582/blob/master/chroot2slackware.sh chroot2slackware.sh] to /data/local/tmp/ along with ==== exitfromslackware.sh ==== This file is called when "Back to Android" wbar button is touched. Copy [https://github.com/gv1/SlackwareOnMT6582/blob/master/exitfromslackware.sh exitfromslackware.sh] to /data/local/tmp/ Thse files are used by StartX app to launch X windows. == Running some tests == === Testing the framebuffer === For these tests, I stopped android "SurfaceFlinger" and freed up /dev/graphics/fb0. by running "stop" command. Before running stop, make sure that the display is on ( not blank ). ==== Stopping android - sort of ==== Here is how to stop the SurfaceFlinger and get framebuffer free: From Slackware shell in adb: stop Now the display goes blank, with backlight on. Get one of these tests. [https://gist.githubusercontent.com/rafalrusin/1482697/raw/32c6c0d79b870ffb618aa7b7c664736ca5e150fe/fbtest.c fbtest] or [http://stackoverflow.com/questions/4996777/paint-pixels-to-screen-via-linux-framebuffer Paint-pixels-to-screen- via-linux-framebuffer] or [http://cep.xray.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html qtopiacore-testingframebuffer] All these tests worked on the Tablet. Transfer the tests to tablet using adb push command. from Slackware shell, running under adb shell: gcc fbtest.c ./a.out ==== Getting back to android ==== Once done, go back to Slackware shell in adb, and: start After few seconds android display will be back on. === Running evtest === Download [http://cgit.freedesktop.org/~whot/evtest/tree/evtest.c evtest.c]. gcc -o gcc -o evtest evtest.c ./evtest see evtest.log for sample outpu ==== evtest.log ==== [https://github.com/gv1/SlackwareOnMT6582/blob/master/doc/evtest.log evtest.log] === Running xinput === xinput --list <pre> â¡ Virtual core pointer id=2 [master pointer (3)] â â³ Virtual core XTEST pointer id=4 [slave pointer (2)] â â³ mytouchscreen id=6 [slave pointer (2)] ⣠Virtual core keyboard id=3 [master keyboard (2)] â³ Virtual core XTEST keyboard id=5 [slave keyboard (3)] </pre> ==== xinput log ==== xinput test 6 <pre> motion a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=53 a[1]=58 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=53 a[1]=58 motion a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=513 a[1]=91 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=513 a[1]=91 motion a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=659 a[1]=436 a[2]=0 a[3]=1 a[4]=0 button release 1 a[0]=659 a[1]=436 motion a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 button press 1 a[0]=624 a[1]=152 a[2]=0 a[3]=1 a[4]=0 motion a[0]=577 a[1]=174 motion a[0]=501 a[1]=203 motion a[0]=457 a[1]=219 motion a[0]=411 a[1]=232 motion a[0]=371 a[1]=240 motion a[0]=341 a[1]=245 button release 1 a[0]=341 a[1]=245 </pre> d307459f40a1870b70afbd7bc99e83db48fa9923 UX32VD 0 313 946 890 2014-09-07T23:45:56Z Mega-lnx 347 wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> lsusb<pre> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller Bus 002 Device 003: ID 04f2:b330 Chicony Electronics Co., Ltd Asus 720p CMOS webcam Bus 002 Device 005: ID 8087:07da Intel Corp. </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> Intel SCH SMBus 1.0 <M> Intel iSMT SMBus Controller <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default </pre> Sound: Intel HD Audio (build as module for optional external mic, see [[Audio]]) <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <M> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Audio== /etc/modprobe.d/intel-hda.conf <pre> options snd-hda-intel model=laptop-dmic </pre> ==Touchpad== /etc/X11/xorg.conf.d/50-synaptics.conf <pre> Section "InputClass" Identifier "Synaptics Touchpad" Driver "synaptics" MatchISTouchpad "on" MatchDriver "synaptics" # MatchDevice Path "/dev/input/event*" # Option "FastTaps" "1" Option "ClickPad" "true" Option "HorizTwoFingerScroll" "on" Option "EmulateMidButtonTime" "0" Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0" Option "CircularScrolling" "on" Option "CircScrollTrigger" "1" Option "FingerLow" "6" Option "FingerHigh" "13" Option "SHMConfig" "on" EndSection </pre> ==Ambient Light Sensor== See: [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller here] In order to use the Ambient Light Sensor it is necessary to insert the module (insmod als.ko) and the acpi call module (insmod acpi_call.ko). The acpi_call module is required to enable and disable the sensor. Finally run the als-controller to create the service for management of brightness. ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] * [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller/ als-controller] 645320da80a1d95fc18a28669592fe7251c610de 947 946 2014-09-07T23:50:51Z Mega-lnx 347 wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> lsusb<pre> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller Bus 002 Device 003: ID 04f2:b330 Chicony Electronics Co., Ltd Asus 720p CMOS webcam Bus 002 Device 005: ID 8087:07da Intel Corp. </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> Intel SCH SMBus 1.0 <M> Intel iSMT SMBus Controller <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default </pre> Sound: Intel HD Audio (build as module for optional external mic, see [[#Audio]]) <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <M> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Audio== /etc/modprobe.d/intel-hda.conf <pre> options snd-hda-intel model=laptop-dmic </pre> ==Touchpad== /etc/X11/xorg.conf.d/50-synaptics.conf <pre> Section "InputClass" Identifier "Synaptics Touchpad" Driver "synaptics" MatchISTouchpad "on" MatchDriver "synaptics" # MatchDevice Path "/dev/input/event*" # Option "FastTaps" "1" Option "ClickPad" "true" Option "HorizTwoFingerScroll" "on" Option "EmulateMidButtonTime" "0" Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0" Option "CircularScrolling" "on" Option "CircScrollTrigger" "1" Option "FingerLow" "6" Option "FingerHigh" "13" Option "SHMConfig" "on" EndSection </pre> ==Ambient Light Sensor== See: [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller here] In order to use the Ambient Light Sensor it is necessary to insert the module (insmod als.ko) and the acpi call module (insmod acpi_call.ko). The acpi_call module is required to enable and disable the sensor. Finally run the als-controller to create the service for management of brightness. ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] * [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller/ als-controller] 23217587b21c90b4c395a20a7de8b375343fbb0e Main Page 0 1 949 704 2014-10-26T23:34:54Z Erik 1 MediaWiki upgraded wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 3815c2aee51fbdc7dee26b988b278e6a4705a736 961 949 2014-10-28T16:18:07Z Rworkman 13 Reverted edits by [[Special:Contributions/Erik|Erik]] ([[User talk:Erik|talk]]) to last revision by [[User:Rworkman|Rworkman]] wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 6b3b81a3a9d0d4d69d7c37ee6df9263adf3cfe14 962 961 2014-10-28T16:18:50Z Rworkman 13 Reverted edits by [[Special:Contributions/Rworkman|Rworkman]] ([[User talk:Rworkman|talk]]) to last revision by [[User:Erik|Erik]] wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 3815c2aee51fbdc7dee26b988b278e6a4705a736 989 962 2017-05-12T02:00:40Z Erik 1 MediaWiki upgraded wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 83e0e5653d2efd9a882290a2d9161edb54e5f7b7 Talk:Broadcom Wireless 1 315 963 906 2015-01-27T00:06:24Z Dijetlo 355 /* Issue with ssb as a dependency of the b44 module */ new section wikitext text/x-wiki I just made a couple of relatively minor edits to the page (20140402): First, admins shouldn't edit files in /lib/modprobe.d/ - those get overwritten on package upgrades; only /etc/modprobe.d/ or /run/modprobe.d/ should be used for local sysadmin edits, as they are not overwritten on upgrades. However, /run is on a tmpfs, so it is not persistent across reboots; as such, it would applicable for e.g. rules that are auto-generated on system startup based on some nonstable attributes (whether that's a good idea is another discussion entirely, but I think not). Given all of that, /etc/modprobe.d/ is the best location -- its intent is for sysadmins to copy files from /lib/modprobe.d/ and edit the copies if needed (same-named files in both /etc/modprobe.d/ and /lib/modprobe.d/ are handled such that the file in /etc/modprobe.d/ takes precedence). This leads up to my second point: Second, since there's no need in this particular case to override *all* of what's in /lib/modprobe.d/blacklist.conf (you only want to *add* content to it), it's a bit cleaner to just create a new file in /etc/modprobe.d/ with a sensible name and put what you want in it. --rworkman == Issue with ssb as a dependency of the b44 module == Copying /lib/modprobe.d/bcm43xx.conf to /etc/modprobe.d/bcm43xx.conf and then adding the blacklist entries there worked except for the ssb module. It seems ssb is a dependency of module b44 and is being successfully loaded which blocked the function of the wl module. The fix was to run sbo packages b43-fwcutter and b43-firmware. This page is a valuable resource for checking compliance. http://linuxwireless.org/en/users/Drivers/b43/ Does anybody mind if I add a section referencing that? At the check where the reader runs the blacklisted modules in lsmod expecting a null return, put a fork in there and suggest if he gets a value after blacklisting and reboot, try the b43-fwcutter/b43-firmware approach. Or he might check for b44 at the outset and opt for the sbo packages if it's loaded with ssb as a dependency. c12eff622dff14a532add278efc253c51abc8cd5 Cgroups with KVM and Libvirt 0 319 964 2015-05-11T14:59:09Z Crudo 71 Created page with "=Using cgroups in Slackware with KVM/Libvirt= Hello friends, I’ve been using KVM a lot of months until now and every new host server that I create I need to change the way..." wikitext text/x-wiki =Using cgroups in Slackware with KVM/Libvirt= Hello friends, I’ve been using KVM a lot of months until now and every new host server that I create I need to change the way of how Slackware seems to create cgroups, libvirt doesn’t function very good if you don’t create specific directories in ‘/sys/fs/cgroup’ tree. So, to do that for me I made this script below <pre># cat /etc/rc.d/rc.cgroup #!/bin/sh # # /etc/rc.d/rc.cgroup: cgroups init script # Alexandre Mulatinho <alex@mulatinho.net> # Unmount /sys/fs/cgroup umount /sys/fs/cgroup # Mount cgroup_root in /sys/fs/cgroup mount -t tmpfs -o mode=755,rw cgroup_root /sys/fs/cgroup/ # Mount all the subsystems available in /sys/fs/cgroup as individual directory for i in $(lssubsys -a); do mkdir -pv /sys/fs/cgroup/$i mount -v -t cgroup -o $i $i /sys/fs/cgroup/$i done # chmod u+x /etc/rc.d/rc.cgroup</pre> And now everytime my slackware system boot, my cgroups tree are build in right way that KVM and libvirt can use him to manipulate things like memory, cpu, io, disk, etc. Hope it helps someone else :-) [[Category:Tutorials]] caad596c06bf5d1399a5132dd8323a48975453ea 965 964 2015-05-18T00:24:05Z Rworkman 13 /* Using cgroups in Slackware with KVM/Libvirt */ wikitext text/x-wiki =Using cgroups in Slackware with KVM/Libvirt= Hello friends, I’ve been using KVM a lot of months until now and every new host server that I create I need to change the way of how Slackware seems to create cgroups, libvirt doesn’t function very good if you don’t create specific directories in ‘/sys/fs/cgroup’ tree. So, to do that for me I made this script below <pre># cat /etc/rc.d/rc.cgroup #!/bin/sh # # /etc/rc.d/rc.cgroup: cgroups init script # Alexandre Mulatinho <alex@mulatinho.net> # Unmount /sys/fs/cgroup umount /sys/fs/cgroup # Mount cgroup_root in /sys/fs/cgroup mount -t tmpfs -o mode=755,rw cgroup_root /sys/fs/cgroup/ # Mount all the subsystems available in /sys/fs/cgroup as individual directory for i in $(lssubsys -a); do mkdir -pv /sys/fs/cgroup/$i mount -v -t cgroup -o $i $i /sys/fs/cgroup/$i done # chmod u+x /etc/rc.d/rc.cgroup</pre> And now everytime my slackware system boot, my cgroups tree are build in right way that KVM and libvirt can use him to manipulate things like memory, cpu, io, disk, etc. Hope it helps someone else :-) * EDIT: (from rworkman) This is not really the place to have such a question, but I don't find this to be necessary here (on a Slackware 14.1 system): <pre> root@fs:~# grep cgroup /proc/mounts cgroup_root /sys/fs/cgroup tmpfs rw,relatime,mode=755 0 0 cpuset /sys/fs/cgroup/cpuset cgroup rw,relatime,cpuset 0 0 cpu /sys/fs/cgroup/cpu cgroup rw,relatime,cpu 0 0 cpuacct /sys/fs/cgroup/cpuacct cgroup rw,relatime,cpuacct 0 0 blkio /sys/fs/cgroup/blkio cgroup rw,relatime,blkio 0 0 memory /sys/fs/cgroup/memory cgroup rw,relatime,memory 0 0 devices /sys/fs/cgroup/devices cgroup rw,relatime,devices 0 0 freezer /sys/fs/cgroup/freezer cgroup rw,relatime,freezer 0 0 net_cls /sys/fs/cgroup/net_cls cgroup rw,relatime,net_cls 0 0 perf_event /sys/fs/cgroup/perf_event cgroup rw,relatime,perf_event 0 0 net_prio /sys/fs/cgroup/net_prio cgroup rw,relatime,net_prio 0 0 </pre> * END EDIT [[Category:Tutorials]] 6219ae8cd0bb5590861ceb06529c56566f58bc26 UX32VD 0 313 966 947 2015-09-23T19:23:39Z Mega-lnx 347 Added fan control wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> lsusb<pre> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller Bus 002 Device 003: ID 04f2:b330 Chicony Electronics Co., Ltd Asus 720p CMOS webcam Bus 002 Device 005: ID 8087:07da Intel Corp. </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> Intel SCH SMBus 1.0 <M> Intel iSMT SMBus Controller <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default </pre> Sound: Intel HD Audio (build as module for optional external mic, see [[#Audio]]) <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <M> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Audio== /etc/modprobe.d/intel-hda.conf <pre> options snd-hda-intel model=laptop-dmic </pre> ==Touchpad== /etc/X11/xorg.conf.d/50-synaptics.conf <pre> Section "InputClass" Identifier "Synaptics Touchpad" Driver "synaptics" MatchISTouchpad "on" MatchDriver "synaptics" # MatchDevice Path "/dev/input/event*" # Option "FastTaps" "1" Option "ClickPad" "true" Option "HorizTwoFingerScroll" "on" Option "EmulateMidButtonTime" "0" Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0" Option "CircularScrolling" "on" Option "CircScrollTrigger" "1" Option "FingerLow" "6" Option "FingerHigh" "13" Option "SHMConfig" "on" EndSection </pre> ==Fan control== https://github.com/daringer/asus-fan - not working with kernel 3.10.x old modules: https://gist.github.com/felipec/6169047 https://gist.github.com/daringer/721e2cea17b570512097 ==Ambient Light Sensor== See: [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller here] In order to use the Ambient Light Sensor it is necessary to insert the module (insmod als.ko) and the acpi call module (insmod acpi_call.ko). The acpi_call module is required to enable and disable the sensor. Finally run the als-controller to create the service for management of brightness. ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme Calandrini] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] * [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller/ als-controller] 2b3fe352af6450e740f2a520821aa53ee7027097 976 966 2015-11-05T18:48:06Z Mega-lnx 347 wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> lsusb<pre> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller Bus 002 Device 003: ID 04f2:b330 Chicony Electronics Co., Ltd Asus 720p CMOS webcam Bus 002 Device 005: ID 8087:07da Intel Corp. </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> Intel SCH SMBus 1.0 <M> Intel iSMT SMBus Controller <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default </pre> Sound: Intel HD Audio (build as module for optional external mic, see [[#Audio]]) <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <M> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Audio== /etc/modprobe.d/intel-hda.conf <pre> options snd-hda-intel model=laptop-dmic </pre> ==Touchpad== /etc/X11/xorg.conf.d/50-synaptics.conf <pre> Section "InputClass" Identifier "Synaptics Touchpad" Driver "synaptics" MatchISTouchpad "on" MatchDriver "synaptics" # MatchDevice Path "/dev/input/event*" # Option "FastTaps" "1" Option "ClickPad" "true" Option "HorizTwoFingerScroll" "on" Option "EmulateMidButtonTime" "0" Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0" Option "CircularScrolling" "on" Option "CircScrollTrigger" "1" Option "FingerLow" "6" Option "FingerHigh" "13" Option "SHMConfig" "on" EndSection </pre> ==Fan control== https://github.com/daringer/asus-fan - not working with kernel 3.10.x old modules: https://gist.github.com/felipec/6169047 https://gist.github.com/daringer/721e2cea17b570512097 ==Ambient Light Sensor== See: [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller here] In order to use the Ambient Light Sensor it is necessary to insert the module (insmod als.ko) and the acpi call module (insmod acpi_call.ko). The acpi_call module is required to enable and disable the sensor. Finally run the als-controller to create the service for management of brightness. ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] * [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller/ als-controller] fe225aa56263301be8e10c47127257574b22e0d3 979 976 2015-11-05T18:54:44Z Mega-lnx 347 /* Contributors */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> lsusb<pre> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller Bus 002 Device 003: ID 04f2:b330 Chicony Electronics Co., Ltd Asus 720p CMOS webcam Bus 002 Device 005: ID 8087:07da Intel Corp. </pre> ==Kernel Configuration== Linux Kernel 3.10.x <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> '''SATA:''':<pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> Intel SCH SMBus 1.0 <M> Intel iSMT SMBus Controller <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default </pre> Sound: Intel HD Audio (build as module for optional external mic, see [[#Audio]]) <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <M> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Audio== /etc/modprobe.d/intel-hda.conf <pre> options snd-hda-intel model=laptop-dmic </pre> ==Touchpad== /etc/X11/xorg.conf.d/50-synaptics.conf <pre> Section "InputClass" Identifier "Synaptics Touchpad" Driver "synaptics" MatchISTouchpad "on" MatchDriver "synaptics" # MatchDevice Path "/dev/input/event*" # Option "FastTaps" "1" Option "ClickPad" "true" Option "HorizTwoFingerScroll" "on" Option "EmulateMidButtonTime" "0" Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0" Option "CircularScrolling" "on" Option "CircScrollTrigger" "1" Option "FingerLow" "6" Option "FingerHigh" "13" Option "SHMConfig" "on" EndSection </pre> ==Fan control== https://github.com/daringer/asus-fan - not working with kernel 3.10.x old modules: https://gist.github.com/felipec/6169047 https://gist.github.com/daringer/721e2cea17b570512097 ==Ambient Light Sensor== See: [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller here] In order to use the Ambient Light Sensor it is necessary to insert the module (insmod als.ko) and the acpi call module (insmod acpi_call.ko). The acpi_call module is required to enable and disable the sensor. Finally run the als-controller to create the service for management of brightness. ==Contributors== *[http://slackwiki.com/User:mega-lnx Guilherme] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] * [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller/ als-controller] 55b1867207d0483b60ae60a64fd5337a058caf5a 983 979 2016-04-13T19:30:33Z Mega-lnx 347 Added append entry for kernel booting wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS UX32VD== ==Hardware== lspci<pre> 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04) 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev ff) 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) </pre> lsusb<pre> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller Bus 002 Device 003: ID 04f2:b330 Chicony Electronics Co., Ltd Asus 720p CMOS webcam Bus 002 Device 005: ID 8087:07da Intel Corp. </pre> ==Kernel Configuration== Linux Kernel 3.10.x Processor <pre> -> Processor type and features Processor family (X) Core 2/newer Xeon </pre> SATA: <pre> [*] ATA ACPI Support [*] SATA Port Multiplier support <*> AHCI SATA support [*] ATA SFF support (for legacy IDE and PATA) [*] ATA BMDMA support <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support <*> Intel SCH PATA support <*> Intel PATA MPIIX support <M> ACPI firmware driver for PATA </pre> Ethernet: <pre> -> Device Drivers -> Network device support -> USB Network Adapters <M> ASIX AX88xxx Based USB 2.0 Ethernet Adapters <M> ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet </pre> I2C: <pre> -> Device Drivers -> I2C support -> I2C Hardware Bus support <M> Intel 82801 (ICH/PCH) <M> Intel SCH SMBus 1.0 <M> Intel iSMT SMBus Controller <M> SMBus Control Method Interface Device Drivers > GPIO Support [*] /sys/class/gpio/... (sysfs interface) <*> Generic memory-mapped GPIO controller support (MMIO platform device) <M> Intel ICH GPIO </pre> Touchpad: <pre> Device Drivers -> Input device support -> Mice -> <*> PS/2 mouse [*] ALPS PS/2 mouse protocol extension [*] Logitech PS/2++ mouse protocol extension [*] Synaptics PS/2 mouse protocol extension [*] Cypress PS/2 mouse protocol extension [*] Elantech PS/2 protocol extension <M> Synaptics I2C Touchpad support <M> Synaptics USB device support </pre> Graphics support: <pre> Device Drivers -> <*> Intel 8xx/9xx/G3x/G4x/HD Graphics [*] Enable modesetting on intel by default </pre> Sound: Intel HD Audio (build as module for optional external mic, see [[#Audio]]) <pre> -> Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices <*> Sound card support ---> [*] Preclaim OSS device numbers <*> Advanced Linux Sound Architecture ---> [*] PCI sound devices ---> <M> Intel HD Audio ---> (2048) Pre-allocated buffer size for HD-audio driver -*- Build hwdep interface for HD-audio driver -*- Allow dynamic codec reconfiguration [ ] Support digital beep via input layer [*] Support jack plugging notification via input layer [*] Support initialization patch loading for HD-audio [*] Build Realtek HD-audio codec support [*] Build Analog Device HD-audio codec support [*] Build IDT/Sigmatel HD-audio codec support [*] Build VIA HD-audio codec support [*] Build HDMI/DisplayPort HD-audio codec support [*] Build Cirrus Logic codec support [*] Build Conexant HD-audio codec support [*] Build Creative CA0110-IBG codec support [*] Build Creative CA0132 codec support [*] Support new DSP code for CA0132 codec [*] Build C-Media HD-audio codec support [*] Build Silicon Labs 3054 HD-modem codec support -*- Enable generic HD-audio codec parser (600) Default time-out for HD-audio power-save mode </pre> WIFI: <pre> Device Drivers -> Network device support -> Wireless LAN [*] Network device support ---> [*] Wireless LAN ---> <*> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <*> Intel Wireless WiFi DVM Firmware support <*> Intel Wireless WiFi MVM Firmware support [*] iwlwifi experimental P2P support (NEW) </pre> USB: <pre> Device Drivers -> USB support <*> xHCI HCD (USB 3.0) support <*> EHCI HCD (USB 2.0) support <*> OHCI HCD support <*> UHCI HCD (most Intel and VIA) support </pre> Function keys: <pre> Device Drivers -> -*- X86 Platform Specific Device Drivers ---> <*> ASUS WMI Driver <*> Asus Notebook WMI Driver < > Eee PC WMI Driver <*> WMI <*> WMI support for MXM Laptop Graphics Although function keys need a i2c support with i2c-i801 module </pre> IOMMU:<pre> Device Drivers -> IOMMU Hardware Support [*] Support for Intel IOMMU using DMA Remapping Devices [*] Enable Intel DMA Remapping Devices by default [*] Support for Interrupt Remapping </pre> ==Audio== /etc/modprobe.d/intel-hda.conf <pre> options snd-hda-intel model=laptop-dmic </pre> ==Touchpad== /etc/X11/xorg.conf.d/50-synaptics.conf <pre> Section "InputClass" Identifier "Synaptics Touchpad" Driver "synaptics" MatchISTouchpad "on" MatchDriver "synaptics" # MatchDevice Path "/dev/input/event*" # Option "FastTaps" "1" Option "ClickPad" "true" Option "HorizTwoFingerScroll" "on" Option "EmulateMidButtonTime" "0" Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0" Option "CircularScrolling" "on" Option "CircScrollTrigger" "1" Option "FingerLow" "6" Option "FingerHigh" "13" Option "SHMConfig" "on" EndSection </pre> ==ACPI OSI== acpi_osi='!Windows 2012' ==Fan control== https://github.com/daringer/asus-fan - not working with kernel 3.10.x old modules: https://gist.github.com/felipec/6169047 https://gist.github.com/daringer/721e2cea17b570512097 ==Ambient Light Sensor== See: [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller here] In order to use the Ambient Light Sensor it is necessary to insert the module (insmod als.ko) and the acpi call module (insmod acpi_call.ko). The acpi_call module is required to enable and disable the sensor. Finally run the als-controller to create the service for management of brightness. ==Contributors== *[http://slackwiki.com/User:mega-lnx Guilherme] ==External Links/ References== * [https://github.com/mkottman/acpi_call/ acpi_call] * [https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller/ als-controller] 48a6bad76252dcebd16becdd62ff4dc3434b2351 Mobilepowerhouse 0 320 968 2015-10-28T13:23:32Z Mega-lnx 347 Notes for creating a Slackware server for kvm virtualization wikitext text/x-wiki ==== Slackware kvm server ==== ==== Thin clients ==== 49b4883cbfbb188bf6297e4f6fc8be1789f23e3b EeePC 1215N 0 314 969 888 2015-11-05T18:25:18Z Mega-lnx 347 add bios description wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS eeepc 1215N == '''Ethernet:''' - Kernel version 2.6.x <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet (1000 Mbit) ---> < x > Atheros L1C Gigabit Ethernet </pre> - Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet driver support ---> [ x ] Atheros Devices < x > Atheros L1C Gigabit Ethernet support </pre> '''Wifi:''' The wireless card has two controller solutions Proprietary driver: The Broadcom STA driver can be downloaded [http://www.broadcom.com/support/802.11/linux_sta.php here]. or Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network device support ---> [ x ] Wireless LAN ---> [ M ] USB ZD1201 based Wireless device support [ M ] Broadcom IEEE802.11n PCIe SoftMAC WLAN driver [ M ] IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) </pre> '''BIOS''' For updating the bios using the EZ-Flash tool you should create a fat16 usb stick and then copy the rom named as "1215N.ROM" Last bios version: 0503 (09/07/10) 78110e67663c306ac00253149cd2d52febbaee77 970 969 2015-11-05T18:39:14Z Mega-lnx 347 /* Slackware on an ASUS eeepc 1215N */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS eeepc 1215N == '''Ethernet:''' Network nic: Atheros AR8152 - Kernel version 2.6.x <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet (1000 Mbit) ---> < x > Atheros L1C Gigabit Ethernet </pre> - Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet driver support ---> [ x ] Atheros Devices < x > Atheros L1C Gigabit Ethernet support </pre> Proprietary driver: tar xcvf arl...-x.x.x.tar.gz cd ark...-x.x.x/src ln -s config.h autoconf.h make insmod arl1e/arl1c '''Wifi:''' The BCM4313 wireless card has two controller solutions, the wl and the brcmsmac (brcm80211). Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network device support ---> [ x ] Wireless LAN ---> [ M ] USB ZD1201 based Wireless device support [ M ] Broadcom IEEE802.11n PCIe SoftMAC WLAN driver [ M ] IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) </pre> or Proprietary driver: The Broadcom STA driver, can be downloaded [http://www.broadcom.com/support/802.11/linux_sta.php here]. tar zxvf hybrid-portsrc....tar.gz make make install Optional: Compiles against desired API make API=WEXT make API=CFG80211 Kernel 3.3.2 error changes the follow line .ndo_set_multicast_list= to .ndo_set_rx_node= Loading module rmmod b43 | echo "blacklist b43" >> /etc/modprobe.d/blacklist rmmod ssb | echo "blacklist ssb" >> /etc/modprobe.d/blacklist rmmod wl rmmod bcma modprobe lib80211 modprobe lib80211_crypt_tkip (optional) modprobe wl '''BIOS''' For updating the bios using the EZ-Flash tool you should create a fat16 usb stick and then copy the rom named as "1215N.ROM" Last bios version: 0503 (09/07/10) 4fb56f0fbc5a69be2a8230e46528022949370852 971 970 2015-11-05T18:39:52Z Mega-lnx 347 /* Slackware on an ASUS eeepc 1215N */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS eeepc 1215N == '''Ethernet:''' Network nic: Atheros AR8152 - Kernel version 2.6.x <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet (1000 Mbit) ---> < x > Atheros L1C Gigabit Ethernet </pre> - Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet driver support ---> [ x ] Atheros Devices < x > Atheros L1C Gigabit Ethernet support </pre> Proprietary driver: tar xcvf arl...-x.x.x.tar.gz cd ark...-x.x.x/src ln -s config.h autoconf.h make insmod arl1e/arl1c '''Wifi:''' The BCM4313 wireless card has two controller solutions, the wl and the brcmsmac (brcm80211). Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network device support ---> [ x ] Wireless LAN ---> [ M ] USB ZD1201 based Wireless device support [ M ] Broadcom IEEE802.11n PCIe SoftMAC WLAN driver [ M ] IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) </pre> or Proprietary driver: The Broadcom STA driver, can be downloaded [http://www.broadcom.com/support/802.11/linux_sta.php here]. tar zxvf hybrid-portsrc....tar.gz make make install Optional: Compiles against desired API make API=WEXT make API=CFG80211 Kernel 3.3.2 error changes the follow line .ndo_set_multicast_list= to .ndo_set_rx_node= Loading module rmmod b43 | echo "blacklist b43" >> /etc/modprobe.d/blacklist rmmod ssb | echo "blacklist ssb" >> /etc/modprobe.d/blacklist rmmod wl rmmod bcma modprobe lib80211 modprobe lib80211_crypt_tkip (optional) modprobe wl '''BIOS''' For updating the bios using the EZ-Flash tool you should create a fat16 usb stick and then copy the rom named as "1215N.ROM" Last bios version: 0503 (09/07/10) 51cd966874d104fca07e557b724c778675b780e5 972 971 2015-11-05T18:43:22Z Mega-lnx 347 /* Slackware on an ASUS eeepc 1215N */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS eeepc 1215N == '''Ethernet:''' Network nic: Atheros AR8152 - Kernel version 2.6.x <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet (1000 Mbit) ---> < x > Atheros L1C Gigabit Ethernet </pre> - Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet driver support ---> [ x ] Atheros Devices < x > Atheros L1C Gigabit Ethernet support </pre> Building the proprietary driver: tar xcvf arl...-x.x.x.tar.gz cd ark...-x.x.x/src ln -s config.h autoconf.h make insmod arl1e/arl1c '''Wifi:''' The BCM4313 wireless card has two controller solutions, the wl and the brcmsmac (brcm80211). Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network device support ---> [ x ] Wireless LAN ---> [ M ] USB ZD1201 based Wireless device support [ M ] Broadcom IEEE802.11n PCIe SoftMAC WLAN driver [ M ] IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) Broadcom specif AMBA < M > BCMA suport [ M ] Support for BCMA on PCI-Host bus </pre> or Proprietary driver: The Broadcom STA driver, can be downloaded [http://www.broadcom.com/support/802.11/linux_sta.php here]. tar zxvf hybrid-portsrc....tar.gz make make install Optional: Compiles against desired API make API=WEXT make API=CFG80211 Kernel 3.3.2 error changes the follow line .ndo_set_multicast_list= to .ndo_set_rx_node= Loading module rmmod b43 | echo "blacklist b43" >> /etc/modprobe.d/blacklist rmmod ssb | echo "blacklist ssb" >> /etc/modprobe.d/blacklist rmmod wl rmmod bcma modprobe lib80211 modprobe lib80211_crypt_tkip (optional) modprobe wl '''BIOS''' For updating the bios using the EZ-Flash tool you should create a fat16 usb stick and then copy the rom named as "1215N.ROM" Last bios version: 0503 (09/07/10) 7e06b450d8d72a37842ad211fa5920d1eb43eb79 973 972 2015-11-05T18:44:12Z Mega-lnx 347 /* Slackware on an ASUS eeepc 1215N */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS eeepc 1215N == '''Ethernet:''' Network nic: Atheros AR8152 - Kernel version 2.6.x <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet (1000 Mbit) ---> < x > Atheros L1C Gigabit Ethernet </pre> - Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet driver support ---> [ x ] Atheros Devices < x > Atheros L1C Gigabit Ethernet support </pre> Building the proprietary driver: tar xcvf arl...-x.x.x.tar.gz cd arl...-x.x.x/src ln -s config.h autoconf.h make insmod arl1e/arl1c '''Wifi:''' The BCM4313 wireless card has two controller solutions, the wl and the brcmsmac (brcm80211). Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network device support ---> [ x ] Wireless LAN ---> [ M ] USB ZD1201 based Wireless device support [ M ] Broadcom IEEE802.11n PCIe SoftMAC WLAN driver [ M ] IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) Broadcom specif AMBA < M > BCMA suport [ M ] Support for BCMA on PCI-Host bus </pre> or Proprietary driver: The Broadcom STA driver, can be downloaded [http://www.broadcom.com/support/802.11/linux_sta.php here]. tar zxvf hybrid-portsrc....tar.gz make make install Optional: Compiles against desired API make API=WEXT make API=CFG80211 Kernel 3.3.2 error changes the follow line .ndo_set_multicast_list= to .ndo_set_rx_node= Loading module rmmod b43 | echo "blacklist b43" >> /etc/modprobe.d/blacklist rmmod ssb | echo "blacklist ssb" >> /etc/modprobe.d/blacklist rmmod wl rmmod bcma modprobe lib80211 modprobe lib80211_crypt_tkip (optional) modprobe wl '''BIOS''' For updating the bios using the EZ-Flash tool you should create a fat16 usb stick and then copy the rom named as "1215N.ROM" Lastest bios version: 0503 (09/07/10) eab1d9b1542227df832d9e7ffed8e09ee5e60d12 974 973 2015-11-05T18:45:33Z Mega-lnx 347 /* Slackware on an ASUS eeepc 1215N */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS eeepc 1215N == '''Ethernet:''' Network nic: Atheros AR8152 - Kernel version 2.6.x <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet (1000 Mbit) ---> < x > Atheros L1C Gigabit Ethernet </pre> - Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet driver support ---> [ x ] Atheros Devices < x > Atheros L1C Gigabit Ethernet support </pre> Building the proprietary driver: tar xcvf arl...-x.x.x.tar.gz cd arl...-x.x.x/src ln -s config.h autoconf.h make insmod arl1e/arl1c '''Wifi:''' The BCM4313 wireless card has two controller solutions, the wl and the brcmsmac (brcm80211). Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network device support ---> [ x ] Wireless LAN ---> [ M ] USB ZD1201 based Wireless device support [ M ] Broadcom IEEE802.11n PCIe SoftMAC WLAN driver [ M ] IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) Broadcom specif AMBA < M > BCMA suport [ M ] Support for BCMA on PCI-Host bus </pre> or Proprietary driver: The Broadcom STA driver, can be downloaded [http://www.broadcom.com/support/802.11/linux_sta.php here]. tar zxvf hybrid-portsrc....tar.gz make make install Optional: Compiles against desired API make API=WEXT make API=CFG80211 Kernel 3.3.2 error changes the follow line .ndo_set_multicast_list= to .ndo_set_rx_node= Unload Linux modules: rmmod b43 | echo "blacklist b43" >> /etc/modprobe.d/blacklist rmmod ssb | echo "blacklist ssb" >> /etc/modprobe.d/blacklist rmmod wl rmmod bcma Loading module: modprobe lib80211 modprobe lib80211_crypt_tkip (optional) modprobe wl '''BIOS''' For updating the bios using the EZ-Flash tool you should create a fat16 usb stick and then copy the rom named as "1215N.ROM" Lastest bios version: 0503 (09/07/10) 64718303f2d14570beaf36337ce12dc51e769c37 975 974 2015-11-05T18:47:21Z Mega-lnx 347 /* Slackware on an ASUS eeepc 1215N */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS eeepc 1215N == ==== Device modules ==== '''Ethernet:''' Network nic: Atheros AR8152 - Kernel version 2.6.x <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet (1000 Mbit) ---> < x > Atheros L1C Gigabit Ethernet </pre> - Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet driver support ---> [ x ] Atheros Devices < x > Atheros L1C Gigabit Ethernet support </pre> Building the proprietary driver: tar xcvf arl...-x.x.x.tar.gz cd arl...-x.x.x/src ln -s config.h autoconf.h make insmod arl1e/arl1c '''Wifi:''' The BCM4313 wireless card has two controller solutions, the wl and the brcmsmac (brcm80211). Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network device support ---> [ x ] Wireless LAN ---> [ M ] USB ZD1201 based Wireless device support [ M ] Broadcom IEEE802.11n PCIe SoftMAC WLAN driver [ M ] IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) Broadcom specif AMBA < M > BCMA suport [ M ] Support for BCMA on PCI-Host bus </pre> or Proprietary driver: The Broadcom STA driver, can be downloaded [http://www.broadcom.com/support/802.11/linux_sta.php here]. tar zxvf hybrid-portsrc....tar.gz make make install Optional: Compiles against desired API make API=WEXT make API=CFG80211 Kernel 3.3.2 error changes the follow line .ndo_set_multicast_list= to .ndo_set_rx_node= Unload Linux modules: rmmod b43 | echo "blacklist b43" >> /etc/modprobe.d/blacklist rmmod ssb | echo "blacklist ssb" >> /etc/modprobe.d/blacklist rmmod wl rmmod bcma Loading module: modprobe lib80211 modprobe lib80211_crypt_tkip (optional) modprobe wl ==== BIOS ==== For updating the bios using the EZ-Flash tool you should create a fat16 usb stick and then copy the rom named as "1215N.ROM" Latest bios version: 0503 (09/07/10) bc74d99e0ec54a46fb74500dd9baaab87002869d 977 975 2015-11-05T18:51:07Z Mega-lnx 347 wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS eeepc 1215N == == Device modules == ====Ethernet==== Network nic: Atheros AR8152 - Kernel version 2.6.x <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet (1000 Mbit) ---> < x > Atheros L1C Gigabit Ethernet </pre> - Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet driver support ---> [ x ] Atheros Devices < x > Atheros L1C Gigabit Ethernet support </pre> Building the proprietary driver: tar xcvf arl...-x.x.x.tar.gz cd arl...-x.x.x/src ln -s config.h autoconf.h make insmod arl1e/arl1c ====Wifi==== The BCM4313 wireless card has two controller solutions, the wl and the brcmsmac (brcm80211). Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network device support ---> [ x ] Wireless LAN ---> [ M ] USB ZD1201 based Wireless device support [ M ] Broadcom IEEE802.11n PCIe SoftMAC WLAN driver [ M ] IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) Broadcom specif AMBA < M > BCMA suport [ M ] Support for BCMA on PCI-Host bus </pre> or Proprietary driver: The Broadcom STA driver, can be downloaded [http://www.broadcom.com/support/802.11/linux_sta.php here]. tar zxvf hybrid-portsrc....tar.gz make make install Optional: Compiles against desired API make API=WEXT make API=CFG80211 Kernel 3.3.2 error changes the follow line .ndo_set_multicast_list= to .ndo_set_rx_node= Unload Linux modules: rmmod b43 | echo "blacklist b43" >> /etc/modprobe.d/blacklist rmmod ssb | echo "blacklist ssb" >> /etc/modprobe.d/blacklist rmmod wl rmmod bcma Loading module: modprobe lib80211 modprobe lib80211_crypt_tkip (optional) modprobe wl == BIOS == For updating the bios using the EZ-Flash tool you should create a fat16 usb stick and then copy the rom named as "1215N.ROM" Latest bios version: 0503 (09/07/10) ==Contributors== *[http://slackwiki.org/User:mega-lnx Guilherme] a63cd153833d32c6ac61a1719ea3700459bbd911 980 977 2015-11-05T18:56:08Z Mega-lnx 347 /* Contributors */ wikitext text/x-wiki [[Category:Hardware]] ==Slackware on an ASUS eeepc 1215N == == Device modules == ====Ethernet==== Network nic: Atheros AR8152 - Kernel version 2.6.x <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet (1000 Mbit) ---> < x > Atheros L1C Gigabit Ethernet </pre> - Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network Device Support ---> [ x ] Ethernet driver support ---> [ x ] Atheros Devices < x > Atheros L1C Gigabit Ethernet support </pre> Building the proprietary driver: tar xcvf arl...-x.x.x.tar.gz cd arl...-x.x.x/src ln -s config.h autoconf.h make insmod arl1e/arl1c ====Wifi==== The BCM4313 wireless card has two controller solutions, the wl and the brcmsmac (brcm80211). Kernel version 3.0.x + <pre> Device Drivers ---> [ x ] Network device support ---> [ x ] Wireless LAN ---> [ M ] USB ZD1201 based Wireless device support [ M ] Broadcom IEEE802.11n PCIe SoftMAC WLAN driver [ M ] IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) Broadcom specif AMBA < M > BCMA suport [ M ] Support for BCMA on PCI-Host bus </pre> or Proprietary driver: The Broadcom STA driver, can be downloaded [http://www.broadcom.com/support/802.11/linux_sta.php here]. tar zxvf hybrid-portsrc....tar.gz make make install Optional: Compiles against desired API make API=WEXT make API=CFG80211 Kernel 3.3.2 error changes the follow line .ndo_set_multicast_list= to .ndo_set_rx_node= Unload Linux modules: rmmod b43 | echo "blacklist b43" >> /etc/modprobe.d/blacklist rmmod ssb | echo "blacklist ssb" >> /etc/modprobe.d/blacklist rmmod wl rmmod bcma Loading module: modprobe lib80211 modprobe lib80211_crypt_tkip (optional) modprobe wl == BIOS == For updating the bios using the EZ-Flash tool you should create a fat16 usb stick and then copy the rom named as "1215N.ROM" Latest bios version: 0503 (09/07/10) ==Contributors== *[http://slackwiki.com/User:mega-lnx Guilherme] a7836600f8f5a7b8d044652dd2774ca192a5ef0a Btfirmware-nonfree 0 321 981 2015-11-25T04:15:21Z Rworkman 13 Created page with "I recently was presented with a Thinkpad T430s containing a Broadcom BCM20702 bluetooth chip, and bluetooth wouldn't work at all on it. <code>$ lsusb Bus 003 Device 009: ID 0..." wikitext text/x-wiki I recently was presented with a Thinkpad T430s containing a Broadcom BCM20702 bluetooth chip, and bluetooth wouldn't work at all on it. <code>$ lsusb Bus 003 Device 009: ID 0a5c:21e6 Broadcom Corp. BCM20702 Bluetooth 4.0 [ThinkPad] </code> On boot, I saw this in /var/log/syslog: <br /> <code>Nov 24 13:37:35 liberty kernel: bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0a5c-21e6.hcd failed with error -2</code> <br /> Sure enough, /lib/firmware/brcm/BCM20702A1-0a5c-21e6.hcd did not exist. After a bit of research, I determined that nobody had already written clear instructions on just how to obtain the needed firmware. There were a few results with links to different firmware that someone had already obtained from some mysterious source, and vague references about "get it from your Windows system" and such, but well, I don't have a Windows system. I went to the Lenovo support site, downloaded the bluetooth driver file (currently located at https://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles/g4wb12ww.exe but of course, this link will not always be valid), and poked around a bit in its contents. To do that, you'll first need to get innoextract (see http://constexpr.org/innoextract/ or search SlackBuilds.org for it). <br /> <code> root@liberty:~/fw# ls <br /> g4wb12ww.exe <br /> root@liberty:~/fw# innoextract g4wb12ww.exe <br /> ...lots of output, all extracted to an "app/" directory... <br /> </code> <br /> Now to see if we can find the important bits in here... I notice that the firmware expected to be loaded has "0a5c-21e6" in the name, and the usb ID of the bluetooth hardware is "0a5c:21e6" so let's poke around and see if we can find anything with that name: <br /> <br /> <code>find app/ -name "*0a5c*" -o -name "*0A5C*"</code> <br /> <br /> Hmm, no output. Okay. <br /> <br /> <code> <br /> root@liberty:~/fw#grep -Eir 0a5c.*21e6 . <br /> Binary file ./app/Win64/BTW.msi matches <br /> ./app/Win64/bcbtums-win7x64-brcm.inf:%BRCM20702Thinkpad.DeviceDesc%=RAMUSB21E6, USB\VID_0A5C&PID_21E6 ; 20702 non-UHE Lenovo Japan <br /> Binary file ./app/Win32/BTW.msi matches <br /> ./app/Win32/bcbtums-win7x86-brcm.inf:%BRCM20702Thinkpad.DeviceDesc%=RAMUSB21E6, USB\VID_0A5C&PID_21E6 ; 20702 non-UHE Lenovo Japan <br /> </code> <br /> <br /> Well, I don't want to poke around in binary files too much, but I know that .inf are plaintext files, so let's look in there. That "DeviceDesc" looks important, so we'll search for that in the .inf file once we get it opened. I use vi, but hopefully you know your editor well enough to do the equivalent, and you'll find something like this: <br /> <br /> <code> ... <br /> %BRCM20702Thinkpad.DeviceDesc%=RAMUSB21E6, USB\VID_0A5C&PID_21E6 ; 20702 non-UHE Lenovo Japan <br /> ... <br /> ;;;;;;;;;;;;;RAMUSB21E6;;;;;;;;;;;;;;;;; <br /> <br /> [RAMUSB21E6.CopyList]<br /> bcbtums.sys<br /> BCM20702A1_001.002.014.0449.0462.hex<br /> <br /> [RAMUSB21E6.NTX86]<br /> Include=bth.inf<br /> Needs=BthUsb.NT<br /> FeatureScore=F0<br /> CopyFiles=RAMUSB21E6.CopyList<br /> <br /> [RAMUSB21E6.NTX86.hw]<br /> AddReg=RAMUSB21E6.NTX86.hw.reg<br /> <br /> [RAMUSB21E6.NTX86.hw.reg]<br /> HKR,,LowerFilters, 0x00010000, "bcbtums"<br /> HKR,,%RAMPatchFileName%,0x00000, "BCM20702A1_001.002.014.0449.0462.hex"<br /> HKR,,%RemoteWakeEnabled%,0x00010001,1<br /> HKR,,%DeviceRemoteWakeSupported%,0x00010001,1<br /> <br /> [RAMUSB21E6.NTX86.Services]<br /> needs=BthUsb.NT.Services<br /> AddService=bcbtums,,BCBTUMS_Service_Inst, BTWSECFL_EventLog_Inst<br /> <br /> ... <br /> </code> <br /> I happen to know from my research that the firmware files are .hex file, so this line is awesome to see: <br /> <code>HKR,,%RAMPatchFileName%,0x00000, "BCM20702A1_001.002.014.0449.0462.hex"</code> <br /> Copy that file out of the directory structure into a place that's easier to work with:<br /> <code> root@liberty:~/fw# cp app/Win64/BCM20702A1_001.002.014.0449.0462.hex . <br /> root@liberty:~/fw# ls <br /> BCM20702A1_001.002.014.0449.0462.hex app/ g4wb12ww.exe <br /> </code> <br /> Now we need to put this in a form that the linux kernel expects, so that's where hex2hcd comes in: <br /> <code> root@liberty:~/fw# git clone git://github.com/jessesung/hex2hcd.git <br /> Cloning into 'hex2hcd'...<br /> remote: Counting objects: 8, done.<br /> remote: Compressing objects: 100% (7/7), done.<br /> remote: Total 8 (delta 1), reused 8 (delta 1), pack-reused 0<br /> Receiving objects: 100% (8/8), 8.71 KiB | 0 bytes/s, done.<br /> Resolving deltas: 100% (1/1), done.<br /> Checking connectivity... done.<br /> root@liberty:~/fw# cd hex2hcd/<br /> root@liberty:~/fw/hex2hcd# make<br /> gcc -O2 -march=native hex2hcd.c -o hex2hcd<br /> </code> Now we use hex2hcd: <code> root@liberty:~/fw/hex2hcd# ./hex2hcd ../BCM20702A1_001.002.014.0449.0462.hex ../BCM20702A1-0a5c-21e6.hcd <br /> ... lots of text and binary data ...<br /> </code> Finally, let's back up a directory, make sure what think is there is actually there, and copy it into place: <code> root@liberty:~/fw/hex2hcd# cd ..<br /> root@liberty:~/fw# ls<br /> BCM20702A1-0a5c-21e6.hcd BCM20702A1_001.002.014.0449.0462.hex app/ g4wb12ww.exe hex2hcd/<br /> root@liberty:~/fw# cp BCM20702A1-0a5c-21e6.hcd /lib/firmware/brcm/<br /> </code> The first person who finds this useful is expected to clean up the formatting and such. :-) Enjoy! -RW 68edaa3440483d8c8b87185bc7476beba3ef1b12 Bluetooth 0 70 982 91 2015-11-25T04:20:11Z Rworkman 13 Add note re adding nonfree firmware wikitext text/x-wiki [[Category:Tutorials]] == Introduction == This tutorial is meant to simplify the process of configuring a GNU/Linux Distribution, specifically Slackware, to use Bluetooth wireless technology. I will show you step by step how I setup my system and got Bluetooth functioning. Since it is unlikely that you have the exact same hardware that I do, you may need to modify a few steps to fit your needs. == Example System Information == This is a list of my specific hardware that applies to this topic. Do not worry if your's is not exactly the same because you can still use this information to guide you through the process. ;Motherboard (USB Ports) :[http://www.msicomputer.com/product/p_spec.asp?model=K8N_Neo4_Platinum/SLI MSI Neo4 Platinum/SLI] ;Bluetooth USB Dongle :[http://www.amazon.com/gp/product/B0001Q5SZ0/103-7636612-6018206?v=glance&n=172282 Kensington Bluetooth USB Adapter (33085)] ;Cell Phone :[http://www.motorola.com/motoinfo/product/details.jsp?globalObjectId=72 Motorola V551] ;[http://www.slackware.org Slackware-Current (as of 5/31/06)] ;[http://www.kernel.org Kernel 2.6.16.16] (worked on 2.6.15.6 also) == Kernel Configuration == The first step is enabling the drivers for USB and Bluetooth in your kernel. I'm not sure exactly which kernel version began including Bluez Bluetooth drivers, but my 2.6.15.6 kernel had them. [http://www.westmaster.com/zidek/p900/bluetooth/ From this page], it looks like 2.6.5 did not have Bluetooth drivers and needed to be patched. If you are running an older kernel, follow the directions on that page to apply the Bluez patch. If you are unfamiliar with the kernel configuration/compilation sequence, then check out the [[Kernel26Compilation]] tutorial before proceeding. === USB support === For the less-advanced user (like myself), it is safe to go through and answer `M` to everything that you can, and `Y` to everything that can not take `M`. You should not enable any of the "debug" options, I'm not 100% sure why, but I'm pretty sure that these options will give you verbose output that is only needed for kernel hackers. Below, you can see the options I have set in my .config file for my kernel. The options listed are just those that I thought pertained to getting my USB ports working and able to recognize my USB dongle. # # USB support # CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y CONFIG_USB=y # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y CONFIG_USB_BANDWIDTH=y # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_SUSPEND is not set # CONFIG_USB_OTG is not set # # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=m CONFIG_USB_EHCI_SPLIT_ISO=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_ISP116X_HCD=m CONFIG_USB_OHCI_HCD=y # CONFIG_USB_OHCI_BIG_ENDIAN is not set CONFIG_USB_OHCI_LITTLE_ENDIAN=y CONFIG_USB_UHCI_HCD=y CONFIG_USB_SL811_HCD=m === Bluetooth support === Again, it is safe to enable everything that says "Bluetooth" as a Module. Below are the options from my .config file that I thought might be relevant. # # FIR device drivers # CONFIG_USB_IRDA=m CONFIG_SIGMATEL_FIR=m CONFIG_NSC_FIR=m CONFIG_WINBOND_FIR=m CONFIG_TOSHIBA_FIR=m CONFIG_SMC_IRCC_FIR=m CONFIG_ALI_FIR=m CONFIG_VLSI_FIR=m CONFIG_VIA_FIR=m CONFIG_BT=m CONFIG_BT_L2CAP=m CONFIG_BT_SCO=m CONFIG_BT_RFCOMM=m CONFIG_BT_RFCOMM_TTY=y CONFIG_BT_BNEP=m CONFIG_BT_BNEP_MC_FILTER=y CONFIG_BT_BNEP_PROTO_FILTER=y CONFIG_BT_HIDP=m # # Bluetooth device drivers # CONFIG_BT_HCIUSB=m CONFIG_BT_HCIUSB_SCO=y CONFIG_BT_HCIUART=m CONFIG_BT_HCIUART_H4=y CONFIG_BT_HCIUART_BCSP=y CONFIG_BT_HCIBCM203X=m CONFIG_BT_HCIBPA10X=m CONFIG_BT_HCIBFUSB=m CONFIG_BT_HCIVHCI=m CONFIG_IEEE80211=m # CONFIG_IEEE80211_DEBUG is not set CONFIG_IEEE80211_CRYPT_WEP=m CONFIG_IEEE80211_CRYPT_CCMP=m CONFIG_IEEE80211_CRYPT_TKIP=m Now, just compile the kernel and reboot in to it. == Userland == At a bare minimum, you need to install bluez-libs and bluez-utils from http://www.bluez.org. I used the binary package provided by [http://www.develia.org/tarballs.php?p=networking develia.org], but that was before I knew about SlackBuild scripts. If you can not find a SlackBuild script and you do not want to create your own, you should use [[Checkinstall]] at the very least. At this time, you might as well install KDE-Bluetooth, also. I think I grabbed my binary package from [http://www.linuxpackages.net LinuxPackages], but that was also before I knew better. You can either grab the source code on it's own from [http://sourceforge.net/project/showfiles.php?group_id=89888 SoureForge] or as a part of [ftp://ftp.kde.org/pub/kde/snapshots/kdeextragear-multimedia.tar.bz2 KDE Extra Gear]. Again, use a Slackbuild script or [[Checkinstall]] to install these. For more information on SlackBuild scripts, you can see the following tutorials: [[SlackBuild Scripts]], [[Writing A SlackBuild_ Script]], [[Slack-desc]], [[Different Approach To Buildscripts]], [[Checkinstall]] If you happen to discover that your bluetooth chip is a Broadcom that requires nonredistributable firmware (which necessarily isn't in Slackware), then see [[Btfirmware-nonfree]] == Configuration == Now, should have all of the tools you need to start connecting your computer to your bluetooth devices. First, check the status of the bluetooth dongle with hciconfig. # hciconfig hci0: Type: USB BD Address: 00:11:22:33:44:55 ACL MTU: 377:10 SCO MTU: 16:0 UP RUNNING PSCAN ISCAN RX bytes:385 acl:0 sco:0 events:18 errors:0 TX bytes:322 acl:0 sco:0 commands:18 errors:0 If yours says "UP RUNNING" then you are good to go. If not, you need to bring the interface up. # hciconfig hci0 up # hciconfig hci0 hci0: Type: USB BD Address: 00:11:22:33:44:55 ACL MTU: 377:10 SCO MTU: 16:0 UP RUNNING PSCAN ISCAN RX bytes:385 acl:0 sco:0 events:18 errors:0 TX bytes:322 acl:0 sco:0 commands:18 errors:0 Since the dongle works, it's time to configure the programs that will make the actual connections. Use your favorite text editor to edit the PIN in /etc/bluetooth/pin: # gvim /etc/bluetooth/pin The PIN needs to be all digits. I'm not sure if it needs to be exactly four (4) digits, but four (4) works well. Here is an example: PIN:1234 Then you need to edit /etc/bluetooth/hcid.conf # # HCI daemon configuration file. # # HCId options options { autoinit yes; #security auto; security user; pairing multi; pin_helper /opt/kde/lib/kdebluetooth/kbluepin; #pin_helper /usr/bin/bluepin; #pin_helper /usr/bin/pin; #dbus_pin_helper; } device { name "BlueZ %h (%d)"; class 0x3e0100; #pkt_type DH1,DM1,HV1; iscan enable; pscan enable; lm accept; lp rswitch,hold,sniff,park; # Authentication and Encryption (Security Mode 3) #auth enable; #encrypt enable; } === Choosing a PIN Helper === From all the other HOWTO's I read, I got the impression that the /usr/bin/bluepin script supplied with the Bluez-utils was junk. I found a nice, simple replacement script on this page http://orin.meinlschmidt.org/~znouza/doc/r51/. I will duplicate it here just for ease, but all rights and respect go to whoever made that page. Use your favorite text editor and create the new file /usr/bin/pin: #!/bin/bash # original script from http://orin.meinlschmidt.org/~znouza/doc/r51/ cat /etc/bluetooth/pin when you are done editing, save and close the file, then make it executable. Choose your permissions wisely. # chmod 710 /usr/bin/pin # ls -la /usr/bin/pin -rwx--x--- 1 root root 35 2006-04-09 19:19 /usr/bin/pin This /usr/bin/pin script will suffice for pretty much any way you want to connect to your phone. If you want to use kdebluetooth to connect to your phone, then use kbluepin. The example hcid.conf file above is already setup to use kbluepin. To use /usr/bin/pin, simply comment out the kbluepin line and remove the comment character(#) from the /usr/bin/pin line. === Making the Connection === Next, you need to start up the hcid and sdpd daemons. It is a good idea to add these to /etc/rc.d/rc.local so they start automatically with each reboot. At the command line type: # /usr/sbin/hcid # /usr/sbin/sdpd and add these lines to /etc/rc.d/rc.local /usr/sbin/hcid /usr/sbin/sdpd Then, you can set your phone to "discover" mode, allowing other devices to see it is present, and scan for it. On the Motorola V551 you go to Settings > Connection > Bluetooth Link > Setup > Find Me. # hcitool scan Scanning ... 00:12:34:56:78:9A Motorola Phone Using the hardware address from the scan above, you can find out a lot of information about your phone. # sdptool records 00:12:34:56:78:9A Service Name: Dial-up networking Gateway Service Description: Dial-up networking Gateway Service Provider: Cingular Service RecHandle: 0x10001 Service Class ID List: "Dialup Networking" (0x1103) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 1 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 code_ISO639: 0x6672 encoding: 0x6a base_offset: 0xd800 code_ISO639: 0x6573 encoding: 0x6a base_offset: 0xd803 code_ISO639: 0x7074 encoding: 0x6a base_offset: 0xd806 Profile Descriptor List: "Dialup Networking" (0x1103) Version: 0x0100 Service Name: Voice Gateway Service Description: Headset Audio Gateway Service Provider: Cingular Service RecHandle: 0x10003 Service Class ID List: "Headset Audio Gateway" (0x1112) "Generic Audio" (0x1203) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 3 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 code_ISO639: 0x6672 encoding: 0x6a base_offset: 0xd800 code_ISO639: 0x6573 encoding: 0x6a base_offset: 0xd803 code_ISO639: 0x7074 encoding: 0x6a base_offset: 0xd806 Profile Descriptor List: "Headset" (0x1108) Version: 0x0100 Service Name: Hands-Free voice gateway Service Description: Hands-Free voice gateway Service Provider: Cingular Service RecHandle: 0x10007 Service Class ID List: "Handfree Audio Gateway" (0x111f) "Generic Audio" (0x1203) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 7 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 code_ISO639: 0x6672 encoding: 0x6a base_offset: 0xd800 code_ISO639: 0x6573 encoding: 0x6a base_offset: 0xd803 code_ISO639: 0x7074 encoding: 0x6a base_offset: 0xd806 Profile Descriptor List: "Handsfree" (0x111e) Version: 0x0101 Service Name: OBEX Object Push Service Description: OBEX Object Push Service Provider: Cingular Service RecHandle: 0x10008 Service Class ID List: "OBEX Object Push" (0x1105) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 8 "OBEX" (0x0008) Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 code_ISO639: 0x6672 encoding: 0x6a base_offset: 0xd800 code_ISO639: 0x6573 encoding: 0x6a base_offset: 0xd803 code_ISO639: 0x7074 encoding: 0x6a base_offset: 0xd806 Profile Descriptor List: "OBEX Object Push" (0x1105) Version: 0x0100 Service Name: OBEX File Transfer Service Description: OBEX File Transfer Service Provider: Cingular Service RecHandle: 0x10009 Service Class ID List: "OBEX File Transfer" (0x1106) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 9 "OBEX" (0x0008) Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 code_ISO639: 0x6672 encoding: 0x6a base_offset: 0xd800 code_ISO639: 0x6573 encoding: 0x6a base_offset: 0xd803 code_ISO639: 0x7074 encoding: 0x6a base_offset: 0xd806 Profile Descriptor List: "OBEX File Transfer" (0x1106) Version: 0x0100 === Radio Frequency Communication (RFCOMM) === This is one way to use your phone as a modem. I believe that most Cingular and T-Mobile (GSM/GPRS) in the USA use channel 1 for the Dial-Up Gateway. One way to take advantage of this is to use rfcomm to connect to your phone. In order to do that, you will need to edit /etc/bluetooth/rfcomm.conf: # # RFCOMM configuration file. # rfcomm0 { # Automatically bind the device at startup bind yes; # Bluetooth address of the device device 00:12:34:56:78:9A; # RFCOMM channel for the connection channel 1; # Description of the connection comment "Motorola V551"; } Then connect to the phone by typing: # rfcomm connect 0 I won't go in to any more details because I don't use my phone as a modem. But, if you want to use your phone that way, there are plenty of resources out there to show you what to do. === KDE Bluetooth === I don't use KDE as my window manager/desktop, but kdebluetooth should automatically run when you start KDE. If you don't use KDE, like me, you can start up the taskbar daemon by typing "kbluetoothd" in a terminal. You can then use the KDE OBEX Push Client to transfer files to your phone. I haven't figured out how to get files off of my phone (like pictures), but I have seen [http://openobex.triq.net/obexftp/obexftp obexftp] and [http://openobex.triq.net/obexfs obexfs] which look promising. When I test those out, I will update this accordingly. == References == http://www.linuxquestions.org/hcl/showproduct.php?product=2879&cat=53 http://www.westmaster.com/zidek/p900/bluetooth/ http://www.bluez.org http://www.develia.org/tarballs.php?p=networking http://kde-bluetooth.sourceforge.net/ http://extragear.kde.org/ http://www.gentoo.org/doc/en/bluetooth-guide.xml b5ad2a96953ee8e1b75aecdabcb40bbf8006cf12 Slackware On Odroid U3 0 322 984 2016-11-16T14:17:13Z Gv 356 Slackware 14.2 installation on Odroid U3 wikitext text/x-wiki Slackware On Odroid U3 28f1d0a4120b364ddbd60944a18e02f97497abcb 985 984 2016-11-16T14:54:14Z Gv 356 Slackware 14.2 On Odroid U3 wikitext text/x-wiki == Slackware 14.2 On Odroid U3 == === 3+ partition method === In 3 partition method, installer root , like from the initrd image, is installed onto second par tion, and booted to install the distribution to a third partition. You may refer to multiboot document ( [https://github.com/gv1/Odroid.U3/blob/master/multiboot/README] ) to do a two partition method of installation. It is a bit more complicated than three partition method. This method can further be simplified to do installation into a single partition, provided a suitable u-boot firmware is fused. See the multiboot page at github [https://github.com/gv1/Odroid.U3/tree/master/multiboot] for a two partition method. Ref: # [https://github.com/gv1/Odroid.U3] === Requirements === ==== 16/32 GB Micro SD card ==== You may also install on to a pen drive or external hard disk for usb and boot from there. But you still will require a micro sd card for booting. ==== A working Ubuntu image like ubuntu-16.04.1.lts ==== [http://dn.odroid.com/4412/Linux/ubuntu_16.04lts/ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz] ==== Slackware 14.2 for arm ==== [http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.2] rsync --exclude '*/source/*' --exclude '*/testing/*' -Pavv --delete ftp.arm.slackware.com::slackwarearm/slackwarearm-14.2. === Installation === ==== Install the u-boot header and FAT partiotion for zIamge, uInitrd and boot.ini ==== unxz ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz xzcat --verbose ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz | dd of=/dev/sdX count=300000 ==== Create partitions on SD card ==== fdisk /dev/sdX From partition created by dd from img in step 1, delete second and add three more ( or as many desired ). First partion created from the image has size of ~128MB. Make this partition bootable ( Boot flag on ), if not already so. Size of second partion should hold the installer initrd ( uncompressed ) and also the distribution (slackware) for installation, something like 4GB. Third partition is where the distributions are installed. Size in the order of 24GB or so. Fourth is the swap partion - 2GB or so. Device Boot Start End Sectors Size Id Type /dev/sdX1 * 6144 268287 262144 128M 6 FAT16 /dev/sdX2 268288 8656895 8388608 4G 83 Linux /dev/sdX3 8656896 58988543 50331648 24G 83 Linux /dev/sdX4 58988544 62945279 3956736 1.9G 82 Linux swap ==== Mount partition two, install 14.2 setup initrd image, copy kernel modules, firmware and installation sources. ==== From PC host / Odroid running other Linux <source> mkdir odroid cd ordoid mkdir boot mkdir root mkfs.ext4 /dev/sdX2 tune2fs /dev/sdX2 -L installer mount /dev/sdX2 boot # copy / download distribution files, say slackwarearm-14.2 to boot/ wget http://www.arm.slackware.com/slackwarearm/slackwarearm-14.2/isolinux/initrd-armv7.img or mkdir boot/slackwarearm-14.2 cd boot/slackwarearm-14.2 For downloading: Refer to http://arm.slackware.com and also consider donations. cd slackwarearm-14.2 rsync --exclude '*/source/*' --exclude '*/testing/*' -Pavv --delete ftp.arm.slackware.com::slackwarearm/slackwarearm-14.2 . cd ../.. cd boot gzip -dc ../slackwarearm-14.2/isolinux/initrd-armv7.img | cpio -i --make-directories sync cd lib rm -rf modules/* rm -rf firmware/* # mount and copy from Ubuntu. </source> ==== Install ubuntu on third partition, copy module and firmware files to installer partition. ==== <source> mkdir ubuntu if you have the image installed onto an sd card, use the second partition from there. mount -r /dev/sdY2 ubuntu or if you only have the image ( first unxz ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz ) parted -s ubuntu-16.04-mate-odroid-u2u3-20160920.img unit B print find partition 2 start offset from the output. p2offset=.... mount second partition from ubuntu-16.04-mate-odroid-u2u3-20160920.img - mount -o loop,ro,offset=$p2offset ubuntu-16.04-mate-odroid-u2u3-20160920.img ubuntu mkfs.ext4 /dev/sdX3 tune2fs /dev/sdX3 -L slackware14.2 mount /dev/sdX3 root mkdir root/ubuntu-16.04.1.lts mkdir root/installer mkdir root/slackware-14.2 (cd ubuntu; tar cfz - *) | (cd root/ubuntu-16.04.1.lts; tar xfz - ) copy modules and firmware? to installer. (cd root/ubuntu-16.04.1.lts/lib/ ; tar cfz - modules firmware ) | (cd boot/lib/; tar xfz - ) sync sync umount ubuntu umount boot umount root </source> ==== Reboot odroid, and if everything goes fine, will boot into slackware installer. ==== press enter to login as root run setup: setup During installation, Choose partition 3 as target, and dont' format it. It already has Ubuntu on it. Choose source directory for installation - /slackwarearm-14.2/slackware Proceed with the normal slackware installation. ==== Modify boot.ini and reboot. ==== <source> mount /dev/sdX1 boot edit and modify boot/boot.ini to boot from parition 3 setenv bootargs "console=tty1 console=ttySAC1,115200n8 root=/dev/mmcblk0p3 rootwa it ro mem=2047M ${videoconfig}" sync umount boot </source> ==== If you are planning for multiboot ==== <source> cd root mv * slackware-14.2 mv slackware-14.2/ubuntu-16.04.1.lts . Now you have both Slackware and Ubuntu on same partition. See README.odroid.u3.multiboot to see how to get a multiboot setup ( choo se distribution at boot time ) so that you can choose the distribution at boot time. No fancy chooser this time, you need to enter the number corresponding to the distro at a prompt. === Other info === ==== Mouse pointer issue.==== Xorg ( with blackbox wm ) seems have no mouse curser until you open an xterm or s o by clicking the right mouse button. Mouse pointer is okay if you have an .xinitrc that starts an xterm or so. ==== No web browsers. ==== Browsers you can compile and run on odroid u3, slackware 14.2: sadly none of these browsers are available in the distribution. text based ones like lynx are there. Emacs supports web browsing mode too. Dillo version 3.0.5 ( fast , but premitive ) first step Mozilla Firefox 50.0 ( compile from source, took long time like more than 6 hours) [https://github.com/gv1/Odroid.U3/blob/master/firefox-50.0.tar.xz] ==== No libreoffice.=== Office compilation - fail Libreoffice libreoffice-5.2.2.2 compiled, ( took very long time, 12 ho urs or more ) starts, but fall into libreoffice docuement discovery mode and fail (repeat): (soffice:1091): Gtk-WARNING **: Theme parsing error: <data>:1:59: 'min-width' is not a va lid property name (soffice:1091): Gtk-WARNING **: Theme parsing error: <data>:1:76: 'min-height' is not a v alid property name Shutdown seems not shutdown/poweroff complete, but keeps printing message, should not hav e reached here. But no other issues on reboot after shutdown. This gets fixed with [https://github.com/gv1/Odroid.U3/tree/master/linux-4.8.y] [https://github.com/gv1/Odroid.U3/tree/master/u-boot-stable] c7756d0fb04b86fb264b65a12f9def3b563ac0ff 986 985 2016-11-16T17:16:01Z Gv 356 wikitext text/x-wiki == Slackware 14.2 On Odroid U3 == === 3+ partition method === In 3 partition method, installer root , like from the initrd image, is installed onto second par tion, and booted to install the distribution to a third partition. You may refer to multiboot document ( [https://github.com/gv1/Odroid.U3/blob/master/multiboot/README Multiboot README] ) to do a two partition method of installation. It is a bit more complicated than three partition method. This method can further be simplified to do installation into a single partition, provided a suitable u-boot firmware is fused. See the multiboot page at github [https://github.com/gv1/Odroid.U3/tree/master/multiboot Multiboot] for a two partition method. Ref: # [https://github.com/gv1/Odroid.U3 Odroid U3 related pages, from Gv] === Requirements === ==== 16/32 GB Micro SD card ==== You may also install on to a pen drive or external hard disk for usb and boot from there. But you still will require a micro sd card for booting. ==== A working Ubuntu image like ubuntu-16.04.1.lts ==== [http://dn.odroid.com/4412/Linux/ubuntu_16.04lts/ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz] ==== Slackware 14.2 for arm ==== [http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.2 Slackwarearm-14.2]] rsync --exclude '*/source/*' --exclude '*/testing/*' -Pavv --delete ftp.arm.slackware.com::slackwarearm/slackwarearm-14.2. === Installation === ==== Install the u-boot header and FAT partiotion for zIamge, uInitrd and boot.ini ==== ===== Method one, using Ubuntu 16.04 boot files ===== xzcat --verbose ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz | dd of=/dev/sdX count=300000 ==== Create partitions on SD card ==== fdisk /dev/sdX From partition created by dd from img in step 1, delete second and add three more ( or as many desired ). First partion created from the image has size of ~128MB. Make this partition bootable ( Boot flag on ), if not already so. Size of second partion should hold the installer initrd ( uncompressed ) and also the distribution (slackware) for installation, something like 4GB. Third partition is where the distributions are installed. Size in the order of 24GB or so. Fourth is the swap partion - 2GB or so. Device Boot Start End Sectors Size Id Type /dev/sdX1 * 6144 268287 262144 128M 6 FAT16 /dev/sdX2 268288 8656895 8388608 4G 83 Linux /dev/sdX3 8656896 58988543 50331648 24G 83 Linux /dev/sdX4 58988544 62945279 3956736 1.9G 82 Linux swap ===== Method 2, using u-boot files ===== See [https://github.com/gv1/Odroid.U3/tree/master/u-boot-stable u-boot] Parition the card like as in first method, manually. Next make the card u-boot capable by fusing the required firmware. Use sd_fusing_all.sh to fuse required U-Boot files on to sd card. See [https://github.com/gv1/Odroid.U3/tree/master/u-boot-stable u-boot-stable] directory for more info. ==== Mount partition two, install 14.2 setup initrd image, copy kernel modules, firmware and installation sources. ==== From PC host / Odroid running other Linux mkdir odroid cd ordoid mkdir boot mkdir root mkfs.ext4 /dev/sdX2 tune2fs /dev/sdX2 -L installer mount /dev/sdX2 boot # copy / download distribution files, say slackwarearm-14.2 to boot/ wget http://www.arm.slackware.com/slackwarearm/slackwarearm-14.2/isolinux/initrd-armv7.img mkdir boot/slackwarearm-14.2 cd boot/slackwarearm-14.2 For downloading: Refer to http://arm.slackware.com and also consider donations. rsync --exclude '*/source/*' --exclude '*/testing/*' -Pavv --delete ftp.arm.slackware.com::slackwarearm/slackwarearm-14.2 . cd ../.. Preparing the installer root partition: cd boot gzip -dc ../slackwarearm-14.2/isolinux/initrd-armv7.img | cpio -i --make-directories sync cd lib rm -rf modules/* rm -rf firmware/* # mount and copy from Ubuntu. ==== Install ubuntu on third partition, copy module and firmware files to installer partition. ==== mkdir ubuntu if you have the image installed onto an sd card, use the second partition from there. mount -r /dev/sdY2 ubuntu Or If you only have the image First unxz ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz ) parted -s ubuntu-16.04-mate-odroid-u2u3-20160920.img unit B print find partition 2 start offset from the output. p2offset=.... mount second partition from ubuntu-16.04-mate-odroid-u2u3-20160920.img - mount -o loop,ro,offset=$p2offset ubuntu-16.04-mate-odroid-u2u3-20160920.img ubuntu Or # find info about partitions xzcat ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz | dd of=x.img count=1 file x.img # rm x.img xzcat ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz | dd of=ubuntu-16.04-mate-odroid-u2u3-20160920.img count=9216000 skip=268288 mount -o loop ubuntu-16.04-mate-odroid-u2u3-20160920.img ubuntu mkfs.ext4 /dev/sdX3 tune2fs /dev/sdX3 -L slackware14.2 mount /dev/sdX3 root mkdir root/ubuntu-16.04.1.lts mkdir root/installer mkdir root/slackware-14.2 (cd ubuntu; tar cfz - *) | (cd root/ubuntu-16.04.1.lts; tar xfz - ) # copy modules and firmware? to installer. (cd root/ubuntu-16.04.1.lts/lib/ ; tar cfz - modules firmware ) | (cd boot/lib/; tar xfz - ) sync sync umount ubuntu umount boot umount root ==== Reboot odroid, and if everything goes fine, will boot into slackware installer. ==== press enter to login as root run setup: setup During installation, Choose partition 3 as target, and dont' format it. It already has Ubuntu on it. Choose source directory for installation - /slackwarearm-14.2/slackware Proceed with the normal slackware installation. ==== Modify boot.ini and reboot. ==== mount /dev/sdX1 boot edit and modify boot/boot.ini to boot from parition 3 setenv bootargs "console=tty1 console=ttySAC1,115200n8 root=/dev/mmcblk0p3 rootwait ro mem=2047M ${videoconfig}" sync umount boot ==== If you are planning for multiboot ==== cd root mv * slackware-14.2 mv slackware-14.2/ubuntu-16.04.1.lts . Now you have both Slackware and Ubuntu on same partition. See [https://github.com/gv1/Odroid.U3/tree/master/multiboot multiboot] to see how to get a multiboot setup ( choose distribution at boot time ) so that you can choose the distribution at boot time. No fancy chooser this time, you need to enter the number corresponding to the distro at a prompt. === Other info === ==== Mouse pointer issue.==== Xorg ( with blackbox wm ) seems have no mouse curser until you open an xterm or s o by clicking the right mouse button. Mouse pointer is okay if you have an .xinitrc that starts an xterm or so. ==== No web browsers. ==== Browsers you can compile and run on odroid u3, slackware 14.2: sadly none of these browsers are available in the distribution. text based ones like lynx are there. Emacs supports web browsing mode too. #[http://www.dillo.org Dillo] version 3.0.5 ( fast , but premitive ) first step #[https://archive.mozilla.org/pub/PROJECT/releases/RELEASE/source/ Mozilla Firefox] 50.0 ( compile from source, took long time like more than 6 hours) [https://github.com/gv1/Odroid.U3/blob/master/firefox-50.0.tar.xz firefox-50.0.tar.xz] === No libreoffice.=== Office compilation - fail Libreoffice libreoffice-5.2.2.2 compiled, ( took very long time, 12 ho urs or more ) starts, but fall into libreoffice docuement discovery mode and fail (repeat): (soffice:1091): Gtk-WARNING **: Theme parsing error: <data>:1:59: 'min-width' is not a va lid property name (soffice:1091): Gtk-WARNING **: Theme parsing error: <data>:1:76: 'min-height' is not a v alid property name Shutdown seems not shutdown/poweroff complete, but keeps printing message, should not hav e reached here. But no other issues on reboot after shutdown. This gets fixed with [https://github.com/gv1/Odroid.U3/tree/master/linux-4.8.y linux-4.8.y] [https://github.com/gv1/Odroid.U3/tree/master/u-boot-stable u-boot-stable] e927b93e31704740f85aee8088b4934aa64e3818 987 986 2016-11-17T08:50:58Z Gv 356 wikitext text/x-wiki == Slackware 14.2 On Odroid U3 == === 3+ partition method === In 3 partition method, installer root , like from the initrd image, is installed onto second par tion, and booted to install the distribution to a third partition. You may refer to multiboot document ( [https://github.com/gv1/Odroid.U3/blob/master/multiboot/README Multiboot README] ) to do a two partition method of installation. It is a bit more complicated than three partition method. This method can further be simplified to do installation into a single partition, provided a suitable u-boot firmware is fused. See the multiboot page at github [https://github.com/gv1/Odroid.U3/tree/master/multiboot Multiboot] for a two partition method. Ref: # [https://github.com/gv1/Odroid.U3 Odroid U3 related pages, from Gv] === Requirements === ==== 16/32 GB Micro SD card ==== You may also install on to a pen drive or external hard disk for usb and boot from there. But you still will require a micro sd card for booting. ==== A working Ubuntu image like ubuntu-16.04.1.lts ==== [http://dn.odroid.com/4412/Linux/ubuntu_16.04lts/ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz] ==== Slackware 14.2 for arm ==== [http://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.2 Slackwarearm-14.2]] rsync --exclude '*/source/*' --exclude '*/testing/*' -Pavv --delete ftp.arm.slackware.com::slackwarearm/slackwarearm-14.2. === Installation === ==== Install the u-boot header and FAT partiotion for zIamge, uInitrd and boot.ini ==== ===== Method one, using Ubuntu 16.04 boot files ===== xzcat --verbose ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz | dd of=/dev/sdX count=300000 Here is some info on how to download just enough data from site: wget -qO- http://dn.odroid.com/4412/Linux/ubuntu_16.04lts/ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz | xzcat | dd of=x.img count=1 file x.img # rm x.img from x.img: DOS/MBR boot sector; partition 1 : ID=0x6, start-CHS (0x0,97,34), end-CHS (0x10,178,34), startsector 6144, 262144 sectors; partition 2 : ID=0x83, start-CHS (0x60,0,1), end-CHS (0x24e,94,16), startsector 268288, 9216000 sectors # wget -qO- http://dn.odroid.com/4412/Linux/ubuntu_16.04lts/ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz | xzcat | dd of=ubuntu-16.04-mate-odroid-u2u3-20160920.img count=$((6144+262144)) This is more useful when you want to download just partition one, not the entire distribution. ==== Create partitions on SD card ==== fdisk /dev/sdX From partition created by dd from img in step 1, delete second and add three more ( or as many desired ). First partion created from the image has size of ~128MB. Make this partition bootable ( Boot flag on ), if not already so. Size of second partion should hold the installer initrd ( uncompressed ) and also the distribution (slackware) for installation, something like 4GB. Third partition is where the distributions are installed. Size in the order of 24GB or so. Fourth is the swap partion - 2GB or so. Device Boot Start End Sectors Size Id Type /dev/sdX1 * 6144 268287 262144 128M 6 FAT16 /dev/sdX2 268288 8656895 8388608 4G 83 Linux /dev/sdX3 8656896 58988543 50331648 24G 83 Linux /dev/sdX4 58988544 62945279 3956736 1.9G 82 Linux swap ===== Method 2, using u-boot files ===== See [https://github.com/gv1/Odroid.U3/tree/master/u-boot-stable u-boot] Parition the card like as in first method, manually. Next make the card u-boot capable by fusing the required firmware. Use sd_fusing_all.sh to fuse required U-Boot files on to sd card. See [https://github.com/gv1/Odroid.U3/tree/master/u-boot-stable u-boot-stable] directory for more info. ==== Mount partition two, install 14.2 setup initrd image, copy kernel modules, firmware and installation sources. ==== From PC host / Odroid running other Linux mkdir odroid cd ordoid mkdir boot mkdir root mkfs.ext4 /dev/sdX2 tune2fs /dev/sdX2 -L installer mount /dev/sdX2 boot # copy / download distribution files, say slackwarearm-14.2 to boot/ wget http://www.arm.slackware.com/slackwarearm/slackwarearm-14.2/isolinux/initrd-armv7.img mkdir boot/slackwarearm-14.2 cd boot/slackwarearm-14.2 For downloading: Refer to http://arm.slackware.com and also consider donations. rsync --exclude '*/source/*' --exclude '*/testing/*' -Pavv --delete ftp.arm.slackware.com::slackwarearm/slackwarearm-14.2 . cd ../.. Preparing the installer root partition: cd boot gzip -dc ../slackwarearm-14.2/isolinux/initrd-armv7.img | cpio -i --make-directories sync cd lib rm -rf modules/* rm -rf firmware/* # mount and copy from Ubuntu. ==== Install ubuntu on third partition, copy module and firmware files to installer partition. ==== mkdir ubuntu if you have the image installed onto an sd card, use the second partition from there. mount -r /dev/sdY2 ubuntu Or If you only have the image First unxz ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz ) parted -s ubuntu-16.04-mate-odroid-u2u3-20160920.img unit B print find partition 2 start offset from the output. p2offset=.... mount second partition from ubuntu-16.04-mate-odroid-u2u3-20160920.img - mount -o loop,ro,offset=$p2offset ubuntu-16.04-mate-odroid-u2u3-20160920.img ubuntu Or # find info about partitions xzcat ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz | dd of=x.img count=1 file x.img # rm x.img xzcat ubuntu-16.04-mate-odroid-u2u3-20160920.img.xz | dd of=ubuntu-16.04-mate-odroid-u2u3-20160920.img count=9216000 skip=268288 mount -o loop ubuntu-16.04-mate-odroid-u2u3-20160920.img ubuntu mkfs.ext4 /dev/sdX3 tune2fs /dev/sdX3 -L slackware14.2 mount /dev/sdX3 root mkdir root/ubuntu-16.04.1.lts mkdir root/installer mkdir root/slackware-14.2 (cd ubuntu; tar cfz - *) | (cd root/ubuntu-16.04.1.lts; tar xfz - ) # copy modules and firmware? to installer. (cd root/ubuntu-16.04.1.lts/lib/ ; tar cfz - modules firmware ) | (cd boot/lib/; tar xfz - ) sync sync umount ubuntu umount boot umount root ==== Reboot odroid, and if everything goes fine, will boot into slackware installer. ==== press enter to login as root run setup: setup During installation, Choose partition 3 as target, and dont' format it. It already has Ubuntu on it. Choose source directory for installation - /slackwarearm-14.2/slackware Proceed with the normal slackware installation. ==== Modify boot.ini and reboot. ==== mount /dev/sdX1 boot edit and modify boot/boot.ini to boot from parition 3 setenv bootargs "console=tty1 console=ttySAC1,115200n8 root=/dev/mmcblk0p3 rootwait ro mem=2047M ${videoconfig}" sync umount boot ==== If you are planning for multiboot ==== cd root mv * slackware-14.2 mv slackware-14.2/ubuntu-16.04.1.lts . Now you have both Slackware and Ubuntu on same partition. See [https://github.com/gv1/Odroid.U3/tree/master/multiboot multiboot] to see how to get a multiboot setup ( choose distribution at boot time ) so that you can choose the distribution at boot time. No fancy chooser this time, you need to enter the number corresponding to the distro at a prompt. === Other info === ==== Mouse pointer issue.==== Xorg ( with blackbox wm ) seems have no mouse curser until you open an xterm or s o by clicking the right mouse button. Mouse pointer is okay if you have an .xinitrc that starts an xterm or so. ==== No web browsers. ==== Browsers you can compile and run on odroid u3, slackware 14.2: sadly none of these browsers are available in the distribution. text based ones like lynx are there. Emacs supports web browsing mode too. #[http://www.dillo.org Dillo] version 3.0.5 ( fast , but premitive ) first step #[https://archive.mozilla.org/pub/PROJECT/releases/RELEASE/source/ Mozilla Firefox] 50.0 ( compile from source, took long time like more than 6 hours) [https://github.com/gv1/Odroid.U3/blob/master/firefox-50.0.tar.xz firefox-50.0.tar.xz] === No libreoffice.=== Office compilation - fail Libreoffice libreoffice-5.2.2.2 compiled, ( took very long time, 12 ho urs or more ) starts, but fall into libreoffice docuement discovery mode and fail (repeat): (soffice:1091): Gtk-WARNING **: Theme parsing error: <data>:1:59: 'min-width' is not a va lid property name (soffice:1091): Gtk-WARNING **: Theme parsing error: <data>:1:76: 'min-height' is not a v alid property name Shutdown seems not shutdown/poweroff complete, but keeps printing message, should not hav e reached here. But no other issues on reboot after shutdown. This gets fixed with [https://github.com/gv1/Odroid.U3/tree/master/linux-4.8.y linux-4.8.y] [https://github.com/gv1/Odroid.U3/tree/master/u-boot-stable u-boot-stable] 87b4a18b9f4d75a6e95e44f33edfd37b1781c9cd SSL 0 144 988 361 2017-05-09T00:44:06Z Erik 1 Info from Xesco wikitext text/x-wiki [[Category:Tutorials]] = openSSL 0.9.8e = '''IMPORTANT: Since this version has a [http://www.mail-archive.com/openssl-users@openssl.org/msg48671.html bug in the blowfish encryption] it is recommended not to use blowfish since it is incompatible with all other openSSL versions!''' <br>Everything you read here was tested on Slackware 12<br> ; wikipedia says about openSSL: : ''OpenSSL is an open source implementation of the SSL and TLS protocols. The core library (written in the C programming language) implements the basic cryptographic functions and provides various utility functions. Wrappers allowing the use of the OpenSSL library in a variety of computer languages are available.'' There are many ways to use openSSL. This just covers certificates for use with httpd. You can also use easy-rsa that comes with the openVPN package and can be found in ''/usr/doc/openvpn-2.0.9/easy-rsa/''. For more information read the included ''README'' or look here: [http://openvpn.net/easyrsa.html A Guide to basic RSA Key Management]. Normally you will make a ''Certificate Signing Request (CSR)'' and send this one to a ''Certifying Authority (CA)'' to be signed. But since we don't wanna pay for this and only want to use it for our own special purpose, we don't need to do that and sign everything ourself. = openSSL + httpd = Switch to ''/etc/ssl'' <pre> cd /etc/ssl </pre> In this directory you should see the following listing. One some non-Slackware linuxes, or if OpenSSL was installed from source, the appropriate directory might be ''/etc/openssl''. <pre> root@pecan:/etc/ssl# ls -l total 24 drwxr-xr-x 2 root root 4096 2007-06-13 12:40 certs/ drwxr-xr-x 2 root root 4096 2007-06-13 12:40 misc/ -rw-r--r-- 1 root root 9374 2007-06-13 12:40 openssl.cnf drwxr-xr-x 2 root root 4096 2007-06-13 12:40 private/ root@pecan:/etc/ssl# </pre> We need to generate a private and public RSA key file. The public key is used to encrypt messages to you and is distributed with your certificate. == Creating a Self-Signed ''Certificate'' (CRT) == === openssl.cnf + openSSL DB === (You should still do this step even if you are buying a commercial certificate.) First things first, so we gotta edit this file, mainly the ''[ CA_default ]'' section. The <pre> [ CA_default ] dir = ./demoCA # Where everything is kept ... certificate = $dir/cacert.pem # The CA certificate ... crl = $dir/crl.pem # The current CRL private_key = $dir/private/cakey.pem# The private key ... </pre> to <pre> [ CA_default ] dir = /etc/ssl # Where everything is kept ... certificate = $dir/certs/ca.crt # The CA certificate ... crl = $dir/crl/ca.crl # The current CRL private_key = $dir/private/ca.key # The private key ... </pre> You can even change more options in this file but be aware what you are doing.<br> openSSL has a database for storing information such as ''Certificate Revocation Lists'' (CRL). Since these files don't exist on startup and we don't use the ''CA.sh'' or ''CA.pl'' scripts we got to create them ourself: <pre> mkdir newcerts certs crl private touch serial index.txt crlnumber crl/ca.crl echo 01 | tee serial | tee crlnumber | Tee crl/ca.crl </pre> Thanks to ''alienBOB''. Hail to tee king! :p === Becoming a ''Certification Authority'' (CA) === (Skip this step if you are buying a certificate from a commercial certificate authority such as GoDaddy.) Before you can create and sign your own certificates, you first have to establish yourself as a "Certificate Authority". To do so, we first create our key file (with a public and a private key) and use it to create our "master certificate" to use when signing other certificates. ; Generate the CA RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/ca.key 4096</pre> ; Create the CA CRT with the CA RSA Key : <pre>openssl req -new -x509 -days 3650 -key private/ca.key -out certs/ca.crt</pre> === Create Server CRT === A CRT contains your RSA public key, your name, the name of the CA, and is digitally signed by the CA. Browsers that know the CA can verify the signature on that CRT, thereby obtaining your RSA public key. That enables them to send messages which only you can decrypt. The next step is to create a Server RSA key, generate a ''Certificate Signing Request'' (CSR) out of it and sign it with our CA CRT to get a working SSL CRT for our server. A CSR is a digital file which contains your public key and your name. Normally you would send the CSR to a CA, who will convert it into a real certificate, by signing it. ; Generate the Server RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/server.key 1024</pre> ; Create the Server CSR using the Server RSA Key : '''When asked for the CommonName (CN) enter your domain!''' : <pre>openssl req -new -key private/server.key -out private/server.csr</pre> ; Sign the CSR with our CA CRT : <pre>openssl ca -in private/server.csr -out certs/server.crt</pre> You can now delete ''server.csr'' if you want, because it is no longer needed. (If you are using a commercially signed certificate from a place such as GoDaddy, do the first two commands above but not the last. Then do ''cat private/server.csr'' to get the text of the certificate request, which you will paste into GoDaddy's web interface to get the certificate. GoDaddy will then email the email address listed in the ''whois'' information for that domain (Make sure you haven't put in a fake address there to avoid spam!), and after the link in that email is clicked, GoDaddy will email another link to you from which you download a zip file. The zip file will contain two .crt files, and you should put both of them in /etc/ssl/certs. Other commerical certificate authorities follow a very similar procedure.) == Setup httpd == === Edit httpd.conf === The whole httpd config is located in ''/etc/httpd''. Fire up your preferred text editor and simply change this at Line 459: <pre> # Secure (SSL/TLS) connections #Include /etc/httpd/extra/httpd-ssl.conf </pre> to this <pre> # Secure (SSL/TLS) connections Include /etc/httpd/extra/httpd-ssl.conf </pre> to enable SSL support. You may also have to uncomment the line that starts ''LoadModule ssl_module''. === Edit extra/httpd-ssl.conf === Now we're going into the guts of the httpd SSL config. Search for ''SSLCertificateFile'' and ''SSLCertificateKeyFile'' change the path to our newly created CRT: <pre> ... SSLCertificateFile /etc/ssl/certs/server.crt ... SSLCertificateKeyFile /etc/ssl/private/server.key ... SSLCertificateChainFile /etc/ssl/certs/server.crt ... SSLCACertificatePath /etc/ssl/certs SSLCACertificateFile /etc/ssl/certs/ca.crt ... SSLCARevocationPath /etc/ssl/crl SSLCARevocationFile /etc/ssl/crl/ca.crl ... </pre> (If you have purchased a certificate from a commercial authority, the SSLCertificateFile will be one of the two files you receive from the CA (GoDaddy or VeriSign or whomever), and the SSLCACertificateFile will be the other. The files will be named such that you can tell which is which -- the SSLCertificateFile will probably be something like ''www.yourdomainname.com.crt'' and the SSLCACertificateFile will be something like ''nameofca-bundle.crt''.) == Pass-phrase on httpd startup == The reason this dialog pops up at startup and every re-start is that the RSA private key inside your ''server.key'' file is stored in encrypted format for security reasons. The pass-phrase is needed decrypt this file, so it can be read and parsed. Removing the pass-phrase removes a layer of security from your server - proceed with caution! <ol> <li> Remove the encryption from the RSA private key (while keeping a backup copy of the original file): <pre> cd /etc/ssl mv private/server.key private/server.key.org cd private openssl rsa -in server.key.org -out server.key </pre> </li> <li> Make sure the server.key file is only readable by root since it is decrypted: <pre> cd /etc/ssl chmod 0400 private/server.key </pre> </li></ol> Now server.key contains an unencrypted copy of the key. If you point your server at this file, it will not prompt you for a pass-phrase. HOWEVER, if anyone gets this key they will be able to impersonate you on the net. PLEASE make sure that the permissions on this file are such that only root or the web server user can read it (preferably get your web server to start as root but run as another user, and have the key readable only by root). As an alternative approach you can use the ''SSLPassPhraseDialog exec:/path/to/program'' facility. Bear in mind that this is neither more nor less secure, of course. == Verifying and debugging == If you simply want to see every information on a CRT: <pre>openssl x509 -noout -text -in XXX.crt</pre> === Verifying === ; Verify that a private key matches its Certificate : Generate a MD5 out of the public key/CRT and compare : <pre>openssl x509 -noout -modulus -in private/XXX.crt | openssl md5 && openssl rsa -noout -modulus -in private/XXX.key | openssl md5</pre> === Debugging === ; s_server - Debugging clients : <pre>openssl s_server -accept 443 -www</pre> ; s_client - Debugging servers : <pre>openssl s_client -connect localhost:443</pre> or <pre>openssl s_client -connect localhost:443 -state -debug</pre> == Security == All the files expect the CRTs are only for your eyes, so we change the permissons: <pre>chmod 0400 private/*.key</pre> === Client Revokation === This is only needed if your server certificate is compromised (eg. someone hacked your server and stole your server.key). <pre> openssl ca -gencrl -keyfile private/ca.key -cert certs/ca.crt -out crl/ca.crl </pre> That generated us the needed files which we use when we want to revoke a CRT. <br><br> Now that we got a compromised CRT, we got to get rid of it: <pre>openssl ca -revoke certs/server.crt -keyfile private/ca.key -cert certs/ca.crt</pre> == Other == === Change the pass-phrase === <pre> openssl rsa -des3 -in server.key -out server.key.new mv server.key.new server.key </pre> The first time you're asked for a PEM pass-phrase, you should enter the old pass-phrase. After that, you'll be asked again to enter a pass-phrase - this time, use the new pass-phrase. If you are asked to verify the pass-phrase, you'll need to enter the new pass-phrase a second time. === CRT for Clients === Ok.. i won't write anything on this, and simply just C/P: <pre> openssl genrsa -des3 -out private/client1_priv.key 2048 openssl genrsa -des3 -out private/client2_priv.key 2048 # and so on... depends on how much clients you wanna serv... openssl req -new -key private/client1_priv.key -out private/client1.csr openssl req -new -key private/client2_priv.key -out private/client2.csr # and so on... openssl ca -in private/client1.csr -out private/client1.crt openssl ca -in private/client2.csr -out private/client2.crt cp private/client1.crt private/client1_preconv.crt cat private/client1.key >> private/client1_preconv.crt openssl pkcs12 -export -in private/client1_preconv.crt -out private/client1_postconv.p12 </pre> Install in the clients browser... and change httpd.conf: <pre> SSLCACertificateFile PATH/TO/server.crt SSLVerifyClient require SSLVerifyDepth 1 </pre> === Convert CRT from PEM to DER format === Normally all CRTs are stored in the PEM format. <pre>openssl x509 -in ca.crt -out ca.crt.der -outform DER</pre> == Testing the CRT == If you have live web sites, you might wish to test your configuration before restarting apache, to avoid having that panicy few minutes of downtime while you scramble to see what you can do faster, fix the problem or copy back your backup configs. Test like this: <pre>httpd -t</pre> Look at the error messages it prints out, or the error_log as explained below, if it doesn't work. Restart your httpd: <pre>/etc/rc.d/rc.httpd restart</pre> Take a look at the httpd ''error_log'' and scroll to the end of the file: <pre>jed /var/log/httpd/error_log</pre> If your getting an error like this: <pre>[error] Init: Unable to read pass phrase [Hint: key introduced or changed before restart?]</pre> ... then you should take a look at ''Pass-phrase on httpd startup'' ... = openSSL + openVPN = $foo ... maybe next month... = External Links = * [http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html SSL/TLS Strong Encryption: FAQ @ httpd.apache.org] * [http://www.tc.umn.edu/~brams006/selfsign.html Creating a self-signed SSL certificate] * [http://www.madboa.com/geek/openssl/ OpenSSL Command-Line HOWTO] * [http://www.5dollarwhitebox.org/wiki/index.php/Howtos_Self_Signed_SSL_Certificates OpenSSL Quick Reference] * [http://www.opensourcehowto.org/how-to/apache/setup-apache2-with-openssl.html Setup Apache2 with OpenSSL] * [http://www.marschke.info/admin/ap_opssl_https.html Apache2, OpenSSL und HTTPS: Server- und Client-Authentifizierung mit Zertifikaten über verschlüsselte Internet-Verbindungen] * [http://www.online-tutorials.net/security/openssl-tutorial/tutorials-t-69-207.html openSSL / openVPN.. comming soon] a6da7cf72f7d2cd2cd22156a533f8eb076c9dc6a 990 988 2017-05-28T13:23:55Z Krakanut 364 wikitext text/x-wiki [[Category:Tutorials]] = openSSL 0.9.8e = '''IMPORTANT: Since this version has a [http://www.mail-archive.com/openssl-users@openssl.org/msg48671.html bug in the blowfish encryption] it is recommended not to use blowfish since it is incompatible with all other openSSL versions!''' <br>Everything you read here was tested on Slackware 12<br> ; wikipedia says about openSSL: : ''OpenSSL is an open source implementation of the SSL and TLS protocols. The core library (written in the C programming language) implements the basic cryptographic functions and provides various utility functions. Wrappers allowing the use of the OpenSSL library in a variety of computer languages are available.'' There are many ways to use openSSL. This just covers certificates for use with httpd. You can also use easy-rsa that comes with the openVPN package and can be found in ''/usr/doc/openvpn-2.0.9/easy-rsa/''. For more information read the included ''README'' or look here: [http://openvpn.net/easyrsa.html A Guide to basic RSA Key Management]. Normally you will make a ''Certificate Signing Request (CSR)'' and send this one to a ''Certifying Authority (CA)'' to be signed. But since we don't wanna pay for this and only want to use it for our own special purpose, we don't need to do that and sign everything ourself. = openSSL + httpd = Switch to ''/etc/ssl'' <pre> cd /etc/ssl </pre> In this directory you should see the following listing. One some non-Slackware linuxes, or if OpenSSL was installed from source, the appropriate directory might be ''/etc/openssl''. <pre> root@pecan:/etc/ssl# ls -l total 24 drwxr-xr-x 2 root root 4096 2007-06-13 12:40 certs/ drwxr-xr-x 2 root root 4096 2007-06-13 12:40 misc/ -rw-r--r-- 1 root root 9374 2007-06-13 12:40 openssl.cnf drwxr-xr-x 2 root root 4096 2007-06-13 12:40 private/ root@pecan:/etc/ssl# </pre> We need to generate a private and public RSA key file. The public key is used to encrypt messages to you and is distributed with your certificate. == Creating a Self-Signed ''Certificate'' (CRT) == === openssl.cnf + openSSL DB === (You should still do this step even if you are buying a commercial certificate.) First things first, so we gotta edit this file, mainly the ''[ CA_default ]'' section. The <pre> [ CA_default ] dir = ./demoCA # Where everything is kept ... certificate = $dir/cacert.pem # The CA certificate ... crl = $dir/crl.pem # The current CRL private_key = $dir/private/cakey.pem# The private key ... </pre> to <pre> [ CA_default ] dir = /etc/ssl # Where everything is kept ... certificate = $dir/certs/ca.crt # The CA certificate ... crl = $dir/crl/ca.crl # The current CRL private_key = $dir/private/ca.key # The private key ... </pre> You can even change more options in this file but be aware what you are doing.<br> openSSL has a database for storing information such as ''Certificate Revocation Lists'' (CRL). Since these files don't exist on startup and we don't use the ''CA.sh'' or ''CA.pl'' scripts we got to create them ourself: <pre> mkdir newcerts certs crl private touch serial index.txt crlnumber crl/ca.crl echo 01 | tee serial | tee crlnumber | Tee crl/ca.crl </pre> Thanks to ''alienBOB''. Hail to tee king! :p You will want to create your CRL file in correct PEM format - you can use the command "openssl ca -config etc/ssl/openssl.cnf \ -gencrl -out /etc/ssl/crl/ca.crl" === Becoming a ''Certification Authority'' (CA) === (Skip this step if you are buying a certificate from a commercial certificate authority such as GoDaddy.) Before you can create and sign your own certificates, you first have to establish yourself as a "Certificate Authority". To do so, we first create our key file (with a public and a private key) and use it to create our "master certificate" to use when signing other certificates. ; Generate the CA RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/ca.key 4096</pre> ; Create the CA CRT with the CA RSA Key : <pre>openssl req -new -x509 -days 3650 -key private/ca.key -out certs/ca.crt</pre> === Create Server CRT === A CRT contains your RSA public key, your name, the name of the CA, and is digitally signed by the CA. Browsers that know the CA can verify the signature on that CRT, thereby obtaining your RSA public key. That enables them to send messages which only you can decrypt. The next step is to create a Server RSA key, generate a ''Certificate Signing Request'' (CSR) out of it and sign it with our CA CRT to get a working SSL CRT for our server. A CSR is a digital file which contains your public key and your name. Normally you would send the CSR to a CA, who will convert it into a real certificate, by signing it. ; Generate the Server RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/server.key 1024</pre> ; Create the Server CSR using the Server RSA Key : '''When asked for the CommonName (CN) enter your domain!''' : <pre>openssl req -new -key private/server.key -out private/server.csr</pre> ; Sign the CSR with our CA CRT : <pre>openssl ca -in private/server.csr -out certs/server.crt</pre> You can now delete ''server.csr'' if you want, because it is no longer needed. (If you are using a commercially signed certificate from a place such as GoDaddy, do the first two commands above but not the last. Then do ''cat private/server.csr'' to get the text of the certificate request, which you will paste into GoDaddy's web interface to get the certificate. GoDaddy will then email the email address listed in the ''whois'' information for that domain (Make sure you haven't put in a fake address there to avoid spam!), and after the link in that email is clicked, GoDaddy will email another link to you from which you download a zip file. The zip file will contain two .crt files, and you should put both of them in /etc/ssl/certs. Other commerical certificate authorities follow a very similar procedure.) == Setup httpd == === Edit httpd.conf === The whole httpd config is located in ''/etc/httpd''. Fire up your preferred text editor and simply change this at Line 459: <pre> # Secure (SSL/TLS) connections #Include /etc/httpd/extra/httpd-ssl.conf </pre> to this <pre> # Secure (SSL/TLS) connections Include /etc/httpd/extra/httpd-ssl.conf </pre> to enable SSL support. You may also have to uncomment the line that starts ''LoadModule ssl_module''. === Edit extra/httpd-ssl.conf === Now we're going into the guts of the httpd SSL config. Search for ''SSLCertificateFile'' and ''SSLCertificateKeyFile'' change the path to our newly created CRT: <pre> ... SSLCertificateFile /etc/ssl/certs/server.crt ... SSLCertificateKeyFile /etc/ssl/private/server.key ... SSLCertificateChainFile /etc/ssl/certs/server.crt ... SSLCACertificatePath /etc/ssl/certs SSLCACertificateFile /etc/ssl/certs/ca.crt ... SSLCARevocationPath /etc/ssl/crl SSLCARevocationFile /etc/ssl/crl/ca.crl ... </pre> (If you have purchased a certificate from a commercial authority, the SSLCertificateFile will be one of the two files you receive from the CA (GoDaddy or VeriSign or whomever), and the SSLCACertificateFile will be the other. The files will be named such that you can tell which is which -- the SSLCertificateFile will probably be something like ''www.yourdomainname.com.crt'' and the SSLCACertificateFile will be something like ''nameofca-bundle.crt''.) == Pass-phrase on httpd startup == The reason this dialog pops up at startup and every re-start is that the RSA private key inside your ''server.key'' file is stored in encrypted format for security reasons. The pass-phrase is needed decrypt this file, so it can be read and parsed. Removing the pass-phrase removes a layer of security from your server - proceed with caution! <ol> <li> Remove the encryption from the RSA private key (while keeping a backup copy of the original file): <pre> cd /etc/ssl mv private/server.key private/server.key.org cd private openssl rsa -in server.key.org -out server.key </pre> </li> <li> Make sure the server.key file is only readable by root since it is decrypted: <pre> cd /etc/ssl chmod 0400 private/server.key </pre> </li></ol> Now server.key contains an unencrypted copy of the key. If you point your server at this file, it will not prompt you for a pass-phrase. HOWEVER, if anyone gets this key they will be able to impersonate you on the net. PLEASE make sure that the permissions on this file are such that only root or the web server user can read it (preferably get your web server to start as root but run as another user, and have the key readable only by root). As an alternative approach you can use the ''SSLPassPhraseDialog exec:/path/to/program'' facility. Bear in mind that this is neither more nor less secure, of course. == Verifying and debugging == If you simply want to see every information on a CRT: <pre>openssl x509 -noout -text -in XXX.crt</pre> === Verifying === ; Verify that a private key matches its Certificate : Generate a MD5 out of the public key/CRT and compare : <pre>openssl x509 -noout -modulus -in private/XXX.crt | openssl md5 && openssl rsa -noout -modulus -in private/XXX.key | openssl md5</pre> === Debugging === ; s_server - Debugging clients : <pre>openssl s_server -accept 443 -www</pre> ; s_client - Debugging servers : <pre>openssl s_client -connect localhost:443</pre> or <pre>openssl s_client -connect localhost:443 -state -debug</pre> == Security == All the files expect the CRTs are only for your eyes, so we change the permissons: <pre>chmod 0400 private/*.key</pre> === Client Revokation === This is only needed if your server certificate is compromised (eg. someone hacked your server and stole your server.key). <pre> openssl ca -gencrl -keyfile private/ca.key -cert certs/ca.crt -out crl/ca.crl </pre> That generated us the needed files which we use when we want to revoke a CRT. <br><br> Now that we got a compromised CRT, we got to get rid of it: <pre>openssl ca -revoke certs/server.crt -keyfile private/ca.key -cert certs/ca.crt</pre> == Other == === Change the pass-phrase === <pre> openssl rsa -des3 -in server.key -out server.key.new mv server.key.new server.key </pre> The first time you're asked for a PEM pass-phrase, you should enter the old pass-phrase. After that, you'll be asked again to enter a pass-phrase - this time, use the new pass-phrase. If you are asked to verify the pass-phrase, you'll need to enter the new pass-phrase a second time. === CRT for Clients === Ok.. i won't write anything on this, and simply just C/P: <pre> openssl genrsa -des3 -out private/client1_priv.key 2048 openssl genrsa -des3 -out private/client2_priv.key 2048 # and so on... depends on how much clients you wanna serv... openssl req -new -key private/client1_priv.key -out private/client1.csr openssl req -new -key private/client2_priv.key -out private/client2.csr # and so on... openssl ca -in private/client1.csr -out private/client1.crt openssl ca -in private/client2.csr -out private/client2.crt cp private/client1.crt private/client1_preconv.crt cat private/client1.key >> private/client1_preconv.crt openssl pkcs12 -export -in private/client1_preconv.crt -out private/client1_postconv.p12 </pre> Install in the clients browser... and change httpd.conf: <pre> SSLCACertificateFile PATH/TO/server.crt SSLVerifyClient require SSLVerifyDepth 1 </pre> === Convert CRT from PEM to DER format === Normally all CRTs are stored in the PEM format. <pre>openssl x509 -in ca.crt -out ca.crt.der -outform DER</pre> == Testing the CRT == If you have live web sites, you might wish to test your configuration before restarting apache, to avoid having that panicy few minutes of downtime while you scramble to see what you can do faster, fix the problem or copy back your backup configs. Test like this: <pre>httpd -t</pre> Look at the error messages it prints out, or the error_log as explained below, if it doesn't work. Restart your httpd: <pre>/etc/rc.d/rc.httpd restart</pre> Take a look at the httpd ''error_log'' and scroll to the end of the file: <pre>jed /var/log/httpd/error_log</pre> If your getting an error like this: <pre>[error] Init: Unable to read pass phrase [Hint: key introduced or changed before restart?]</pre> ... then you should take a look at ''Pass-phrase on httpd startup'' ... = openSSL + openVPN = $foo ... maybe next month... = External Links = * [http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html SSL/TLS Strong Encryption: FAQ @ httpd.apache.org] * [http://www.tc.umn.edu/~brams006/selfsign.html Creating a self-signed SSL certificate] * [http://www.madboa.com/geek/openssl/ OpenSSL Command-Line HOWTO] * [http://www.5dollarwhitebox.org/wiki/index.php/Howtos_Self_Signed_SSL_Certificates OpenSSL Quick Reference] * [http://www.opensourcehowto.org/how-to/apache/setup-apache2-with-openssl.html Setup Apache2 with OpenSSL] * [http://www.marschke.info/admin/ap_opssl_https.html Apache2, OpenSSL und HTTPS: Server- und Client-Authentifizierung mit Zertifikaten über verschlüsselte Internet-Verbindungen] * [http://www.online-tutorials.net/security/openssl-tutorial/tutorials-t-69-207.html openSSL / openVPN.. comming soon] ac109dd72d8bde85795b861281e9414cac57711b 991 990 2017-05-28T13:25:44Z Krakanut 364 wikitext text/x-wiki [[Category:Tutorials]] = openSSL 0.9.8e = '''IMPORTANT: Since this version has a [http://www.mail-archive.com/openssl-users@openssl.org/msg48671.html bug in the blowfish encryption] it is recommended not to use blowfish since it is incompatible with all other openSSL versions!''' <br>Everything you read here was tested on Slackware 12<br> ; wikipedia says about openSSL: : ''OpenSSL is an open source implementation of the SSL and TLS protocols. The core library (written in the C programming language) implements the basic cryptographic functions and provides various utility functions. Wrappers allowing the use of the OpenSSL library in a variety of computer languages are available.'' There are many ways to use openSSL. This just covers certificates for use with httpd. You can also use easy-rsa that comes with the openVPN package and can be found in ''/usr/doc/openvpn-2.0.9/easy-rsa/''. For more information read the included ''README'' or look here: [http://openvpn.net/easyrsa.html A Guide to basic RSA Key Management]. Normally you will make a ''Certificate Signing Request (CSR)'' and send this one to a ''Certifying Authority (CA)'' to be signed. But since we don't wanna pay for this and only want to use it for our own special purpose, we don't need to do that and sign everything ourself. = openSSL + httpd = Switch to ''/etc/ssl'' <pre> cd /etc/ssl </pre> In this directory you should see the following listing. One some non-Slackware linuxes, or if OpenSSL was installed from source, the appropriate directory might be ''/etc/openssl''. <pre> root@pecan:/etc/ssl# ls -l total 24 drwxr-xr-x 2 root root 4096 2007-06-13 12:40 certs/ drwxr-xr-x 2 root root 4096 2007-06-13 12:40 misc/ -rw-r--r-- 1 root root 9374 2007-06-13 12:40 openssl.cnf drwxr-xr-x 2 root root 4096 2007-06-13 12:40 private/ root@pecan:/etc/ssl# </pre> We need to generate a private and public RSA key file. The public key is used to encrypt messages to you and is distributed with your certificate. == Creating a Self-Signed ''Certificate'' (CRT) == === openssl.cnf + openSSL DB === (You should still do this step even if you are buying a commercial certificate.) First things first, so we gotta edit this file, mainly the ''[ CA_default ]'' section. The <pre> [ CA_default ] dir = ./demoCA # Where everything is kept ... certificate = $dir/cacert.pem # The CA certificate ... crl = $dir/crl.pem # The current CRL private_key = $dir/private/cakey.pem# The private key ... </pre> to <pre> [ CA_default ] dir = /etc/ssl # Where everything is kept ... certificate = $dir/certs/ca.crt # The CA certificate ... crl = $dir/crl/ca.crl # The current CRL private_key = $dir/private/ca.key # The private key ... </pre> You can even change more options in this file but be aware what you are doing.<br> openSSL has a database for storing information such as ''Certificate Revocation Lists'' (CRL). Since these files don't exist on startup and we don't use the ''CA.sh'' or ''CA.pl'' scripts we got to create them ourself: <pre> mkdir newcerts certs crl private touch serial index.txt crlnumber crl/ca.crl echo 01 | tee serial | tee crlnumber | Tee crl/ca.crl </pre> Thanks to ''alienBOB''. Hail to tee king! :p You will want to create your CRL file in correct PEM format <pre> openssl ca -config etc/ssl/openssl.cnf -gencrl -out /etc/ssl/crl/ca.crl </pre> === Becoming a ''Certification Authority'' (CA) === (Skip this step if you are buying a certificate from a commercial certificate authority such as GoDaddy.) Before you can create and sign your own certificates, you first have to establish yourself as a "Certificate Authority". To do so, we first create our key file (with a public and a private key) and use it to create our "master certificate" to use when signing other certificates. ; Generate the CA RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/ca.key 4096</pre> ; Create the CA CRT with the CA RSA Key : <pre>openssl req -new -x509 -days 3650 -key private/ca.key -out certs/ca.crt</pre> === Create Server CRT === A CRT contains your RSA public key, your name, the name of the CA, and is digitally signed by the CA. Browsers that know the CA can verify the signature on that CRT, thereby obtaining your RSA public key. That enables them to send messages which only you can decrypt. The next step is to create a Server RSA key, generate a ''Certificate Signing Request'' (CSR) out of it and sign it with our CA CRT to get a working SSL CRT for our server. A CSR is a digital file which contains your public key and your name. Normally you would send the CSR to a CA, who will convert it into a real certificate, by signing it. ; Generate the Server RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/server.key 1024</pre> ; Create the Server CSR using the Server RSA Key : '''When asked for the CommonName (CN) enter your domain!''' : <pre>openssl req -new -key private/server.key -out private/server.csr</pre> ; Sign the CSR with our CA CRT : <pre>openssl ca -in private/server.csr -out certs/server.crt</pre> You can now delete ''server.csr'' if you want, because it is no longer needed. (If you are using a commercially signed certificate from a place such as GoDaddy, do the first two commands above but not the last. Then do ''cat private/server.csr'' to get the text of the certificate request, which you will paste into GoDaddy's web interface to get the certificate. GoDaddy will then email the email address listed in the ''whois'' information for that domain (Make sure you haven't put in a fake address there to avoid spam!), and after the link in that email is clicked, GoDaddy will email another link to you from which you download a zip file. The zip file will contain two .crt files, and you should put both of them in /etc/ssl/certs. Other commerical certificate authorities follow a very similar procedure.) == Setup httpd == === Edit httpd.conf === The whole httpd config is located in ''/etc/httpd''. Fire up your preferred text editor and simply change this at Line 459: <pre> # Secure (SSL/TLS) connections #Include /etc/httpd/extra/httpd-ssl.conf </pre> to this <pre> # Secure (SSL/TLS) connections Include /etc/httpd/extra/httpd-ssl.conf </pre> to enable SSL support. You may also have to uncomment the line that starts ''LoadModule ssl_module''. === Edit extra/httpd-ssl.conf === Now we're going into the guts of the httpd SSL config. Search for ''SSLCertificateFile'' and ''SSLCertificateKeyFile'' change the path to our newly created CRT: <pre> ... SSLCertificateFile /etc/ssl/certs/server.crt ... SSLCertificateKeyFile /etc/ssl/private/server.key ... SSLCertificateChainFile /etc/ssl/certs/server.crt ... SSLCACertificatePath /etc/ssl/certs SSLCACertificateFile /etc/ssl/certs/ca.crt ... SSLCARevocationPath /etc/ssl/crl SSLCARevocationFile /etc/ssl/crl/ca.crl ... </pre> (If you have purchased a certificate from a commercial authority, the SSLCertificateFile will be one of the two files you receive from the CA (GoDaddy or VeriSign or whomever), and the SSLCACertificateFile will be the other. The files will be named such that you can tell which is which -- the SSLCertificateFile will probably be something like ''www.yourdomainname.com.crt'' and the SSLCACertificateFile will be something like ''nameofca-bundle.crt''.) == Pass-phrase on httpd startup == The reason this dialog pops up at startup and every re-start is that the RSA private key inside your ''server.key'' file is stored in encrypted format for security reasons. The pass-phrase is needed decrypt this file, so it can be read and parsed. Removing the pass-phrase removes a layer of security from your server - proceed with caution! <ol> <li> Remove the encryption from the RSA private key (while keeping a backup copy of the original file): <pre> cd /etc/ssl mv private/server.key private/server.key.org cd private openssl rsa -in server.key.org -out server.key </pre> </li> <li> Make sure the server.key file is only readable by root since it is decrypted: <pre> cd /etc/ssl chmod 0400 private/server.key </pre> </li></ol> Now server.key contains an unencrypted copy of the key. If you point your server at this file, it will not prompt you for a pass-phrase. HOWEVER, if anyone gets this key they will be able to impersonate you on the net. PLEASE make sure that the permissions on this file are such that only root or the web server user can read it (preferably get your web server to start as root but run as another user, and have the key readable only by root). As an alternative approach you can use the ''SSLPassPhraseDialog exec:/path/to/program'' facility. Bear in mind that this is neither more nor less secure, of course. == Verifying and debugging == If you simply want to see every information on a CRT: <pre>openssl x509 -noout -text -in XXX.crt</pre> === Verifying === ; Verify that a private key matches its Certificate : Generate a MD5 out of the public key/CRT and compare : <pre>openssl x509 -noout -modulus -in private/XXX.crt | openssl md5 && openssl rsa -noout -modulus -in private/XXX.key | openssl md5</pre> === Debugging === ; s_server - Debugging clients : <pre>openssl s_server -accept 443 -www</pre> ; s_client - Debugging servers : <pre>openssl s_client -connect localhost:443</pre> or <pre>openssl s_client -connect localhost:443 -state -debug</pre> == Security == All the files expect the CRTs are only for your eyes, so we change the permissons: <pre>chmod 0400 private/*.key</pre> === Client Revokation === This is only needed if your server certificate is compromised (eg. someone hacked your server and stole your server.key). <pre> openssl ca -gencrl -keyfile private/ca.key -cert certs/ca.crt -out crl/ca.crl </pre> That generated us the needed files which we use when we want to revoke a CRT. <br><br> Now that we got a compromised CRT, we got to get rid of it: <pre>openssl ca -revoke certs/server.crt -keyfile private/ca.key -cert certs/ca.crt</pre> == Other == === Change the pass-phrase === <pre> openssl rsa -des3 -in server.key -out server.key.new mv server.key.new server.key </pre> The first time you're asked for a PEM pass-phrase, you should enter the old pass-phrase. After that, you'll be asked again to enter a pass-phrase - this time, use the new pass-phrase. If you are asked to verify the pass-phrase, you'll need to enter the new pass-phrase a second time. === CRT for Clients === Ok.. i won't write anything on this, and simply just C/P: <pre> openssl genrsa -des3 -out private/client1_priv.key 2048 openssl genrsa -des3 -out private/client2_priv.key 2048 # and so on... depends on how much clients you wanna serv... openssl req -new -key private/client1_priv.key -out private/client1.csr openssl req -new -key private/client2_priv.key -out private/client2.csr # and so on... openssl ca -in private/client1.csr -out private/client1.crt openssl ca -in private/client2.csr -out private/client2.crt cp private/client1.crt private/client1_preconv.crt cat private/client1.key >> private/client1_preconv.crt openssl pkcs12 -export -in private/client1_preconv.crt -out private/client1_postconv.p12 </pre> Install in the clients browser... and change httpd.conf: <pre> SSLCACertificateFile PATH/TO/server.crt SSLVerifyClient require SSLVerifyDepth 1 </pre> === Convert CRT from PEM to DER format === Normally all CRTs are stored in the PEM format. <pre>openssl x509 -in ca.crt -out ca.crt.der -outform DER</pre> == Testing the CRT == If you have live web sites, you might wish to test your configuration before restarting apache, to avoid having that panicy few minutes of downtime while you scramble to see what you can do faster, fix the problem or copy back your backup configs. Test like this: <pre>httpd -t</pre> Look at the error messages it prints out, or the error_log as explained below, if it doesn't work. Restart your httpd: <pre>/etc/rc.d/rc.httpd restart</pre> Take a look at the httpd ''error_log'' and scroll to the end of the file: <pre>jed /var/log/httpd/error_log</pre> If your getting an error like this: <pre>[error] Init: Unable to read pass phrase [Hint: key introduced or changed before restart?]</pre> ... then you should take a look at ''Pass-phrase on httpd startup'' ... = openSSL + openVPN = $foo ... maybe next month... = External Links = * [http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html SSL/TLS Strong Encryption: FAQ @ httpd.apache.org] * [http://www.tc.umn.edu/~brams006/selfsign.html Creating a self-signed SSL certificate] * [http://www.madboa.com/geek/openssl/ OpenSSL Command-Line HOWTO] * [http://www.5dollarwhitebox.org/wiki/index.php/Howtos_Self_Signed_SSL_Certificates OpenSSL Quick Reference] * [http://www.opensourcehowto.org/how-to/apache/setup-apache2-with-openssl.html Setup Apache2 with OpenSSL] * [http://www.marschke.info/admin/ap_opssl_https.html Apache2, OpenSSL und HTTPS: Server- und Client-Authentifizierung mit Zertifikaten über verschlüsselte Internet-Verbindungen] * [http://www.online-tutorials.net/security/openssl-tutorial/tutorials-t-69-207.html openSSL / openVPN.. comming soon] add227e228cfee2df0ff61a715293a5c27d2ee6b 992 991 2017-05-28T13:26:23Z Krakanut 364 wikitext text/x-wiki [[Category:Tutorials]] = openSSL 0.9.8e = '''IMPORTANT: Since this version has a [http://www.mail-archive.com/openssl-users@openssl.org/msg48671.html bug in the blowfish encryption] it is recommended not to use blowfish since it is incompatible with all other openSSL versions!''' <br>Everything you read here was tested on Slackware 12<br> ; wikipedia says about openSSL: : ''OpenSSL is an open source implementation of the SSL and TLS protocols. The core library (written in the C programming language) implements the basic cryptographic functions and provides various utility functions. Wrappers allowing the use of the OpenSSL library in a variety of computer languages are available.'' There are many ways to use openSSL. This just covers certificates for use with httpd. You can also use easy-rsa that comes with the openVPN package and can be found in ''/usr/doc/openvpn-2.0.9/easy-rsa/''. For more information read the included ''README'' or look here: [http://openvpn.net/easyrsa.html A Guide to basic RSA Key Management]. Normally you will make a ''Certificate Signing Request (CSR)'' and send this one to a ''Certifying Authority (CA)'' to be signed. But since we don't wanna pay for this and only want to use it for our own special purpose, we don't need to do that and sign everything ourself. = openSSL + httpd = Switch to ''/etc/ssl'' <pre> cd /etc/ssl </pre> In this directory you should see the following listing. One some non-Slackware linuxes, or if OpenSSL was installed from source, the appropriate directory might be ''/etc/openssl''. <pre> root@pecan:/etc/ssl# ls -l total 24 drwxr-xr-x 2 root root 4096 2007-06-13 12:40 certs/ drwxr-xr-x 2 root root 4096 2007-06-13 12:40 misc/ -rw-r--r-- 1 root root 9374 2007-06-13 12:40 openssl.cnf drwxr-xr-x 2 root root 4096 2007-06-13 12:40 private/ root@pecan:/etc/ssl# </pre> We need to generate a private and public RSA key file. The public key is used to encrypt messages to you and is distributed with your certificate. == Creating a Self-Signed ''Certificate'' (CRT) == === openssl.cnf + openSSL DB === (You should still do this step even if you are buying a commercial certificate.) First things first, so we gotta edit this file, mainly the ''[ CA_default ]'' section. The <pre> [ CA_default ] dir = ./demoCA # Where everything is kept ... certificate = $dir/cacert.pem # The CA certificate ... crl = $dir/crl.pem # The current CRL private_key = $dir/private/cakey.pem# The private key ... </pre> to <pre> [ CA_default ] dir = /etc/ssl # Where everything is kept ... certificate = $dir/certs/ca.crt # The CA certificate ... crl = $dir/crl/ca.crl # The current CRL private_key = $dir/private/ca.key # The private key ... </pre> You can even change more options in this file but be aware what you are doing.<br> openSSL has a database for storing information such as ''Certificate Revocation Lists'' (CRL). Since these files don't exist on startup and we don't use the ''CA.sh'' or ''CA.pl'' scripts we got to create them ourself: <pre> mkdir newcerts certs crl private touch serial index.txt crlnumber crl/ca.crl echo 01 | tee serial | tee crlnumber | Tee crl/ca.crl </pre> Thanks to ''alienBOB''. Hail to tee king! :p You will need to create your CRL file in correct PEM format <pre> openssl ca -config etc/ssl/openssl.cnf -gencrl -out /etc/ssl/crl/ca.crl </pre> === Becoming a ''Certification Authority'' (CA) === (Skip this step if you are buying a certificate from a commercial certificate authority such as GoDaddy.) Before you can create and sign your own certificates, you first have to establish yourself as a "Certificate Authority". To do so, we first create our key file (with a public and a private key) and use it to create our "master certificate" to use when signing other certificates. ; Generate the CA RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/ca.key 4096</pre> ; Create the CA CRT with the CA RSA Key : <pre>openssl req -new -x509 -days 3650 -key private/ca.key -out certs/ca.crt</pre> === Create Server CRT === A CRT contains your RSA public key, your name, the name of the CA, and is digitally signed by the CA. Browsers that know the CA can verify the signature on that CRT, thereby obtaining your RSA public key. That enables them to send messages which only you can decrypt. The next step is to create a Server RSA key, generate a ''Certificate Signing Request'' (CSR) out of it and sign it with our CA CRT to get a working SSL CRT for our server. A CSR is a digital file which contains your public key and your name. Normally you would send the CSR to a CA, who will convert it into a real certificate, by signing it. ; Generate the Server RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/server.key 1024</pre> ; Create the Server CSR using the Server RSA Key : '''When asked for the CommonName (CN) enter your domain!''' : <pre>openssl req -new -key private/server.key -out private/server.csr</pre> ; Sign the CSR with our CA CRT : <pre>openssl ca -in private/server.csr -out certs/server.crt</pre> You can now delete ''server.csr'' if you want, because it is no longer needed. (If you are using a commercially signed certificate from a place such as GoDaddy, do the first two commands above but not the last. Then do ''cat private/server.csr'' to get the text of the certificate request, which you will paste into GoDaddy's web interface to get the certificate. GoDaddy will then email the email address listed in the ''whois'' information for that domain (Make sure you haven't put in a fake address there to avoid spam!), and after the link in that email is clicked, GoDaddy will email another link to you from which you download a zip file. The zip file will contain two .crt files, and you should put both of them in /etc/ssl/certs. Other commerical certificate authorities follow a very similar procedure.) == Setup httpd == === Edit httpd.conf === The whole httpd config is located in ''/etc/httpd''. Fire up your preferred text editor and simply change this at Line 459: <pre> # Secure (SSL/TLS) connections #Include /etc/httpd/extra/httpd-ssl.conf </pre> to this <pre> # Secure (SSL/TLS) connections Include /etc/httpd/extra/httpd-ssl.conf </pre> to enable SSL support. You may also have to uncomment the line that starts ''LoadModule ssl_module''. === Edit extra/httpd-ssl.conf === Now we're going into the guts of the httpd SSL config. Search for ''SSLCertificateFile'' and ''SSLCertificateKeyFile'' change the path to our newly created CRT: <pre> ... SSLCertificateFile /etc/ssl/certs/server.crt ... SSLCertificateKeyFile /etc/ssl/private/server.key ... SSLCertificateChainFile /etc/ssl/certs/server.crt ... SSLCACertificatePath /etc/ssl/certs SSLCACertificateFile /etc/ssl/certs/ca.crt ... SSLCARevocationPath /etc/ssl/crl SSLCARevocationFile /etc/ssl/crl/ca.crl ... </pre> (If you have purchased a certificate from a commercial authority, the SSLCertificateFile will be one of the two files you receive from the CA (GoDaddy or VeriSign or whomever), and the SSLCACertificateFile will be the other. The files will be named such that you can tell which is which -- the SSLCertificateFile will probably be something like ''www.yourdomainname.com.crt'' and the SSLCACertificateFile will be something like ''nameofca-bundle.crt''.) == Pass-phrase on httpd startup == The reason this dialog pops up at startup and every re-start is that the RSA private key inside your ''server.key'' file is stored in encrypted format for security reasons. The pass-phrase is needed decrypt this file, so it can be read and parsed. Removing the pass-phrase removes a layer of security from your server - proceed with caution! <ol> <li> Remove the encryption from the RSA private key (while keeping a backup copy of the original file): <pre> cd /etc/ssl mv private/server.key private/server.key.org cd private openssl rsa -in server.key.org -out server.key </pre> </li> <li> Make sure the server.key file is only readable by root since it is decrypted: <pre> cd /etc/ssl chmod 0400 private/server.key </pre> </li></ol> Now server.key contains an unencrypted copy of the key. If you point your server at this file, it will not prompt you for a pass-phrase. HOWEVER, if anyone gets this key they will be able to impersonate you on the net. PLEASE make sure that the permissions on this file are such that only root or the web server user can read it (preferably get your web server to start as root but run as another user, and have the key readable only by root). As an alternative approach you can use the ''SSLPassPhraseDialog exec:/path/to/program'' facility. Bear in mind that this is neither more nor less secure, of course. == Verifying and debugging == If you simply want to see every information on a CRT: <pre>openssl x509 -noout -text -in XXX.crt</pre> === Verifying === ; Verify that a private key matches its Certificate : Generate a MD5 out of the public key/CRT and compare : <pre>openssl x509 -noout -modulus -in private/XXX.crt | openssl md5 && openssl rsa -noout -modulus -in private/XXX.key | openssl md5</pre> === Debugging === ; s_server - Debugging clients : <pre>openssl s_server -accept 443 -www</pre> ; s_client - Debugging servers : <pre>openssl s_client -connect localhost:443</pre> or <pre>openssl s_client -connect localhost:443 -state -debug</pre> == Security == All the files expect the CRTs are only for your eyes, so we change the permissons: <pre>chmod 0400 private/*.key</pre> === Client Revokation === This is only needed if your server certificate is compromised (eg. someone hacked your server and stole your server.key). <pre> openssl ca -gencrl -keyfile private/ca.key -cert certs/ca.crt -out crl/ca.crl </pre> That generated us the needed files which we use when we want to revoke a CRT. <br><br> Now that we got a compromised CRT, we got to get rid of it: <pre>openssl ca -revoke certs/server.crt -keyfile private/ca.key -cert certs/ca.crt</pre> == Other == === Change the pass-phrase === <pre> openssl rsa -des3 -in server.key -out server.key.new mv server.key.new server.key </pre> The first time you're asked for a PEM pass-phrase, you should enter the old pass-phrase. After that, you'll be asked again to enter a pass-phrase - this time, use the new pass-phrase. If you are asked to verify the pass-phrase, you'll need to enter the new pass-phrase a second time. === CRT for Clients === Ok.. i won't write anything on this, and simply just C/P: <pre> openssl genrsa -des3 -out private/client1_priv.key 2048 openssl genrsa -des3 -out private/client2_priv.key 2048 # and so on... depends on how much clients you wanna serv... openssl req -new -key private/client1_priv.key -out private/client1.csr openssl req -new -key private/client2_priv.key -out private/client2.csr # and so on... openssl ca -in private/client1.csr -out private/client1.crt openssl ca -in private/client2.csr -out private/client2.crt cp private/client1.crt private/client1_preconv.crt cat private/client1.key >> private/client1_preconv.crt openssl pkcs12 -export -in private/client1_preconv.crt -out private/client1_postconv.p12 </pre> Install in the clients browser... and change httpd.conf: <pre> SSLCACertificateFile PATH/TO/server.crt SSLVerifyClient require SSLVerifyDepth 1 </pre> === Convert CRT from PEM to DER format === Normally all CRTs are stored in the PEM format. <pre>openssl x509 -in ca.crt -out ca.crt.der -outform DER</pre> == Testing the CRT == If you have live web sites, you might wish to test your configuration before restarting apache, to avoid having that panicy few minutes of downtime while you scramble to see what you can do faster, fix the problem or copy back your backup configs. Test like this: <pre>httpd -t</pre> Look at the error messages it prints out, or the error_log as explained below, if it doesn't work. Restart your httpd: <pre>/etc/rc.d/rc.httpd restart</pre> Take a look at the httpd ''error_log'' and scroll to the end of the file: <pre>jed /var/log/httpd/error_log</pre> If your getting an error like this: <pre>[error] Init: Unable to read pass phrase [Hint: key introduced or changed before restart?]</pre> ... then you should take a look at ''Pass-phrase on httpd startup'' ... = openSSL + openVPN = $foo ... maybe next month... = External Links = * [http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html SSL/TLS Strong Encryption: FAQ @ httpd.apache.org] * [http://www.tc.umn.edu/~brams006/selfsign.html Creating a self-signed SSL certificate] * [http://www.madboa.com/geek/openssl/ OpenSSL Command-Line HOWTO] * [http://www.5dollarwhitebox.org/wiki/index.php/Howtos_Self_Signed_SSL_Certificates OpenSSL Quick Reference] * [http://www.opensourcehowto.org/how-to/apache/setup-apache2-with-openssl.html Setup Apache2 with OpenSSL] * [http://www.marschke.info/admin/ap_opssl_https.html Apache2, OpenSSL und HTTPS: Server- und Client-Authentifizierung mit Zertifikaten über verschlüsselte Internet-Verbindungen] * [http://www.online-tutorials.net/security/openssl-tutorial/tutorials-t-69-207.html openSSL / openVPN.. comming soon] d3ecc852402c2ee30ab67a5811517f0093a94acc 993 992 2017-05-28T13:29:00Z Krakanut 364 wikitext text/x-wiki [[Category:Tutorials]] = openSSL 0.9.8e = '''IMPORTANT: Since this version has a [http://www.mail-archive.com/openssl-users@openssl.org/msg48671.html bug in the blowfish encryption] it is recommended not to use blowfish since it is incompatible with all other openSSL versions!''' <br>Everything you read here was tested on Slackware 12<br> ; wikipedia says about openSSL: : ''OpenSSL is an open source implementation of the SSL and TLS protocols. The core library (written in the C programming language) implements the basic cryptographic functions and provides various utility functions. Wrappers allowing the use of the OpenSSL library in a variety of computer languages are available.'' There are many ways to use openSSL. This just covers certificates for use with httpd. You can also use easy-rsa that comes with the openVPN package and can be found in ''/usr/doc/openvpn-2.0.9/easy-rsa/''. For more information read the included ''README'' or look here: [http://openvpn.net/easyrsa.html A Guide to basic RSA Key Management]. Normally you will make a ''Certificate Signing Request (CSR)'' and send this one to a ''Certifying Authority (CA)'' to be signed. But since we don't wanna pay for this and only want to use it for our own special purpose, we don't need to do that and sign everything ourself. = openSSL + httpd = Switch to ''/etc/ssl'' <pre> cd /etc/ssl </pre> In this directory you should see the following listing. One some non-Slackware linuxes, or if OpenSSL was installed from source, the appropriate directory might be ''/etc/openssl''. <pre> root@pecan:/etc/ssl# ls -l total 24 drwxr-xr-x 2 root root 4096 2007-06-13 12:40 certs/ drwxr-xr-x 2 root root 4096 2007-06-13 12:40 misc/ -rw-r--r-- 1 root root 9374 2007-06-13 12:40 openssl.cnf drwxr-xr-x 2 root root 4096 2007-06-13 12:40 private/ root@pecan:/etc/ssl# </pre> We need to generate a private and public RSA key file. The public key is used to encrypt messages to you and is distributed with your certificate. == Creating a Self-Signed ''Certificate'' (CRT) == === openssl.cnf + openSSL DB === (You should still do this step even if you are buying a commercial certificate.) First things first, so we gotta edit this file, mainly the ''[ CA_default ]'' section. The <pre> [ CA_default ] dir = ./demoCA # Where everything is kept ... certificate = $dir/cacert.pem # The CA certificate ... crl = $dir/crl.pem # The current CRL private_key = $dir/private/cakey.pem# The private key ... </pre> to <pre> [ CA_default ] dir = /etc/ssl # Where everything is kept ... certificate = $dir/certs/ca.crt # The CA certificate ... crl = $dir/crl/ca.crl # The current CRL private_key = $dir/private/ca.key # The private key ... </pre> You can even change more options in this file but be aware what you are doing.<br> openSSL has a database for storing information such as ''Certificate Revocation Lists'' (CRL). Since these files don't exist on startup and we don't use the ''CA.sh'' or ''CA.pl'' scripts we got to create them ourself: <pre> mkdir newcerts certs crl private touch serial index.txt crlnumber crl/ca.crl echo 01 | tee serial | tee crlnumber | Tee crl/ca.crl </pre> Thanks to ''alienBOB''. Hail to tee king! :p You will need to create your CRL file in correct PEM format <pre> openssl ca -config /etc/ssl/openssl.cnf -gencrl -out /etc/ssl/crl/ca.crl </pre> You can test that the crl file is correct with the command: <pre> openssl crl -text -in /etc/ssl/crl/ca.crl -noout </pre> === Becoming a ''Certification Authority'' (CA) === (Skip this step if you are buying a certificate from a commercial certificate authority such as GoDaddy.) Before you can create and sign your own certificates, you first have to establish yourself as a "Certificate Authority". To do so, we first create our key file (with a public and a private key) and use it to create our "master certificate" to use when signing other certificates. ; Generate the CA RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/ca.key 4096</pre> ; Create the CA CRT with the CA RSA Key : <pre>openssl req -new -x509 -days 3650 -key private/ca.key -out certs/ca.crt</pre> === Create Server CRT === A CRT contains your RSA public key, your name, the name of the CA, and is digitally signed by the CA. Browsers that know the CA can verify the signature on that CRT, thereby obtaining your RSA public key. That enables them to send messages which only you can decrypt. The next step is to create a Server RSA key, generate a ''Certificate Signing Request'' (CSR) out of it and sign it with our CA CRT to get a working SSL CRT for our server. A CSR is a digital file which contains your public key and your name. Normally you would send the CSR to a CA, who will convert it into a real certificate, by signing it. ; Generate the Server RSA Key (Triple-DES encrypted and PEM formatted) : <pre>openssl genrsa -des3 -out private/server.key 1024</pre> ; Create the Server CSR using the Server RSA Key : '''When asked for the CommonName (CN) enter your domain!''' : <pre>openssl req -new -key private/server.key -out private/server.csr</pre> ; Sign the CSR with our CA CRT : <pre>openssl ca -in private/server.csr -out certs/server.crt</pre> You can now delete ''server.csr'' if you want, because it is no longer needed. (If you are using a commercially signed certificate from a place such as GoDaddy, do the first two commands above but not the last. Then do ''cat private/server.csr'' to get the text of the certificate request, which you will paste into GoDaddy's web interface to get the certificate. GoDaddy will then email the email address listed in the ''whois'' information for that domain (Make sure you haven't put in a fake address there to avoid spam!), and after the link in that email is clicked, GoDaddy will email another link to you from which you download a zip file. The zip file will contain two .crt files, and you should put both of them in /etc/ssl/certs. Other commerical certificate authorities follow a very similar procedure.) == Setup httpd == === Edit httpd.conf === The whole httpd config is located in ''/etc/httpd''. Fire up your preferred text editor and simply change this at Line 459: <pre> # Secure (SSL/TLS) connections #Include /etc/httpd/extra/httpd-ssl.conf </pre> to this <pre> # Secure (SSL/TLS) connections Include /etc/httpd/extra/httpd-ssl.conf </pre> to enable SSL support. You may also have to uncomment the line that starts ''LoadModule ssl_module''. === Edit extra/httpd-ssl.conf === Now we're going into the guts of the httpd SSL config. Search for ''SSLCertificateFile'' and ''SSLCertificateKeyFile'' change the path to our newly created CRT: <pre> ... SSLCertificateFile /etc/ssl/certs/server.crt ... SSLCertificateKeyFile /etc/ssl/private/server.key ... SSLCertificateChainFile /etc/ssl/certs/server.crt ... SSLCACertificatePath /etc/ssl/certs SSLCACertificateFile /etc/ssl/certs/ca.crt ... SSLCARevocationPath /etc/ssl/crl SSLCARevocationFile /etc/ssl/crl/ca.crl ... </pre> (If you have purchased a certificate from a commercial authority, the SSLCertificateFile will be one of the two files you receive from the CA (GoDaddy or VeriSign or whomever), and the SSLCACertificateFile will be the other. The files will be named such that you can tell which is which -- the SSLCertificateFile will probably be something like ''www.yourdomainname.com.crt'' and the SSLCACertificateFile will be something like ''nameofca-bundle.crt''.) == Pass-phrase on httpd startup == The reason this dialog pops up at startup and every re-start is that the RSA private key inside your ''server.key'' file is stored in encrypted format for security reasons. The pass-phrase is needed decrypt this file, so it can be read and parsed. Removing the pass-phrase removes a layer of security from your server - proceed with caution! <ol> <li> Remove the encryption from the RSA private key (while keeping a backup copy of the original file): <pre> cd /etc/ssl mv private/server.key private/server.key.org cd private openssl rsa -in server.key.org -out server.key </pre> </li> <li> Make sure the server.key file is only readable by root since it is decrypted: <pre> cd /etc/ssl chmod 0400 private/server.key </pre> </li></ol> Now server.key contains an unencrypted copy of the key. If you point your server at this file, it will not prompt you for a pass-phrase. HOWEVER, if anyone gets this key they will be able to impersonate you on the net. PLEASE make sure that the permissions on this file are such that only root or the web server user can read it (preferably get your web server to start as root but run as another user, and have the key readable only by root). As an alternative approach you can use the ''SSLPassPhraseDialog exec:/path/to/program'' facility. Bear in mind that this is neither more nor less secure, of course. == Verifying and debugging == If you simply want to see every information on a CRT: <pre>openssl x509 -noout -text -in XXX.crt</pre> === Verifying === ; Verify that a private key matches its Certificate : Generate a MD5 out of the public key/CRT and compare : <pre>openssl x509 -noout -modulus -in private/XXX.crt | openssl md5 && openssl rsa -noout -modulus -in private/XXX.key | openssl md5</pre> === Debugging === ; s_server - Debugging clients : <pre>openssl s_server -accept 443 -www</pre> ; s_client - Debugging servers : <pre>openssl s_client -connect localhost:443</pre> or <pre>openssl s_client -connect localhost:443 -state -debug</pre> == Security == All the files expect the CRTs are only for your eyes, so we change the permissons: <pre>chmod 0400 private/*.key</pre> === Client Revokation === This is only needed if your server certificate is compromised (eg. someone hacked your server and stole your server.key). <pre> openssl ca -gencrl -keyfile private/ca.key -cert certs/ca.crt -out crl/ca.crl </pre> That generated us the needed files which we use when we want to revoke a CRT. <br><br> Now that we got a compromised CRT, we got to get rid of it: <pre>openssl ca -revoke certs/server.crt -keyfile private/ca.key -cert certs/ca.crt</pre> == Other == === Change the pass-phrase === <pre> openssl rsa -des3 -in server.key -out server.key.new mv server.key.new server.key </pre> The first time you're asked for a PEM pass-phrase, you should enter the old pass-phrase. After that, you'll be asked again to enter a pass-phrase - this time, use the new pass-phrase. If you are asked to verify the pass-phrase, you'll need to enter the new pass-phrase a second time. === CRT for Clients === Ok.. i won't write anything on this, and simply just C/P: <pre> openssl genrsa -des3 -out private/client1_priv.key 2048 openssl genrsa -des3 -out private/client2_priv.key 2048 # and so on... depends on how much clients you wanna serv... openssl req -new -key private/client1_priv.key -out private/client1.csr openssl req -new -key private/client2_priv.key -out private/client2.csr # and so on... openssl ca -in private/client1.csr -out private/client1.crt openssl ca -in private/client2.csr -out private/client2.crt cp private/client1.crt private/client1_preconv.crt cat private/client1.key >> private/client1_preconv.crt openssl pkcs12 -export -in private/client1_preconv.crt -out private/client1_postconv.p12 </pre> Install in the clients browser... and change httpd.conf: <pre> SSLCACertificateFile PATH/TO/server.crt SSLVerifyClient require SSLVerifyDepth 1 </pre> === Convert CRT from PEM to DER format === Normally all CRTs are stored in the PEM format. <pre>openssl x509 -in ca.crt -out ca.crt.der -outform DER</pre> == Testing the CRT == If you have live web sites, you might wish to test your configuration before restarting apache, to avoid having that panicy few minutes of downtime while you scramble to see what you can do faster, fix the problem or copy back your backup configs. Test like this: <pre>httpd -t</pre> Look at the error messages it prints out, or the error_log as explained below, if it doesn't work. Restart your httpd: <pre>/etc/rc.d/rc.httpd restart</pre> Take a look at the httpd ''error_log'' and scroll to the end of the file: <pre>jed /var/log/httpd/error_log</pre> If your getting an error like this: <pre>[error] Init: Unable to read pass phrase [Hint: key introduced or changed before restart?]</pre> ... then you should take a look at ''Pass-phrase on httpd startup'' ... = openSSL + openVPN = $foo ... maybe next month... = External Links = * [http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html SSL/TLS Strong Encryption: FAQ @ httpd.apache.org] * [http://www.tc.umn.edu/~brams006/selfsign.html Creating a self-signed SSL certificate] * [http://www.madboa.com/geek/openssl/ OpenSSL Command-Line HOWTO] * [http://www.5dollarwhitebox.org/wiki/index.php/Howtos_Self_Signed_SSL_Certificates OpenSSL Quick Reference] * [http://www.opensourcehowto.org/how-to/apache/setup-apache2-with-openssl.html Setup Apache2 with OpenSSL] * [http://www.marschke.info/admin/ap_opssl_https.html Apache2, OpenSSL und HTTPS: Server- und Client-Authentifizierung mit Zertifikaten über verschlüsselte Internet-Verbindungen] * [http://www.online-tutorials.net/security/openssl-tutorial/tutorials-t-69-207.html openSSL / openVPN.. comming soon] a31bed3f0f2a5d9f8d10138391e2da382843c7f2 User:Gordus 2 323 994 2017-07-05T15:45:27Z Gordus 365 Created page with "'''test'''" wikitext text/x-wiki '''test''' fcdcb5261868837c11a2a7216b64fe80a646046a 995 994 2017-07-05T15:45:48Z Gordus 365 Blanked the page wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Color Management 0 324 996 2017-07-14T17:15:27Z Aeifn 367 Created page with "== Color management and calibration software available == * colord * colord-gtk * xcalib * iccprofiles * oyranos * gnome-color-manager * DisplayCAL Packages i can`t build on..." wikitext text/x-wiki == Color management and calibration software available == * colord * colord-gtk * xcalib * iccprofiles * oyranos * gnome-color-manager * DisplayCAL Packages i can`t build on Slackware * lprof * monica [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. 984abc0919b1e7b08f5be0b5b99ec07810c3ff3c 999 996 2017-07-16T08:45:45Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software available == * colord * colord-gtk * xcalib * iccprofiles * oyranos * gnome-color-manager * DisplayCAL * monica == lprof == [http://lprof.sourceforge.net/ Homepage] Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. 9b061e63c071422984e3b21d791c5072b72634f8 1000 999 2017-07-16T08:50:23Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software available == * colord-gtk * xcalib * iccprofiles * oyranos * gnome-color-manager * DisplayCAL * monica == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] == lprof == [http://lprof.sourceforge.net/ Homepage] Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. 34c36158c4e253a49b6dc19d1aa726474682decb 1001 1000 2017-07-16T09:02:23Z Aeifn 367 /* Color management and calibration software available */ wikitext text/x-wiki == Color management and calibration software == * colord-gtk * xcalib * iccprofiles * oyranos * gnome-color-manager * DisplayCAL * monica == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] == lprof == [http://lprof.sourceforge.net/ Homepage] Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. 400467eb7a6da7462da3b601238ace430acdfe6f 1002 1001 2017-07-16T11:52:42Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software == * colord-gtk * xcalib * iccprofiles * oyranos * gnome-color-manager * DisplayCAL * monica == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. 7e11c43f54f411477ff5f4ccc79b39dd85e22ade 1003 1002 2017-07-16T12:14:54Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software == * colord-gtk * xcalib * iccprofiles * oyranos * gnome-color-manager * DisplayCAL * monica == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. 57d56466041ac4ea38caf7a996013959464ca5c8 1004 1003 2017-07-16T12:15:27Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software == * colord-gtk * xcalib * iccprofiles * oyranos * gnome-color-manager * DisplayCAL * monica * cups-calibrate == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. b7bb5341ff028a0db0601b9573b658ee3330e534 1005 1004 2017-07-16T12:16:52Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software == * colord-gtk * * oyranos * gnome-color-manager * DisplayCAL * monica * cups-calibrate == Iccprofiles == Package with icc profiles kit. == Xcalib == xcalib is a tool for loading icc profile for monitor. == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. b29ae6945a415564c78a3e061dcf200624ba425d 1007 1005 2017-07-16T12:18:59Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software == * colord-gtk * * oyranos * gnome-color-manager * DisplayCAL * monica * cups-calibrate == Iccprofiles == Package with common icc profiles collection from Adobe and ECI. == Xcalib == xcalib is a tool for loading icc profile for monitor. == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. d288baa9116cbd630caca0352ff9e3ccb2d065b3 1008 1007 2017-07-16T12:25:09Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software == * oyranos * DisplayCAL * monica * cups-calibrate == gnome-color-manager == == xiccd == Desktop color management daemon == Iccprofiles == Package with common icc profiles collection from Adobe and ECI. == Xcalib == xcalib is a tool for loading icc profile for monitor. == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] colord-gtk - gtk library for colord == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. 7379e04d5a8b60a0caed20b64da66755b22ae1c4 1009 1008 2017-07-17T07:12:03Z Aeifn 367 /* xiccd */ wikitext text/x-wiki == Color management and calibration software == * oyranos * DisplayCAL * monica * cups-calibrate == gnome-color-manager == == xiccd == Desktop color management daemon Depends on: colord == Iccprofiles == Package with common icc profiles collection from Adobe and ECI. == Xcalib == xcalib is a tool for loading icc profile for monitor. == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] colord-gtk - gtk library for colord == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. 4c86af07a6b0d1b4097f68a68d7204117a713dd1 1010 1009 2017-07-17T07:12:20Z Aeifn 367 /* xiccd */ wikitext text/x-wiki == Color management and calibration software == * oyranos * DisplayCAL * monica * cups-calibrate == gnome-color-manager == == xiccd == Desktop color management daemon Depends on: colord == Iccprofiles == Package with common icc profiles collection from Adobe and ECI. == Xcalib == xcalib is a tool for loading icc profile for monitor. == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] colord-gtk - gtk library for colord == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. 819548273cd8a514f2f3673f660845a9890a9512 1011 1010 2017-07-17T07:13:27Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software == * oyranos * DisplayCAL * monica * cups-calibrate == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] colord-gtk - gtk library for colord == gnome-color-manager == == xiccd == Desktop color management daemon Depends on: colord == Iccprofiles == Package with common icc profiles collection from Adobe and ECI. == Xcalib == xcalib is a tool for loading icc profile for monitor. == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. 20f468e689e26a74c28c8cee50c137d3431af9c9 1012 1011 2017-07-17T07:53:48Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software == * oyranos * DisplayCAL * monica * cups-calibrate == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] colord-gtk - gtk library for colord == xiccd == Desktop color management daemon Depends on: colord == gnome-color-manager == == Iccprofiles == Package with common icc profiles collection from Adobe and ECI. == Xcalib == xcalib is a tool for loading icc profile for monitor. == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. da8c5a595559d7f311f015a83f8d762c1043850c Epson printing 0 325 997 2017-07-14T17:22:48Z Aeifn 367 Created page with "== Installing Epson-printer-utility == 1. Go [http://download.ebz.epson.net/dsc/du/02/DriverDownloadInfo.do?LG2=EN&CN2=&DSCMI=58594&DSCCHK=ebfccde01491428edd9eacd52d9d4822cd..." wikitext text/x-wiki == Installing Epson-printer-utility == 1. Go [http://download.ebz.epson.net/dsc/du/02/DriverDownloadInfo.do?LG2=EN&CN2=&DSCMI=58594&DSCCHK=ebfccde01491428edd9eacd52d9d4822cd6efb50 here], accept the license. If you're on Slackware 32-bit, download epson-printer-utility-1.0.2-1lsb3.2.i486.rpm , otherwise (ie. Slackware 64-bit), download epson-printer-utility-1.0.2-1lsb3.2.x86_64.rpm. 2. Convert the rpm package you downloaded into a tgz Slackware package : Code: # if you are on Slackware 32-bit $ rpm2tgz epson-printer-utility-1.0.2-1lsb3.2.i486.rpm # if you are on Slackware 64-bit $ rpm2tgz epson-printer-utility-1.0.2-1lsb3.2.x86_64.rpm 3. Install the generated slackware package : Code: # if you are on Slackware 32-bit $ installpkg epson-printer-utility-1.0.2-1lsb3.2.i486.tgz # if you are on Slackware 64-bit $ installpkg epson-printer-utility-1.0.2-1lsb3.2.x86_64.tgz 4. Create the symlink below which is required by LSB : Code: # if you are on Slackware 32-bit $ ln -sf /lib/ld-linux.so.2 /lib/ld-lsb.so.3 # if you are on Slackware 64-bit # ln -sf /lib64/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3 For epson-printer-utility to work, you first need to start /usr/lib/epson-backend/ecbd as root : Code: $ su - $ /usr/lib/epson-backend/rc.d/ecbd start Now, epson-printer-utility can be started : Code: $ /opt/epson-printer-utility/bin/epson-printer-utility 640b96cef2dab03761634e59a268f358a53db636 998 997 2017-07-14T17:24:49Z Aeifn 367 epson-printer-utility installing wikitext text/x-wiki == Installing Epson-printer-utility == 1. Go [http://download.ebz.epson.net/dsc/du/02/DriverDownloadInfo.do?LG2=EN&CN2=&DSCMI=58594&DSCCHK=ebfccde01491428edd9eacd52d9d4822cd6efb50 here], accept the license. If you're on Slackware 32-bit, download epson-printer-utility-1.0.2-1lsb3.2.i486.rpm , otherwise (ie. Slackware 64-bit), download epson-printer-utility-1.0.2-1lsb3.2.x86_64.rpm. 2. Convert the rpm package you downloaded into a tgz Slackware package : Code: # if you are on Slackware 32-bit $ rpm2tgz epson-printer-utility-1.0.2-1lsb3.2.i486.rpm # if you are on Slackware 64-bit $ rpm2tgz epson-printer-utility-1.0.2-1lsb3.2.x86_64.rpm 3. Install the generated slackware package : Code: # if you are on Slackware 32-bit $ installpkg epson-printer-utility-1.0.2-1lsb3.2.i486.tgz # if you are on Slackware 64-bit $ installpkg epson-printer-utility-1.0.2-1lsb3.2.x86_64.tgz 4. Create the symlink below which is required by LSB : Code: # if you are on Slackware 32-bit $ ln -sf /lib/ld-linux.so.2 /lib/ld-lsb.so.3 # if you are on Slackware 64-bit # ln -sf /lib64/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3 For epson-printer-utility to work, you first need to start /usr/lib/epson-backend/ecbd as root : Code: $ su - $ /usr/lib/epson-backend/rc.d/ecbd start Now, epson-printer-utility can be started : Code: $ /opt/epson-printer-utility/bin/epson-printer-utility Originally from [http://www.linuxquestions.org/questions/slackware-14/lsbc-4175609558/ here] a7b08d2c06eb1efe9a6789ede9df7487d55ac13f Color Management 0 324 1013 1012 2017-07-17T08:01:24Z Aeifn 367 /* xiccd */ wikitext text/x-wiki == Color management and calibration software == * oyranos * DisplayCAL * monica * cups-calibrate == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] colord-gtk - gtk library for colord == xiccd == Desktop color management daemon Depends on: colord [https://forums.freebsd.org/threads/51153/ Guide for FreeBSD] == gnome-color-manager == == Iccprofiles == Package with common icc profiles collection from Adobe and ECI. == Xcalib == xcalib is a tool for loading icc profile for monitor. == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] Page in progress. 81c1f1bcc67f6ec71c26da1a29f74f745d83766b 1014 1013 2017-07-17T08:05:36Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software == * oyranos * DisplayCAL * monica * cups-calibrate == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] colord-gtk - gtk library for colord == xiccd == Desktop color management daemon Depends on: colord [https://forums.freebsd.org/threads/51153/ Guide for FreeBSD] == gnome-color-manager == == Iccprofiles == Package with common icc profiles collection from Adobe and ECI. == Xcalib == xcalib is a tool for loading icc profile for monitor. == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. == See also == [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] [http://www.hughski.com/ Open source display colorimeter] Page in progress. 4586ddfd27445d73835167947ef2ceebcf16ca08 1015 1014 2017-07-17T08:05:50Z Aeifn 367 /* See also */ wikitext text/x-wiki == Color management and calibration software == * oyranos * DisplayCAL * monica * cups-calibrate == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] colord-gtk - gtk library for colord == xiccd == Desktop color management daemon Depends on: colord [https://forums.freebsd.org/threads/51153/ Guide for FreeBSD] == gnome-color-manager == == Iccprofiles == Package with common icc profiles collection from Adobe and ECI. == Xcalib == xcalib is a tool for loading icc profile for monitor. == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. == See also == [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] [http://www.hughski.com/ Open source display colorimeter] Page in progress. 428e76e6d3e0dfa685a329467fa3efe20db1a54f 1018 1015 2017-07-17T13:19:32Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software == * oyranos * DisplayCAL * monica * cups-calibrate == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] Provides '''colormgr''' console utility for color management. colord-gtk - gtk library for colord == xiccd == Desktop color management daemon. It needed to import profiles into colord and apply them to monitor. If you use KDE or Gnome, you do not need xiccd. Depends on: colord [https://forums.freebsd.org/threads/51153/ Guide for FreeBSD] == gnome-color-manager == Useful GUI for colormgr utility. == Iccprofiles == Package with common icc profiles collection from Adobe and ECI. == Xcalib == xcalib is a tool for direct loading icc profile for monitor. == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. == See also == [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] [http://www.hughski.com/ Open source display colorimeter] Page in progress. 6f52559f1fbcbdd0141c5f05ffab5f74e6210bbd 1019 1018 2017-07-17T13:27:42Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software == * oyranos * DisplayCAL * monica * cups-calibrate == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] Provides '''colormgr''' console utility for color management. == xiccd == Desktop color management daemon. It needed to import profiles into colord and apply them to monitor. If you use KDE or Gnome, you do not need xiccd. Depends on: colord [https://forums.freebsd.org/threads/51153/ Guide for FreeBSD] == gnome-color-manager == Requires colord-gtk - gtk library for colord Useful GUI for colormgr utility. == Iccprofiles == Package with common icc profiles collection from Adobe and ECI. == Xcalib == xcalib is a tool for direct loading icc profile for monitor. == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. == See also == [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] [http://www.hughski.com/ Open source display colorimeter] Page in progress. 5808f353a68a6d2a3f68cee8bd8269b44ab63b05 1020 1019 2017-07-17T13:39:38Z Aeifn 367 wikitext text/x-wiki == Color management and calibration software == * oyranos * DisplayCAL * monica * cups-calibrate == Colord == [https://www.freedesktop.org/software/colord/ Homepage] [https://slackbuilds.org/repository/14.2/system/colord/ SBo] Provides '''colormgr''' console utility for color management. == xiccd == Desktop color management daemon. It needed to import profiles into colord and apply them to monitor. If you use KDE or Gnome, you do not need xiccd. Gnome uses gnome-settings-daemon instead. Depends on: colord [https://forums.freebsd.org/threads/51153/ Guide for FreeBSD] == gnome-color-manager == Requires colord-gtk - gtk library for colord Useful GUI for colormgr utility. == Iccprofiles == Package with common icc profiles collection from Adobe and ECI. == Xcalib == xcalib is a tool for direct loading icc profile for monitor. == lprof == [http://lprof.sourceforge.net/ Homepage] Lprof does not included in slackbuilds repository. Requires: [https://slackware.pkgs.org/14.2/slackonly-i486/qt3-3.3.8b-i486-6_slonly.txz.html qt3], [https://slackbuilds.org/repository/14.2/libraries/vigra/ Vigra] === Installation === Create directory for installation. In my case: mkdir ~/software/lprof In order to compile we need some tricks on source tree directory: find . -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" | xargs sed -i 's/BOOL/bool/g' find . -iname "*.c" | xargs sed -i '/typedef long int bool/d' find . -iname "*.c" | xargs sed -i '1i typedef enum { FALSE, TRUE } bool;' Then scons PREFIX=~/software/lprof/ qt_directory=/opt/kde3/lib/qt3-3.3.8b/ install === Usage === We can use lprof to create icc profile for monitor or camera/scanner. == See also == [https://wiki.archlinux.org/index.php/ICC_profiles Page on Archwiki dedicated to this problem] [http://www.hughski.com/ Open source display colorimeter] Page in progress. bf7d0d6e0870b27e8c6fbf7125f8cc194d62241f Xterm 0 327 1016 2017-07-17T09:01:13Z Aeifn 367 Created page with "This page is about tweaking xterm. For information about xterm in general see xterm(1) Config in file ~/.Xdefaults Copy selection to clipboard: XTerm*selectToClipboard:true" wikitext text/x-wiki This page is about tweaking xterm. For information about xterm in general see xterm(1) Config in file ~/.Xdefaults Copy selection to clipboard: XTerm*selectToClipboard:true 2d321c010bf16a8229c4436adfa5c7b0326ea479 1017 1016 2017-07-17T09:02:28Z Aeifn 367 wikitext text/x-wiki This page is about tweaking xterm. For information about xterm in general see xterm(1) Config in file ~/.Xdefaults Copy selection to clipboard: XTerm*selectToClipboard:true reload the configuration xrdb ~/.Xdefaults 610996ef8375f5c221b34395dfbb7a75d9a944da Writing A SlackBuild Script 0 16 1021 661 2017-07-19T08:40:57Z Aeifn 367 /* Introduction */ wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like pkgs.org, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget http://www.latex2html.org/~latex2ht/current/latex2html-2002-2-1.tar.gz # 03.27.2012 Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar -xzf latex2html-2002-2-1.tar.gz || exit 1 = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ cdc180c408aabe3d4671ff124e6a712224688086 Life of a Software Package 0 104 3161 1144 2018-03-11T17:29:18Z Rworkman 13 Reverted edits by [[Special:Contributions/Jhonthomas|Jhonthomas]] ([[User talk:Jhonthomas|talk]]) to last revision by [[User:Grissiom|Grissiom]] wikitext text/x-wiki From the programmer's keyboard to your (Slackware) Linux system. = Introduction = This article explains how a program someone writes in one side of the world ends up being managed in your system. It's meant to be easy to understand for a novice user coming from Windows, and only requires some basic knowledge of Unix systems. Specifically, the reader should know: * How basic Unix permissions work. * How to interpret the basic output of the ''ls'' command. * How a command line interface works. It only contains general ideas that could help a novice user understand the existing differences when installing software under Windows and under Unix, but no specific information about how to do it. The distribution manual will give you the specific details you need, and may be a good read after you have read this article. = From source code to machine language = '''Note''': You do not need to run any of the commands in this section. It's enough to understand the text and part of the output. When a programmer creates a program, it's very common to write the program in a so-called high level language. In other words, he doesn't create the program executable directly specifying the intructions for the computer to run. He writes the program in a language that allows him to represent the program structure and logic, and then that logic is translated to a language the bare machine can understand. Let's suppose someone wants to write a ''Hello, World'' program in the C programming language. This is a program that prints a message to the screen and finishes, in order to check your system can translate the language you have used to machine language and to test the basic stuff works, as well as to give the novice programmer an idea on how the high level language works. This would be a very simple ''Hello, World'' program written in C: #include <stdio.h> int main() { printf("Hello, World!\n"); return 0; } You do not need to understand that program. The above text is what is commonly known as the '''source code''' of the program. The source code of a program in C is usually spread over one or more source files, so this program could very well be stored in a plain text file called ''hello.c''. You could view this file using a plain text editor like the Windows notepad. This file cannot be executed directly because it's not a real program. First off, it doesn't have execution permissions, and if we tried to give it execution permissions and run it, we would get an error message: $ ls -l hello.c -rw------- 1 rg3 users 74 2007-10-15 19:27 hello.c $ chmod +x hello.c $ ./hello.c ./hello.c: line 3: syntax error near unexpected token `(' ./hello.c: line 3: `int main()' We need to use a program called ''compiler'' to get a binary and executable file. A file in a specific format that the operating system (Linux in our case) can understand. When you run it, the operating system reads the file, copies the different program components to the computer's memory and starts the program execution. If our machine has everything ready to compile C programs and we want to use the GNU C Compiler (''gcc''), we could do something as simple as: $ gcc -o hello hello.c And we would get a file named ''hello'' which is our program ready to be run. As you see, our program is simply called ''hello'' and not ''hello.exe'', which would be a common name if we were working under Windows. In Unix systems, the convention is that programs do not have any file extension in their name (like EXE). We could then run the program and see that it does what we wanted. $ ./hello Hello, World! $ = Complex programs use libraries = Most programs do a more sophisticated task than printing a message on the screen and finishing. The source code of the program above has 7 lines. It is not uncommon for a simple program to have thousands of lines, and there are a good amount of complex programs out there that have millions of lines of source code. It is also a very common practice to use items called '''libraries''' (usually '''shared''' libraries) to build your program. Libraries are files that contain the machine code to perform several different tasks. For example, let's suppose you were going to create a program that needs to download some data from the Internet, via HTTP (the web) or via FTP or another network service. And also let's suppose you don't have much knowledge on how to create a program that talks to others using the network, or that the focus of your program is on solving some other problem and you don't want to lose time or create a lot of code just because you want it to be able to download a file. Fortunately for you, there is a library called ''libcurl'' that makes retrieving files over the network very easy. The library contains all the code you need, so the source code you are going to create will not contain anything specific to be able to use the network. You simply indicate that you want to use ''libcurl'' and call the library functions everytime you want to download a file. Do you need to learn to sail or fly a plane or a different language if you want to send a letter to a friend in a different continent? No, you put the letter in the mailbox and the postal service does it for you. Libraries work like this. In the moment you decide to do this, your program starts '''depending''' on ''libcurl''. Some pieces of the library need to be present in your system if you want to compile that program to create an executable, and some other pieces need to be present in the moment you want to ''run'' the program. Else, the program will not compile or will not be able to run. Libraries are convenient because, if managed well, you can install them in your system once and they will be used by every program that needs them. This is why libraries are regarded as a ''good thing'' or a ''good idea'' in the programming world, in most cases. In Windows, shared libraries are called DLLs, as the library files usually have the DLL extension. In Unix, it's common for them to have the ''.so'' suffix, or some other containing it. For example, I have ''libcurl'' in my system, and the shared library is located in the file ''/usr/lib/libcurl.so.4.0.0''. = Libraries and programs all over the place need a package manager = So your system is going to be populated by a lot of programs, many of them using many different libraries for different tasks, some of them having some libraries in common, others having nothing in common. As you can guess, this situation can evolve into a pretty chaotic system. Let's describe how Windows did this in the past, and how Unix systems have been trying to handle the situation for a good amount of years now. In Windows, most people distribute programs already compiled. You get a group of files or a single file that holds your program already prepared to be run. You extract those contents and place them somewhere in your hard drive, usually all of them under a specific directory (folder). You could then create some shortcuts in the ''start'' menu and the program is ready to be run. A installer program usually does all of this for you, asking some questions. What happens when the program uses a library? If the library is not very common and cannot be assumed to exist in a standard Windows installation, the common practice is to include a copy of the library with the program. If it's a relatively uncommon library, the installer usually puts it in the same place as the program, and when it is run and requests the library, the system first looks in the folder holding the program and finds the library there, and starts to use it. If it's not an uncommon library but you need a specific version of it, the installer may try to install it in a common place so all the programs can use it. It was very typical, when you had a system in which you had installed a lot of software as time passed, that the installer would ask you "I am trying to install the following library, but it appears to be present in your system in a newer version. Do you want me to replace the copy of it with my copy or do I leave it as it is?". And, in the same line, when you removed the program it would say "I was going to remove this library from the common place, but other programs may want to use it. Can I remove it or should I keep it there?". This chaos was called "DLL Hell". Unix tries to avoid this problem in several ways, and its solutions bring the need of a package manager as we will explain. First off, in Unix the files on your hard drive are not grouped by program, but by their function. All binaries are stored in two or three folders, and the same for libraries or help documents. If all the documentation and help for the different programs is installed in a common location, it's easier to create a help system from which you can browse the documentation of every program installed on the computer, for example. This is generally considered a good idea and it's the tradition, but of course the idea has its detractors. Anyway, a second difference is that in Unix programs are distributed alone. If a program needs a library to be run, it needs to specify that somewhere, but only under special circumstances it's recommended to include the library as part of the program. In most cases, the library is distributed apart. Those two differences avoid the DLL hell. By installing libraries, programs, documentation and other data to common system locations, you avoid duplicating data. If there's a security problem using a library and every program using it could become compromised and make the system vulnerable, you update the library once and all the programs that use it are automatically protected, as each program doesn't include its own copy in its directory. By separating the programs from the libraries they use and distributing them apart, you make sure programs do not overwrite the libraries used by others or remove common libraries when they are removed. However, the solution itself brings some new problems. For example, if a program installs files all over common system directories and I later want to remove it, how do I know which files need to be removed? And if a program requires a library to run, can I or should I specify that fact somewhere? Package managers are the answer. Under Unix, software is many times distributed as '''packages'''. Packages are groups of files that contain programs, libraries, documentation or simply data. Under Windows, to install a program many times you download an installer file, run it and the program is installed. This installer file that holds inside all the files the program needs and extracts them to the proper location could be considered a form of package, so you get an idea. Packages in Unix are usually managed by a package manager. A package manager is a program that allows you to install packages, check the list of installed packages, remove packages and many more complex tasks depending on how powerful and featureful the package manager itself is. When you install a program using a package, the package holds the program binary, the program data and the program documentation, typically, along with information on where those files should be installed in the system, all over the place. Fortunately, prior, during or after the installation, after copying the files to your system, the package manager records somewhere the name and version of the package and the files it installed. This is the trick that allows you to later remove the package using the package manager without having to remember which files had been installed where. In addition, the package may hold information about other packages it needs installed for it to run, and this information may be used by the package manager to automatically download and install them too. Hopefully, you now start to understand the practical vision behind packages and package managers. = Too many package managers = The problem with package managers is that many Unix systems and even many different Linux distributions use many different package managers. Each one uses different package formats that cannot understand each other. Slackware uses ''pkgtools'', Debian and Ubuntu use ''apt-get'', Red Hat uses ''yum'', Mandriva uses ''urpmi'', Arch uses ''pacman'', etc. You are a programmer and created the ''Hello, World'' program we saw at the beginning. How do you distribute your program? You have several solutions. If you don't want people to get the source code of your program, you need to distribute the program already compiled and probably packaged. To do that, you could provide your own program to install and uninstall the package cleanly from any system, and distribute it somehow and break some rules to achieve maximum compatibility, so the program will run on many different systems and distributions. Many commercial games are shipped this way. Unreal Tournament 2004 for Linux is distributed this way, for example. You could also provide it as a package for each of a subset of supported systems. Many companies do this. They give you Debian, Red Hat, Suse and Mandriva packages for you to choose, for example, each in the proper format to be used with the package manager from that distribution. If you want to use the software under other system you are out of luck. You can try some tricks but it's not guaranteed to work. If, on the other hand, your program is open source and you don't mind people reading the source code of your program, the common case is to avoid creating a package for anything. You simply distribute a tarball (similar to a ZIP or RAR file) containing the source code and instructions to compile it. If someone wants a Debian package to install it, someone will have to compile your program under Debian, and make a package with the result. This is a very very very common case. In fact, distributions like Ubuntu or Debian heavily rely on '''package repositories''', network locations from where you can download thousands of packages for your system, created by a myriad of official and unofficial packagers (people that create packages for the system). For example, if you want to install a program under Ubuntu, it's very infrequent for the program not to exist already packaged in a repository, and you can download and install it, together with its dependencies, in a couple of mouse clicks. = Summing up = * Many times the programmer creates programs using source code that must be compiled. * They use libraries to make writing programs easy. * Distributing the resulting program is easier using a package manager. * Many programmers only give you the source code due to the diversity of package managers and systems. * Someone else is responsible for creating a package for a specific system. = Slackware specifics = Slackware is, as you may know, a very simple system. Being simple doesn't mean it's simple to use. On the contrary, a system with a simple design and simple tools usually requires the user to do more things to achieve a goal. The advantage of a simple design is that it's easier to understand if you want to know how your system works, and sometimes it's also more stable and has less bugs. As part of its simple design, the package manager in Slackware is also very simple, and its packages are also very simple. Slackware packages are tarballs (again, something like ZIP files) that, if extracted in the right place, will populate the system with the package files, and it also holds some special files with information about the package itself. As they are simple tarballs, Slackware doesn't try to hide this fact, and Slackware packages have the ''tgz/txz'' extension (short for ''tar.gz/tar.xz''), contrary to other systems in which packages have a special extension to make it clear that they are packages, like ''rpm'' or ''deb''. This is not a problem, but sometimes this confuses novice users. They go to the program webpage and download the program source code in a tarball (usually a file with ''tar.gz'' extension) and think "Hey, if Slackware packages are tarballs and this is a tarball, I'm going to install this file with the package manager". Wrong! Even when the package manager complains that the package name does not end in ''tgz'' but on ''tar.gz'', they many times rename the file and try again. Those are two mistakes in a row. The package manager will try to extact the tarball contents to that special location we mentioned earlier and nothing will happen, as the files inside the tarball are not structured as they need to be, but this is the small problem. The big one is that what you are trying to install is the source code of the program, and not the program itself! Remember, you need to compile it first in the majority of cases. Under Slackware, you should first check if there is an official package for the program. If there is not, you could try to to download a ready to use package from a place or someone you trust. Else, you could compile the program yourself and create a package for it, and then install the package. The compilation and package creation can be automated sometimes for ease of use, for example using [[SlackBuild Scripts|SlackBuild scripts]]. [[Category:Information]] 712647b02c547102f2dcd6c07bd337eb916207ca Main Page 0 1 3166 989 2018-03-11T20:21:30Z Erik 1 Upgraded MediaWiki wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.30.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 20:21, 11 March 2018 (UTC) MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 32d6e0186fe969f9ac624fc07ccf76e93d2b1c3b 3173 3166 2018-06-16T17:59:02Z Erik 1 /* News */ Version update wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.31.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:59, 16 June 2018 (UTC) MediaWiki was upgraded to 1.30.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 20:21, 11 March 2018 (UTC) MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) ae8cf9d7d606f1011a031d67270ad8fe2da7c7b0 3176 3173 2018-10-27T18:42:37Z Erik 1 wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.31.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:42, 27 October 2018 (UTC) MediaWiki was upgraded to 1.31.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:59, 16 June 2018 (UTC) MediaWiki was upgraded to 1.30.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 20:21, 11 March 2018 (UTC) MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 2d297986436011cbb841d9d36ecec3973317e894 ATI Graphics 0 36 3167 57 2018-05-10T19:55:47Z Phorneker 604 /* Notes */ Support information about video support for the ATI Radeon Mobility 2600 was added. wikitext text/x-wiki [[Category:Hardware]] ===Introduction=== ATI drivers come in two flavours: 1) X.Org open source 'radeon' driver - full support (accelerated 2D and 3D) for the Radeon 9200 and earlier. (Also supported for the 9200 - X850 for Slackware -current, or any Slackware newer than 11.0) 2) ATI's proprietary closed source 'fglrx' driver - support for the 9500 and above (all support for earlier cards has now been dropped). This is the only driver with any support, either 2D or 3D, for the X1xxx series of cards (R500 and newer). ====Kernel==== AGPGART: If you have an AGP card, you should ensure AGPGART and support for your specific GART are built in the kernel (built in or module is fine) PCI Express: If you have a PCI Express card, you should ensure PCI Express support is built in the kernel. ==Seting up the 'radeon' driver== ===Preparing Your System=== ====Kernel==== Direct Rendering Manager (DRM): Module or built in, plus the module under this for "ATI Radeon" ===Initial Setup=== Edit /etc/X11/xorg.conf In Section "Module" add: Load "glx" Load "dri" At the end of the file, add Section "DRI" Mode 0666 EndSection (Or use 'Xorg -configure' to generate a new xorg.conf to autodetect the ATi card) ===Tweaking=== To increase performance for Radeon users (in particular, R300 and R400), you may also want to add the following under the "Device" section for the radeon: ====AGP users==== Option "AGPMode" "8" # Modify accordingly if you don't have an AGP 8x card Option "AGPFastWrite" "true" # This one has big warnings all over it, so test it first! ====Mobility card users==== Option "DynamicClocks" "true" # The equivalent of ATi's PowerPlay Option "BIOSHotkeys" "true" # You _might_ need this for some special function keys on your laptop ====All users==== Option "EnablePageFlip" "true" Option "ColorTiling" "true" ===Final Check=== Run 'glxinfo | grep render'. It will return something like the following (the last line will vary depending on R300/ R400, PCI/ PCIE or AGP, etc). The important thing is that this reports "direct rendering: yes". direct rendering: Yes OpenGL renderer string: Mesa DRI R300 20060815 AGP 8x x86/MMX+/3DNow!+/SSE TCL ===Notes=== '''R300 - R400:''' Please note that these cards do not have accelerated hardware support in X.Org < 6.9 (i.e. Slackware 11.0 or older) '''R500 (X1xxx and above)''' Sorry, there is no open source accelerated support in X for these cards. Either use fglrx or vesa. '''R600''' For the ATI Radeon Mobility 2600 (the built in video on the HP Compaq 8510p), the radeon driver must be used for accelerated support. The amdgpu driver will not work with this video board. ==Setting up the 'fglrx' driver== ===Preparing Your System=== ====Libraries==== The fglrx driver requires that you have the package cxxlibs installed on your system to build it. '''(Slamd64)''': You will also need the 32 bit compatibility libraries from c/ ====Kernel==== Direct Rendering Manager (DRM): Must *not* be built into the kernel - it should be a module (and not loaded) or not built. Frame Buffer: Must *not* be built into the kernel - it should be a module or not built (it is not compatible with the current fglrx drivers). ===Installing the Driver=== You will need to download the 'ATI Driver Installer' package (the RPM packages do not have support for X.Org 6.9). Once you have downloaded the installer, run it (I reccommend using sudo, as you need root permissions but also need access to the X server. You could use xhost+ and then su, but this is not safe). sudo sh ati-driver-installer-$VERSION-$ARCH.run You need to select the 'Install driver' (the ATI installer cannot generate a Slackware package), and then it is reccommended you choose "automatic" on the next screen. The driver will now install itself. Make sure that you mount tmpfs for 3D acceleration, or you can get unexpected results. ie: 'FGLTexMgr: open of shared memory object failed (Function not implemented) __FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!! fglX11AllocateManagedSurface: __FGLTexMgrCreateObject failed!!' Add the following to /etc/fstab: tmpfs /dev/shm tmpfs defaults 0 0 then 'mount /dev/shm' on a console ===Patching the Driver=== If you are running the latest kernel, more often than not you will need to patch the fglrx driver. At the very least, you will need to manually rebuild it if you change your kernel - follow instruction 1 if necessary, then 2 and 3. There is no central repository of these, so it is not possible to point you to a specific place to check for them (although the [http://ati.cchtml.com Unofficial ATI Bugzilla] or [http://www.rage3d.com/board/forumdisplay.php?f=88 Rage3D Linux Drivers forum] are good places to check). Once you have downloaded the patches: 1. Apply them in /lib/modules/fglrx (or /lib/modules/fglrx/build_mod) cd /lib/modules/fglrx/build_mod cat somepatch.diff | patch -p1 2. Rebuild the fglrx module sh /lib/modules/fglrx/build_mod/make.sh N.B. Modules built are kernel specific - you can only build a module for the kernel you are currently running. 3. Install the module sh /lib/modules/fglrx/make_install.sh ===Configuring the X server=== If you have not installed the fglrx driver before, run: aticonfig --initial --input=/etc/X11/xorg.conf aticonfig --ovt=Xv This will add an fglrx 'Section "Device"' to /etc/X11/xorg.conf and enable video overlay (enables video playback) Edit /etc/X11/xorg.conf (you need to do this with root permissions) Find: 1) A 'Section "Device"' that contains fglrx 2) 'Section "Screen"' Then: 1) Under the Section "Device" that contains fglrx<br /> 1A). Make a note of the value of "Indentifier"<br /> 2) Under Section "Screen", replace the value of "Device" with the value you just noted from fglrx At the end of /etc/X11/xorg.conf, add this section (This allows all users to access the direct rendering mode - without it, you can't use acceleration as a user): Section "DRI" Mode 0666 EndSection Restart the X server ===Final Check=== To check that fglrx has been installed and setup correctly, run 'fglrxinfo' in a terminal under X. It should return something like: display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: MOBILITY RADEON X700 Generic OpenGL version string: 2.0.5642 (8.22.5) (The 'renderer' string will vary depending on the chip your card actually has). ===Uninstalling the driver=== With root permissions, run: sh /usr/share/fglrx/fglrx-uninstall.sh 2a49c0a5ac692e8702d6f28a5e3fa898e4704368 3168 3167 2018-05-10T19:56:09Z Phorneker 604 /* Notes */ wikitext text/x-wiki [[Category:Hardware]] ===Introduction=== ATI drivers come in two flavours: 1) X.Org open source 'radeon' driver - full support (accelerated 2D and 3D) for the Radeon 9200 and earlier. (Also supported for the 9200 - X850 for Slackware -current, or any Slackware newer than 11.0) 2) ATI's proprietary closed source 'fglrx' driver - support for the 9500 and above (all support for earlier cards has now been dropped). This is the only driver with any support, either 2D or 3D, for the X1xxx series of cards (R500 and newer). ====Kernel==== AGPGART: If you have an AGP card, you should ensure AGPGART and support for your specific GART are built in the kernel (built in or module is fine) PCI Express: If you have a PCI Express card, you should ensure PCI Express support is built in the kernel. ==Seting up the 'radeon' driver== ===Preparing Your System=== ====Kernel==== Direct Rendering Manager (DRM): Module or built in, plus the module under this for "ATI Radeon" ===Initial Setup=== Edit /etc/X11/xorg.conf In Section "Module" add: Load "glx" Load "dri" At the end of the file, add Section "DRI" Mode 0666 EndSection (Or use 'Xorg -configure' to generate a new xorg.conf to autodetect the ATi card) ===Tweaking=== To increase performance for Radeon users (in particular, R300 and R400), you may also want to add the following under the "Device" section for the radeon: ====AGP users==== Option "AGPMode" "8" # Modify accordingly if you don't have an AGP 8x card Option "AGPFastWrite" "true" # This one has big warnings all over it, so test it first! ====Mobility card users==== Option "DynamicClocks" "true" # The equivalent of ATi's PowerPlay Option "BIOSHotkeys" "true" # You _might_ need this for some special function keys on your laptop ====All users==== Option "EnablePageFlip" "true" Option "ColorTiling" "true" ===Final Check=== Run 'glxinfo | grep render'. It will return something like the following (the last line will vary depending on R300/ R400, PCI/ PCIE or AGP, etc). The important thing is that this reports "direct rendering: yes". direct rendering: Yes OpenGL renderer string: Mesa DRI R300 20060815 AGP 8x x86/MMX+/3DNow!+/SSE TCL ===Notes=== '''R300 - R400:''' Please note that these cards do not have accelerated hardware support in X.Org < 6.9 (i.e. Slackware 11.0 or older) '''R500 (X1xxx and above)''' Sorry, there is no open source accelerated support in X for these cards. Either use fglrx or vesa. '''R600''' For the ATI Radeon Mobility 2600 (the built in video on the HP Compaq 8510p), the '''radeon''' driver must be used for accelerated support. The amdgpu driver will not work with this video board. ==Setting up the 'fglrx' driver== ===Preparing Your System=== ====Libraries==== The fglrx driver requires that you have the package cxxlibs installed on your system to build it. '''(Slamd64)''': You will also need the 32 bit compatibility libraries from c/ ====Kernel==== Direct Rendering Manager (DRM): Must *not* be built into the kernel - it should be a module (and not loaded) or not built. Frame Buffer: Must *not* be built into the kernel - it should be a module or not built (it is not compatible with the current fglrx drivers). ===Installing the Driver=== You will need to download the 'ATI Driver Installer' package (the RPM packages do not have support for X.Org 6.9). Once you have downloaded the installer, run it (I reccommend using sudo, as you need root permissions but also need access to the X server. You could use xhost+ and then su, but this is not safe). sudo sh ati-driver-installer-$VERSION-$ARCH.run You need to select the 'Install driver' (the ATI installer cannot generate a Slackware package), and then it is reccommended you choose "automatic" on the next screen. The driver will now install itself. Make sure that you mount tmpfs for 3D acceleration, or you can get unexpected results. ie: 'FGLTexMgr: open of shared memory object failed (Function not implemented) __FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!! fglX11AllocateManagedSurface: __FGLTexMgrCreateObject failed!!' Add the following to /etc/fstab: tmpfs /dev/shm tmpfs defaults 0 0 then 'mount /dev/shm' on a console ===Patching the Driver=== If you are running the latest kernel, more often than not you will need to patch the fglrx driver. At the very least, you will need to manually rebuild it if you change your kernel - follow instruction 1 if necessary, then 2 and 3. There is no central repository of these, so it is not possible to point you to a specific place to check for them (although the [http://ati.cchtml.com Unofficial ATI Bugzilla] or [http://www.rage3d.com/board/forumdisplay.php?f=88 Rage3D Linux Drivers forum] are good places to check). Once you have downloaded the patches: 1. Apply them in /lib/modules/fglrx (or /lib/modules/fglrx/build_mod) cd /lib/modules/fglrx/build_mod cat somepatch.diff | patch -p1 2. Rebuild the fglrx module sh /lib/modules/fglrx/build_mod/make.sh N.B. Modules built are kernel specific - you can only build a module for the kernel you are currently running. 3. Install the module sh /lib/modules/fglrx/make_install.sh ===Configuring the X server=== If you have not installed the fglrx driver before, run: aticonfig --initial --input=/etc/X11/xorg.conf aticonfig --ovt=Xv This will add an fglrx 'Section "Device"' to /etc/X11/xorg.conf and enable video overlay (enables video playback) Edit /etc/X11/xorg.conf (you need to do this with root permissions) Find: 1) A 'Section "Device"' that contains fglrx 2) 'Section "Screen"' Then: 1) Under the Section "Device" that contains fglrx<br /> 1A). Make a note of the value of "Indentifier"<br /> 2) Under Section "Screen", replace the value of "Device" with the value you just noted from fglrx At the end of /etc/X11/xorg.conf, add this section (This allows all users to access the direct rendering mode - without it, you can't use acceleration as a user): Section "DRI" Mode 0666 EndSection Restart the X server ===Final Check=== To check that fglrx has been installed and setup correctly, run 'fglrxinfo' in a terminal under X. It should return something like: display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: MOBILITY RADEON X700 Generic OpenGL version string: 2.0.5642 (8.22.5) (The 'renderer' string will vary depending on the chip your card actually has). ===Uninstalling the driver=== With root permissions, run: sh /usr/share/fglrx/fglrx-uninstall.sh 7973b83acafdda2af6ebc3134827688b0713fd36 3169 3168 2018-05-10T19:58:05Z Phorneker 604 /* Notes */ wikitext text/x-wiki [[Category:Hardware]] ===Introduction=== ATI drivers come in two flavours: 1) X.Org open source 'radeon' driver - full support (accelerated 2D and 3D) for the Radeon 9200 and earlier. (Also supported for the 9200 - X850 for Slackware -current, or any Slackware newer than 11.0) 2) ATI's proprietary closed source 'fglrx' driver - support for the 9500 and above (all support for earlier cards has now been dropped). This is the only driver with any support, either 2D or 3D, for the X1xxx series of cards (R500 and newer). ====Kernel==== AGPGART: If you have an AGP card, you should ensure AGPGART and support for your specific GART are built in the kernel (built in or module is fine) PCI Express: If you have a PCI Express card, you should ensure PCI Express support is built in the kernel. ==Seting up the 'radeon' driver== ===Preparing Your System=== ====Kernel==== Direct Rendering Manager (DRM): Module or built in, plus the module under this for "ATI Radeon" ===Initial Setup=== Edit /etc/X11/xorg.conf In Section "Module" add: Load "glx" Load "dri" At the end of the file, add Section "DRI" Mode 0666 EndSection (Or use 'Xorg -configure' to generate a new xorg.conf to autodetect the ATi card) ===Tweaking=== To increase performance for Radeon users (in particular, R300 and R400), you may also want to add the following under the "Device" section for the radeon: ====AGP users==== Option "AGPMode" "8" # Modify accordingly if you don't have an AGP 8x card Option "AGPFastWrite" "true" # This one has big warnings all over it, so test it first! ====Mobility card users==== Option "DynamicClocks" "true" # The equivalent of ATi's PowerPlay Option "BIOSHotkeys" "true" # You _might_ need this for some special function keys on your laptop ====All users==== Option "EnablePageFlip" "true" Option "ColorTiling" "true" ===Final Check=== Run 'glxinfo | grep render'. It will return something like the following (the last line will vary depending on R300/ R400, PCI/ PCIE or AGP, etc). The important thing is that this reports "direct rendering: yes". direct rendering: Yes OpenGL renderer string: Mesa DRI R300 20060815 AGP 8x x86/MMX+/3DNow!+/SSE TCL ===Notes=== '''R300 - R400:''' Please note that these cards do not have accelerated hardware support in X.Org < 6.9 (i.e. Slackware 11.0 or older) '''R500 (X1xxx and above)''' Sorry, there is no open source accelerated support in X for these cards. Either use fglrx or vesa. '''R600''' For the ATI Radeon Mobility 2600 (the built in video on the HP Compaq 8510p), the '''radeon''' driver must be used for accelerated support. The amdgpu driver will not work with this video board. Though the fglrx driver can be used with this video board, it is not necessary to install the proprietary driver to get this video board working. ==Setting up the 'fglrx' driver== ===Preparing Your System=== ====Libraries==== The fglrx driver requires that you have the package cxxlibs installed on your system to build it. '''(Slamd64)''': You will also need the 32 bit compatibility libraries from c/ ====Kernel==== Direct Rendering Manager (DRM): Must *not* be built into the kernel - it should be a module (and not loaded) or not built. Frame Buffer: Must *not* be built into the kernel - it should be a module or not built (it is not compatible with the current fglrx drivers). ===Installing the Driver=== You will need to download the 'ATI Driver Installer' package (the RPM packages do not have support for X.Org 6.9). Once you have downloaded the installer, run it (I reccommend using sudo, as you need root permissions but also need access to the X server. You could use xhost+ and then su, but this is not safe). sudo sh ati-driver-installer-$VERSION-$ARCH.run You need to select the 'Install driver' (the ATI installer cannot generate a Slackware package), and then it is reccommended you choose "automatic" on the next screen. The driver will now install itself. Make sure that you mount tmpfs for 3D acceleration, or you can get unexpected results. ie: 'FGLTexMgr: open of shared memory object failed (Function not implemented) __FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!! fglX11AllocateManagedSurface: __FGLTexMgrCreateObject failed!!' Add the following to /etc/fstab: tmpfs /dev/shm tmpfs defaults 0 0 then 'mount /dev/shm' on a console ===Patching the Driver=== If you are running the latest kernel, more often than not you will need to patch the fglrx driver. At the very least, you will need to manually rebuild it if you change your kernel - follow instruction 1 if necessary, then 2 and 3. There is no central repository of these, so it is not possible to point you to a specific place to check for them (although the [http://ati.cchtml.com Unofficial ATI Bugzilla] or [http://www.rage3d.com/board/forumdisplay.php?f=88 Rage3D Linux Drivers forum] are good places to check). Once you have downloaded the patches: 1. Apply them in /lib/modules/fglrx (or /lib/modules/fglrx/build_mod) cd /lib/modules/fglrx/build_mod cat somepatch.diff | patch -p1 2. Rebuild the fglrx module sh /lib/modules/fglrx/build_mod/make.sh N.B. Modules built are kernel specific - you can only build a module for the kernel you are currently running. 3. Install the module sh /lib/modules/fglrx/make_install.sh ===Configuring the X server=== If you have not installed the fglrx driver before, run: aticonfig --initial --input=/etc/X11/xorg.conf aticonfig --ovt=Xv This will add an fglrx 'Section "Device"' to /etc/X11/xorg.conf and enable video overlay (enables video playback) Edit /etc/X11/xorg.conf (you need to do this with root permissions) Find: 1) A 'Section "Device"' that contains fglrx 2) 'Section "Screen"' Then: 1) Under the Section "Device" that contains fglrx<br /> 1A). Make a note of the value of "Indentifier"<br /> 2) Under Section "Screen", replace the value of "Device" with the value you just noted from fglrx At the end of /etc/X11/xorg.conf, add this section (This allows all users to access the direct rendering mode - without it, you can't use acceleration as a user): Section "DRI" Mode 0666 EndSection Restart the X server ===Final Check=== To check that fglrx has been installed and setup correctly, run 'fglrxinfo' in a terminal under X. It should return something like: display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: MOBILITY RADEON X700 Generic OpenGL version string: 2.0.5642 (8.22.5) (The 'renderer' string will vary depending on the chip your card actually has). ===Uninstalling the driver=== With root permissions, run: sh /usr/share/fglrx/fglrx-uninstall.sh f470bb8a17cea9f3aedec8b1cbf1b9ef19815f2f 3170 3169 2018-05-10T19:58:44Z Phorneker 604 /* Notes */ wikitext text/x-wiki [[Category:Hardware]] ===Introduction=== ATI drivers come in two flavours: 1) X.Org open source 'radeon' driver - full support (accelerated 2D and 3D) for the Radeon 9200 and earlier. (Also supported for the 9200 - X850 for Slackware -current, or any Slackware newer than 11.0) 2) ATI's proprietary closed source 'fglrx' driver - support for the 9500 and above (all support for earlier cards has now been dropped). This is the only driver with any support, either 2D or 3D, for the X1xxx series of cards (R500 and newer). ====Kernel==== AGPGART: If you have an AGP card, you should ensure AGPGART and support for your specific GART are built in the kernel (built in or module is fine) PCI Express: If you have a PCI Express card, you should ensure PCI Express support is built in the kernel. ==Seting up the 'radeon' driver== ===Preparing Your System=== ====Kernel==== Direct Rendering Manager (DRM): Module or built in, plus the module under this for "ATI Radeon" ===Initial Setup=== Edit /etc/X11/xorg.conf In Section "Module" add: Load "glx" Load "dri" At the end of the file, add Section "DRI" Mode 0666 EndSection (Or use 'Xorg -configure' to generate a new xorg.conf to autodetect the ATi card) ===Tweaking=== To increase performance for Radeon users (in particular, R300 and R400), you may also want to add the following under the "Device" section for the radeon: ====AGP users==== Option "AGPMode" "8" # Modify accordingly if you don't have an AGP 8x card Option "AGPFastWrite" "true" # This one has big warnings all over it, so test it first! ====Mobility card users==== Option "DynamicClocks" "true" # The equivalent of ATi's PowerPlay Option "BIOSHotkeys" "true" # You _might_ need this for some special function keys on your laptop ====All users==== Option "EnablePageFlip" "true" Option "ColorTiling" "true" ===Final Check=== Run 'glxinfo | grep render'. It will return something like the following (the last line will vary depending on R300/ R400, PCI/ PCIE or AGP, etc). The important thing is that this reports "direct rendering: yes". direct rendering: Yes OpenGL renderer string: Mesa DRI R300 20060815 AGP 8x x86/MMX+/3DNow!+/SSE TCL ===Notes=== '''R300 - R400:''' Please note that these cards do not have accelerated hardware support in X.Org < 6.9 (i.e. Slackware 11.0 or older) '''R500 (X1xxx and above)''' Sorry, there is no open source accelerated support in X for these cards. Either use fglrx or vesa. '''R600''' For the ATI Radeon Mobility 2600 (the built in video on the HP Compaq 8510p), the '''radeon''' driver can be used for accelerated support. The amdgpu driver will not work with this video board. Though the fglrx driver can be used with this video board, it is not necessary to install the proprietary driver to get this video board working. ==Setting up the 'fglrx' driver== ===Preparing Your System=== ====Libraries==== The fglrx driver requires that you have the package cxxlibs installed on your system to build it. '''(Slamd64)''': You will also need the 32 bit compatibility libraries from c/ ====Kernel==== Direct Rendering Manager (DRM): Must *not* be built into the kernel - it should be a module (and not loaded) or not built. Frame Buffer: Must *not* be built into the kernel - it should be a module or not built (it is not compatible with the current fglrx drivers). ===Installing the Driver=== You will need to download the 'ATI Driver Installer' package (the RPM packages do not have support for X.Org 6.9). Once you have downloaded the installer, run it (I reccommend using sudo, as you need root permissions but also need access to the X server. You could use xhost+ and then su, but this is not safe). sudo sh ati-driver-installer-$VERSION-$ARCH.run You need to select the 'Install driver' (the ATI installer cannot generate a Slackware package), and then it is reccommended you choose "automatic" on the next screen. The driver will now install itself. Make sure that you mount tmpfs for 3D acceleration, or you can get unexpected results. ie: 'FGLTexMgr: open of shared memory object failed (Function not implemented) __FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!! fglX11AllocateManagedSurface: __FGLTexMgrCreateObject failed!!' Add the following to /etc/fstab: tmpfs /dev/shm tmpfs defaults 0 0 then 'mount /dev/shm' on a console ===Patching the Driver=== If you are running the latest kernel, more often than not you will need to patch the fglrx driver. At the very least, you will need to manually rebuild it if you change your kernel - follow instruction 1 if necessary, then 2 and 3. There is no central repository of these, so it is not possible to point you to a specific place to check for them (although the [http://ati.cchtml.com Unofficial ATI Bugzilla] or [http://www.rage3d.com/board/forumdisplay.php?f=88 Rage3D Linux Drivers forum] are good places to check). Once you have downloaded the patches: 1. Apply them in /lib/modules/fglrx (or /lib/modules/fglrx/build_mod) cd /lib/modules/fglrx/build_mod cat somepatch.diff | patch -p1 2. Rebuild the fglrx module sh /lib/modules/fglrx/build_mod/make.sh N.B. Modules built are kernel specific - you can only build a module for the kernel you are currently running. 3. Install the module sh /lib/modules/fglrx/make_install.sh ===Configuring the X server=== If you have not installed the fglrx driver before, run: aticonfig --initial --input=/etc/X11/xorg.conf aticonfig --ovt=Xv This will add an fglrx 'Section "Device"' to /etc/X11/xorg.conf and enable video overlay (enables video playback) Edit /etc/X11/xorg.conf (you need to do this with root permissions) Find: 1) A 'Section "Device"' that contains fglrx 2) 'Section "Screen"' Then: 1) Under the Section "Device" that contains fglrx<br /> 1A). Make a note of the value of "Indentifier"<br /> 2) Under Section "Screen", replace the value of "Device" with the value you just noted from fglrx At the end of /etc/X11/xorg.conf, add this section (This allows all users to access the direct rendering mode - without it, you can't use acceleration as a user): Section "DRI" Mode 0666 EndSection Restart the X server ===Final Check=== To check that fglrx has been installed and setup correctly, run 'fglrxinfo' in a terminal under X. It should return something like: display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: MOBILITY RADEON X700 Generic OpenGL version string: 2.0.5642 (8.22.5) (The 'renderer' string will vary depending on the chip your card actually has). ===Uninstalling the driver=== With root permissions, run: sh /usr/share/fglrx/fglrx-uninstall.sh f0118afe0a67a801f8005916b6e4e0249d8729fb 3174 3170 2018-10-13T02:46:43Z Phorneker 604 /* Notes */ Updated information for configuring the R600 chipset to work with X11. wikitext text/x-wiki [[Category:Hardware]] ===Introduction=== ATI drivers come in two flavours: 1) X.Org open source 'radeon' driver - full support (accelerated 2D and 3D) for the Radeon 9200 and earlier. (Also supported for the 9200 - X850 for Slackware -current, or any Slackware newer than 11.0) 2) ATI's proprietary closed source 'fglrx' driver - support for the 9500 and above (all support for earlier cards has now been dropped). This is the only driver with any support, either 2D or 3D, for the X1xxx series of cards (R500 and newer). ====Kernel==== AGPGART: If you have an AGP card, you should ensure AGPGART and support for your specific GART are built in the kernel (built in or module is fine) PCI Express: If you have a PCI Express card, you should ensure PCI Express support is built in the kernel. ==Seting up the 'radeon' driver== ===Preparing Your System=== ====Kernel==== Direct Rendering Manager (DRM): Module or built in, plus the module under this for "ATI Radeon" ===Initial Setup=== Edit /etc/X11/xorg.conf In Section "Module" add: Load "glx" Load "dri" At the end of the file, add Section "DRI" Mode 0666 EndSection (Or use 'Xorg -configure' to generate a new xorg.conf to autodetect the ATi card) ===Tweaking=== To increase performance for Radeon users (in particular, R300 and R400), you may also want to add the following under the "Device" section for the radeon: ====AGP users==== Option "AGPMode" "8" # Modify accordingly if you don't have an AGP 8x card Option "AGPFastWrite" "true" # This one has big warnings all over it, so test it first! ====Mobility card users==== Option "DynamicClocks" "true" # The equivalent of ATi's PowerPlay Option "BIOSHotkeys" "true" # You _might_ need this for some special function keys on your laptop ====All users==== Option "EnablePageFlip" "true" Option "ColorTiling" "true" ===Final Check=== Run 'glxinfo | grep render'. It will return something like the following (the last line will vary depending on R300/ R400, PCI/ PCIE or AGP, etc). The important thing is that this reports "direct rendering: yes". direct rendering: Yes OpenGL renderer string: Mesa DRI R300 20060815 AGP 8x x86/MMX+/3DNow!+/SSE TCL ===Notes=== '''R300 - R400:''' Please note that these cards do not have accelerated hardware support in X.Org < 6.9 (i.e. Slackware 11.0 or older) '''R500 (X1xxx and above)''' Sorry, there is no open source accelerated support in X for these cards. Either use fglrx or vesa. '''R600''' For the ATI Radeon Mobility 2600 (the built in video on the HP Compaq 8510p), the '''ati''' driver can be used for accelerated support. The amdgpu driver will not work with this video board. Though the fglrx driver can be used with this video board, it is not necessary to install the proprietary driver to get this video board working. Upcoming releases of Slackware will have '''ati''' driver instead of '''radeon''', so /etc/X11/xorg.conf will have to be updated accordingly as you upgrade Slackware to the latest release. ==Setting up the 'fglrx' driver== ===Preparing Your System=== ====Libraries==== The fglrx driver requires that you have the package cxxlibs installed on your system to build it. '''(Slamd64)''': You will also need the 32 bit compatibility libraries from c/ ====Kernel==== Direct Rendering Manager (DRM): Must *not* be built into the kernel - it should be a module (and not loaded) or not built. Frame Buffer: Must *not* be built into the kernel - it should be a module or not built (it is not compatible with the current fglrx drivers). ===Installing the Driver=== You will need to download the 'ATI Driver Installer' package (the RPM packages do not have support for X.Org 6.9). Once you have downloaded the installer, run it (I reccommend using sudo, as you need root permissions but also need access to the X server. You could use xhost+ and then su, but this is not safe). sudo sh ati-driver-installer-$VERSION-$ARCH.run You need to select the 'Install driver' (the ATI installer cannot generate a Slackware package), and then it is reccommended you choose "automatic" on the next screen. The driver will now install itself. Make sure that you mount tmpfs for 3D acceleration, or you can get unexpected results. ie: 'FGLTexMgr: open of shared memory object failed (Function not implemented) __FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!! fglX11AllocateManagedSurface: __FGLTexMgrCreateObject failed!!' Add the following to /etc/fstab: tmpfs /dev/shm tmpfs defaults 0 0 then 'mount /dev/shm' on a console ===Patching the Driver=== If you are running the latest kernel, more often than not you will need to patch the fglrx driver. At the very least, you will need to manually rebuild it if you change your kernel - follow instruction 1 if necessary, then 2 and 3. There is no central repository of these, so it is not possible to point you to a specific place to check for them (although the [http://ati.cchtml.com Unofficial ATI Bugzilla] or [http://www.rage3d.com/board/forumdisplay.php?f=88 Rage3D Linux Drivers forum] are good places to check). Once you have downloaded the patches: 1. Apply them in /lib/modules/fglrx (or /lib/modules/fglrx/build_mod) cd /lib/modules/fglrx/build_mod cat somepatch.diff | patch -p1 2. Rebuild the fglrx module sh /lib/modules/fglrx/build_mod/make.sh N.B. Modules built are kernel specific - you can only build a module for the kernel you are currently running. 3. Install the module sh /lib/modules/fglrx/make_install.sh ===Configuring the X server=== If you have not installed the fglrx driver before, run: aticonfig --initial --input=/etc/X11/xorg.conf aticonfig --ovt=Xv This will add an fglrx 'Section "Device"' to /etc/X11/xorg.conf and enable video overlay (enables video playback) Edit /etc/X11/xorg.conf (you need to do this with root permissions) Find: 1) A 'Section "Device"' that contains fglrx 2) 'Section "Screen"' Then: 1) Under the Section "Device" that contains fglrx<br /> 1A). Make a note of the value of "Indentifier"<br /> 2) Under Section "Screen", replace the value of "Device" with the value you just noted from fglrx At the end of /etc/X11/xorg.conf, add this section (This allows all users to access the direct rendering mode - without it, you can't use acceleration as a user): Section "DRI" Mode 0666 EndSection Restart the X server ===Final Check=== To check that fglrx has been installed and setup correctly, run 'fglrxinfo' in a terminal under X. It should return something like: display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: MOBILITY RADEON X700 Generic OpenGL version string: 2.0.5642 (8.22.5) (The 'renderer' string will vary depending on the chip your card actually has). ===Uninstalling the driver=== With root permissions, run: sh /usr/share/fglrx/fglrx-uninstall.sh fb9502aff8b83c8fdbefac43e6a963ff87f429ec 3175 3174 2018-10-13T02:49:34Z Phorneker 604 /* Notes */ wikitext text/x-wiki [[Category:Hardware]] ===Introduction=== ATI drivers come in two flavours: 1) X.Org open source 'radeon' driver - full support (accelerated 2D and 3D) for the Radeon 9200 and earlier. (Also supported for the 9200 - X850 for Slackware -current, or any Slackware newer than 11.0) 2) ATI's proprietary closed source 'fglrx' driver - support for the 9500 and above (all support for earlier cards has now been dropped). This is the only driver with any support, either 2D or 3D, for the X1xxx series of cards (R500 and newer). ====Kernel==== AGPGART: If you have an AGP card, you should ensure AGPGART and support for your specific GART are built in the kernel (built in or module is fine) PCI Express: If you have a PCI Express card, you should ensure PCI Express support is built in the kernel. ==Seting up the 'radeon' driver== ===Preparing Your System=== ====Kernel==== Direct Rendering Manager (DRM): Module or built in, plus the module under this for "ATI Radeon" ===Initial Setup=== Edit /etc/X11/xorg.conf In Section "Module" add: Load "glx" Load "dri" At the end of the file, add Section "DRI" Mode 0666 EndSection (Or use 'Xorg -configure' to generate a new xorg.conf to autodetect the ATi card) ===Tweaking=== To increase performance for Radeon users (in particular, R300 and R400), you may also want to add the following under the "Device" section for the radeon: ====AGP users==== Option "AGPMode" "8" # Modify accordingly if you don't have an AGP 8x card Option "AGPFastWrite" "true" # This one has big warnings all over it, so test it first! ====Mobility card users==== Option "DynamicClocks" "true" # The equivalent of ATi's PowerPlay Option "BIOSHotkeys" "true" # You _might_ need this for some special function keys on your laptop ====All users==== Option "EnablePageFlip" "true" Option "ColorTiling" "true" ===Final Check=== Run 'glxinfo | grep render'. It will return something like the following (the last line will vary depending on R300/ R400, PCI/ PCIE or AGP, etc). The important thing is that this reports "direct rendering: yes". direct rendering: Yes OpenGL renderer string: Mesa DRI R300 20060815 AGP 8x x86/MMX+/3DNow!+/SSE TCL ===Notes=== '''R300 - R400:''' Please note that these cards do not have accelerated hardware support in X.Org < 6.9 (i.e. Slackware 11.0 or older) '''R500 (X1xxx and above)''' Sorry, there is no open source accelerated support in X for these cards. Either use fglrx or vesa. '''R600''' For the ATI Radeon Mobility 2600 (the built in video on the HP Compaq 8510p), the '''ati''' driver can be used for accelerated support. The amdgpu driver will not work with this video board. Though the fglrx driver can be used with this video board, it is not necessary to install the proprietary driver to get this video board working. Upcoming releases of Slackware will have '''ati''' driver instead of '''radeon''', so /etc/X11/xorg.conf will have to be updated accordingly as you upgrade Slackware to the latest release. Fortunately, Slackware 14.2 (stable) configures this chipset correctly for the ATi Radeon Mobility 2600. The change is necessary only if you are running '''current''', or whenever Slackware 15.x is released. ==Setting up the 'fglrx' driver== ===Preparing Your System=== ====Libraries==== The fglrx driver requires that you have the package cxxlibs installed on your system to build it. '''(Slamd64)''': You will also need the 32 bit compatibility libraries from c/ ====Kernel==== Direct Rendering Manager (DRM): Must *not* be built into the kernel - it should be a module (and not loaded) or not built. Frame Buffer: Must *not* be built into the kernel - it should be a module or not built (it is not compatible with the current fglrx drivers). ===Installing the Driver=== You will need to download the 'ATI Driver Installer' package (the RPM packages do not have support for X.Org 6.9). Once you have downloaded the installer, run it (I reccommend using sudo, as you need root permissions but also need access to the X server. You could use xhost+ and then su, but this is not safe). sudo sh ati-driver-installer-$VERSION-$ARCH.run You need to select the 'Install driver' (the ATI installer cannot generate a Slackware package), and then it is reccommended you choose "automatic" on the next screen. The driver will now install itself. Make sure that you mount tmpfs for 3D acceleration, or you can get unexpected results. ie: 'FGLTexMgr: open of shared memory object failed (Function not implemented) __FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!! fglX11AllocateManagedSurface: __FGLTexMgrCreateObject failed!!' Add the following to /etc/fstab: tmpfs /dev/shm tmpfs defaults 0 0 then 'mount /dev/shm' on a console ===Patching the Driver=== If you are running the latest kernel, more often than not you will need to patch the fglrx driver. At the very least, you will need to manually rebuild it if you change your kernel - follow instruction 1 if necessary, then 2 and 3. There is no central repository of these, so it is not possible to point you to a specific place to check for them (although the [http://ati.cchtml.com Unofficial ATI Bugzilla] or [http://www.rage3d.com/board/forumdisplay.php?f=88 Rage3D Linux Drivers forum] are good places to check). Once you have downloaded the patches: 1. Apply them in /lib/modules/fglrx (or /lib/modules/fglrx/build_mod) cd /lib/modules/fglrx/build_mod cat somepatch.diff | patch -p1 2. Rebuild the fglrx module sh /lib/modules/fglrx/build_mod/make.sh N.B. Modules built are kernel specific - you can only build a module for the kernel you are currently running. 3. Install the module sh /lib/modules/fglrx/make_install.sh ===Configuring the X server=== If you have not installed the fglrx driver before, run: aticonfig --initial --input=/etc/X11/xorg.conf aticonfig --ovt=Xv This will add an fglrx 'Section "Device"' to /etc/X11/xorg.conf and enable video overlay (enables video playback) Edit /etc/X11/xorg.conf (you need to do this with root permissions) Find: 1) A 'Section "Device"' that contains fglrx 2) 'Section "Screen"' Then: 1) Under the Section "Device" that contains fglrx<br /> 1A). Make a note of the value of "Indentifier"<br /> 2) Under Section "Screen", replace the value of "Device" with the value you just noted from fglrx At the end of /etc/X11/xorg.conf, add this section (This allows all users to access the direct rendering mode - without it, you can't use acceleration as a user): Section "DRI" Mode 0666 EndSection Restart the X server ===Final Check=== To check that fglrx has been installed and setup correctly, run 'fglrxinfo' in a terminal under X. It should return something like: display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: MOBILITY RADEON X700 Generic OpenGL version string: 2.0.5642 (8.22.5) (The 'renderer' string will vary depending on the chip your card actually has). ===Uninstalling the driver=== With root permissions, run: sh /usr/share/fglrx/fglrx-uninstall.sh dd61b65a6b283823bec5d13d0aed7002b4b5a278 Bash Autocompletion 0 41 3171 62 2018-06-04T06:02:38Z Cwilling 606 Recent bash-completion packages now have system files in /usr/share/bash-completion (not /etc as previously). wikitext text/x-wiki [[Category:Tips]] Did you know that Bash has a really powerful autocompletion system, which can and usually will make your life easier? If you have used ZSH, you probably know what I'm talking about. For example, you can type svn co''<TAB><TAB>'' and bash will attempt to auto complete as it does normally with paths and variables, but instead it will output: ismael@damned_02:~/src/chkout$ svn co''<TAB><TAB>'' co commit copy ismael@damned_02:~/src/chkout$ svn co Then you can type: ismael@damned_02:~/src/chkout$ svn com''<TAB>'' and BASH will auto complete to: ismael@damned_02:~/src/chkout$ svn commit Or if you're running as root and want to get rid of that *$@& module wich keeps crashing your machine: root@damned_02:~# rmmod n''<TAB>'' root@damned_02:~# rmmod nvidia If you think all that is neat, all that you have to do to enable this kind of auto completion in Slackware is to install the bash-completion package, which can be found under [http://slackware.osuosl.org/slackware-11.0/extra/bash-completion/bash-completion-20060301-noarch-1.tgz /extra]: root@damned_02:~# mount /mnt/cdrom root@damned_02:~# installpkg /mnt/cdrom/extra/bash-completion/bash-completion-20060301-noarch-1.tgz ... (BTW, bash-completion also autocompletes ''installpkg, upgradepkg'' and ''removepkg'' with .tgz files and installed packages for ''removepkg''. It can also fill mount commands with data from fstab). Then you can just logout and login again or source /usr/share/bash-completion/bash_completion and ''voila''! You can see which commands have autocompletion by issuing: complete -p | sed -e's/.* \([^ ]\+\)/\1/' | sort | less You can also add your own commands at /etc/bash_completion.d/ You may want to see the available completions to understand how they work. For your own personal user account you can edit your ~/.bash_completion file. Here is a sample BASH completion function I made to give the script 'test' 3 completion options: <pre> _test () { local cur cur=${COMP_WORDS[COMP_CWORD]} if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-option -test -foobar' -- $cur )) else _filedir fi } complete -F _test test </pre> I put that into my ~/.bash_completion file and now $ test -<tab> -foobar -option -test brings up those three options (-option,-test and -foobar). You have to reload your terminal first to see the changes or re-source /etc/bash_completion $ . /usr/share/bash-compoletion/bash_completion or just re-source your ~/.bash_completion $ . ./.bash_completion 378bc78148839e573ec1e31a583f247f8a9d5214 3172 3171 2018-06-04T06:04:49Z Cwilling 606 typo wikitext text/x-wiki [[Category:Tips]] Did you know that Bash has a really powerful autocompletion system, which can and usually will make your life easier? If you have used ZSH, you probably know what I'm talking about. For example, you can type svn co''<TAB><TAB>'' and bash will attempt to auto complete as it does normally with paths and variables, but instead it will output: ismael@damned_02:~/src/chkout$ svn co''<TAB><TAB>'' co commit copy ismael@damned_02:~/src/chkout$ svn co Then you can type: ismael@damned_02:~/src/chkout$ svn com''<TAB>'' and BASH will auto complete to: ismael@damned_02:~/src/chkout$ svn commit Or if you're running as root and want to get rid of that *$@& module wich keeps crashing your machine: root@damned_02:~# rmmod n''<TAB>'' root@damned_02:~# rmmod nvidia If you think all that is neat, all that you have to do to enable this kind of auto completion in Slackware is to install the bash-completion package, which can be found under [http://slackware.osuosl.org/slackware-11.0/extra/bash-completion/bash-completion-20060301-noarch-1.tgz /extra]: root@damned_02:~# mount /mnt/cdrom root@damned_02:~# installpkg /mnt/cdrom/extra/bash-completion/bash-completion-20060301-noarch-1.tgz ... (BTW, bash-completion also autocompletes ''installpkg, upgradepkg'' and ''removepkg'' with .tgz files and installed packages for ''removepkg''. It can also fill mount commands with data from fstab). Then you can just logout and login again or source /usr/share/bash-completion/bash_completion and ''voila''! You can see which commands have autocompletion by issuing: complete -p | sed -e's/.* \([^ ]\+\)/\1/' | sort | less You can also add your own commands at /etc/bash_completion.d/ You may want to see the available completions to understand how they work. For your own personal user account you can edit your ~/.bash_completion file. Here is a sample BASH completion function I made to give the script 'test' 3 completion options: <pre> _test () { local cur cur=${COMP_WORDS[COMP_CWORD]} if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-option -test -foobar' -- $cur )) else _filedir fi } complete -F _test test </pre> I put that into my ~/.bash_completion file and now $ test -<tab> -foobar -option -test brings up those three options (-option,-test and -foobar). You have to reload your terminal first to see the changes or re-source /etc/bash_completion $ . /usr/share/bash-completion/bash_completion or just re-source your ~/.bash_completion $ . ./.bash_completion dc970308415afe4913f56d10b9581d47fa5c3d84 Install Slackware Using A USB Flash Drive 0 233 3177 843 2018-10-27T19:19:44Z Wigums 609 wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. The following command will overwrite all the files currently present on the USB drive so prior backups are highly advisable: dd if=slackware-13.1-install-dvd.iso of=/dev/sdX PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. Before running '''setup''', look up (with '''fdisk -l''') which device your USB drive is. When installing, choose "Install from a Slackware CD or DVD". Then select the "manual" option, then the "custom" option. Enter /dev/sdX1 (as shown by "fdisk -l") and installation will proceed as when installing from a DVD. == Install with Unetbootin == It is possible to install with unetbootin. Download the Slackware iso image of your choice and then install to a USB drive using unetbootin. Tutorials for unetbootin are everywhere. Then, when you get to the SOURCE option in setup use the drive you are installing slackware from (usually it is /dev/sdb1). When it asks where the packages are, enter /slackware for 32 bit or /slackware64 for 64 bit. This was tested using the Slackware 14.0 64-bit x86_64 iso. 4607e08f44001c2df9a9d18ed3b33dcd2a63bbaf 3178 3177 2018-10-27T19:36:39Z Wigums 609 /* Copy the ISO to the USB flash drive */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Syslinux >= 3.72 Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. to identify the designation of your usb stick/drive use fdisk -l dd will write the iso to whatever drive you tell it to so make double sure you have the right drive designation in the following command The following command will overwrite all the files currently present on the USB drive with a bootable iso dd if=slackware-14.2-install-dvd.iso of=/path/to/usb (example of=/dev/sdX) PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. Before running '''setup''', look up (with '''fdisk -l''') which device your USB drive is. When installing, choose "Install from a Slackware CD or DVD". Then select the "manual" option, then the "custom" option. Enter /dev/sdX1 (as shown by "fdisk -l") and installation will proceed as when installing from a DVD. == Install with Unetbootin == It is possible to install with unetbootin. Download the Slackware iso image of your choice and then install to a USB drive using unetbootin. Tutorials for unetbootin are everywhere. Then, when you get to the SOURCE option in setup use the drive you are installing slackware from (usually it is /dev/sdb1). When it asks where the packages are, enter /slackware for 32 bit or /slackware64 for 64 bit. This was tested using the Slackware 14.0 64-bit x86_64 iso. a3f2babee8c25bac5b80d38e7dbe04536e7d8da9 3179 3178 2018-10-27T19:37:57Z Wigums 609 /* Prerequisites */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO one, available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. to identify the designation of your usb stick/drive use fdisk -l dd will write the iso to whatever drive you tell it to so make double sure you have the right drive designation in the following command The following command will overwrite all the files currently present on the USB drive with a bootable iso dd if=slackware-14.2-install-dvd.iso of=/path/to/usb (example of=/dev/sdX) PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. Before running '''setup''', look up (with '''fdisk -l''') which device your USB drive is. When installing, choose "Install from a Slackware CD or DVD". Then select the "manual" option, then the "custom" option. Enter /dev/sdX1 (as shown by "fdisk -l") and installation will proceed as when installing from a DVD. == Install with Unetbootin == It is possible to install with unetbootin. Download the Slackware iso image of your choice and then install to a USB drive using unetbootin. Tutorials for unetbootin are everywhere. Then, when you get to the SOURCE option in setup use the drive you are installing slackware from (usually it is /dev/sdb1). When it asks where the packages are, enter /slackware for 32 bit or /slackware64 for 64 bit. This was tested using the Slackware 14.0 64-bit x86_64 iso. 6a15d1fdd01393fb956389c4d1673446a5d9abab 3180 3179 2018-10-27T19:39:05Z Wigums 609 /* Prerequisites */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. to identify the designation of your usb stick/drive use fdisk -l dd will write the iso to whatever drive you tell it to so make double sure you have the right drive designation in the following command The following command will overwrite all the files currently present on the USB drive with a bootable iso dd if=slackware-14.2-install-dvd.iso of=/path/to/usb (example of=/dev/sdX) PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. Before running '''setup''', look up (with '''fdisk -l''') which device your USB drive is. When installing, choose "Install from a Slackware CD or DVD". Then select the "manual" option, then the "custom" option. Enter /dev/sdX1 (as shown by "fdisk -l") and installation will proceed as when installing from a DVD. == Install with Unetbootin == It is possible to install with unetbootin. Download the Slackware iso image of your choice and then install to a USB drive using unetbootin. Tutorials for unetbootin are everywhere. Then, when you get to the SOURCE option in setup use the drive you are installing slackware from (usually it is /dev/sdb1). When it asks where the packages are, enter /slackware for 32 bit or /slackware64 for 64 bit. This was tested using the Slackware 14.0 64-bit x86_64 iso. 07327f2597ca2391d67201f83eed4f151a6180e6 3181 3180 2018-10-27T19:39:48Z Wigums 609 /* Prerequisites */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image (4GB or larger) Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. to identify the designation of your usb stick/drive use fdisk -l dd will write the iso to whatever drive you tell it to so make double sure you have the right drive designation in the following command The following command will overwrite all the files currently present on the USB drive with a bootable iso dd if=slackware-14.2-install-dvd.iso of=/path/to/usb (example of=/dev/sdX) PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. Before running '''setup''', look up (with '''fdisk -l''') which device your USB drive is. When installing, choose "Install from a Slackware CD or DVD". Then select the "manual" option, then the "custom" option. Enter /dev/sdX1 (as shown by "fdisk -l") and installation will proceed as when installing from a DVD. == Install with Unetbootin == It is possible to install with unetbootin. Download the Slackware iso image of your choice and then install to a USB drive using unetbootin. Tutorials for unetbootin are everywhere. Then, when you get to the SOURCE option in setup use the drive you are installing slackware from (usually it is /dev/sdb1). When it asks where the packages are, enter /slackware for 32 bit or /slackware64 for 64 bit. This was tested using the Slackware 14.0 64-bit x86_64 iso. 5e154d3a6397361a8f2cd2683589abedd6352283 3182 3181 2018-10-27T19:44:17Z Wigums 609 /* Copy the ISO to the USB flash drive */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image (4GB or larger) Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. to identify the designation of your usb stick/drive use fdisk -l dd will write the iso to whatever drive you tell it to so make double sure you have the right drive designation in the following command The following command will overwrite all the files currently present on the USB drive with a bootable iso dd if=/path/to/iso of=/path/to/usb (example of=/dev/sdX) PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. Before running '''setup''', look up (with '''fdisk -l''') which device your USB drive is. When installing, choose "Install from a Slackware CD or DVD". Then select the "manual" option, then the "custom" option. Enter /dev/sdX1 (as shown by "fdisk -l") and installation will proceed as when installing from a DVD. == Install with Unetbootin == It is possible to install with unetbootin. Download the Slackware iso image of your choice and then install to a USB drive using unetbootin. Tutorials for unetbootin are everywhere. Then, when you get to the SOURCE option in setup use the drive you are installing slackware from (usually it is /dev/sdb1). When it asks where the packages are, enter /slackware for 32 bit or /slackware64 for 64 bit. This was tested using the Slackware 14.0 64-bit x86_64 iso. 16ac079eb369046d15ed83f35722d57969b93a5a 3183 3182 2018-10-27T21:47:22Z Wigums 609 /* Installation */ wikitext text/x-wiki [[Category:Tutorials]] Installing Slackware using a USB flash drive is very easy. Slackware includes a usbboot.img in the usb-and-pxe-installers directory of the official installation media, which is a minimal image very handy for FTP or other kinds of network installations. In the same directory one can also find usbimg2disk.sh, a script that will dump the usbboot.img image to a flash drive, useful in case the above image does not work for you out of the box. Additionally, AlienBOB has written two articles in his blog on how to install Slackware using a USB flash drive from either [http://alien.slackbook.org/blog/welcome-windows-user/ Microsoft Windows] or [http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/ Linux]. This document describes yet another way of creating an image capable of booting from USB, containing all of the packages neeeded for an installation, using [http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE Isohybrid]. == Prerequisites == A USB flash drive that can fit the ISO image (4GB or larger) Additionally you should either have: a) official Slackware installation media, preferably the DVD ISO available on any Slackware mirror or b) a local copy of the Slackware tree. That may be the tree of a stable release, or even the tree of the Slackware current development cycle. If you choose to use a local copy of the tree you should be able to create your own ISO image using a script such as: Pat's [http://slackware.osuosl.org/slackware/isolinux/README.TXT DVD script], AlienBOB's [http://www.slackware.com/~alien/tools/mirror-slackware-current.sh mirror-slackware-current script] or even a custom one of your own. == Copy the ISO to the USB flash drive == All that is left to do now is copy the ISO to the USB flash drive. This can be done using the [http://linux.die.net/man/1/dd dd] command as the root user. to identify the designation of your usb stick/drive use fdisk -l dd will write the iso to whatever drive you tell it to so make double sure you have the right drive designation in the following command The following command will overwrite all the files currently present on the USB drive with a bootable iso dd if=/path/to/iso of=/path/to/usb (example of=/dev/sdX) PS1. dd expects the name of a device, not a partition, so you should use eg. /dev/sdb instead of /dev/sdb1. PS2. the USB drive should NOT be mounted during dd invocation. == Installation == Boot the machine using the USB drive. When installing, choose "Install from a slackware USB stick". follow the steps. setup your keyboard add swap space (if used) and select your target drive. when selecting source select Install from a Slackware USB stick and follow the prompts == Install with Unetbootin == It is possible to install with unetbootin. Download the Slackware iso image of your choice and then install to a USB drive using unetbootin. Tutorials for unetbootin are everywhere. Then, when you get to the SOURCE option in setup use the drive you are installing slackware from (usually it is /dev/sdb1). When it asks where the packages are, enter /slackware for 32 bit or /slackware64 for 64 bit. This was tested using the Slackware 14.0 64-bit x86_64 iso. 7df30ee8fbccec751de349097fa31a07eebfb004 Third Party Package Managers 0 170 3184 659 2018-10-28T00:22:22Z Wigums 609 /* swaret */ wikitext text/x-wiki = Purpose = The mere mention of third party package managers (such as [http://software.jaos.org/#slapt-get slapt-get] and [http://swaret.sourceforge.net/ swaret]) often results in a quick admonishment from Slackware users, and unfortunately, the only reason given in most cases is something along the lines of "they'll break your system." This leaves users in a state of confusion, as the respective web sites of these third party tools tout them as an improvement. The purpose of this page is to explain why and how these tools will often result in system breakage. = Overview of Slackware's Native Package Tools = Slackware's native package management utilities (<tt>pkgtool(8)</tt>, <tt>installpkg(8)</tt>, <tt>removepkg(8)</tt>, and <tt>upgradepkg(8)</tt>) do not support any form of dependency checking. A Slackware package is essentially a compressed tarball of the files associated with an application, a file containing a short description of the application (<tt>./install/slack-desc</tt>), and a script that performs some essential post-installation tasks (<tt>./install/doinst.sh</tt>). Installing a Slackware package simply copies those files to the filesystem and then executes the post-install script, while removing the package removes the files and reverses the post-install script. As result, there is no guarantee that libraries and other files needed by a particular package are already present on the system when that particular package is installed. = Overview of Selected Third Party Tools = As stated above, Slackware's native package management suite neither has nor supports dependency resolution. Because the third-party add-ons all use Slackware's native package tools, they are bound by this same limitation, at least to some extent, but some of them try to mitigate this in various ways; the following is an overview. == swaret == no longer a viable package management solution == slapt-get == === Overview === Slapt-get makes use of additional files (<tt>slack-required</tt>, <tt>slack-suggests</tt>, <tt>slack-conflicts</tt>) inside a Slackware package. Essentially, if a package is listed in <tt>slack-required</tt>, then slapt-get will install or upgrade it first; if a package is listed in <tt>slack-conflicts</tt>, then slapt-get will remove it first; if a package is listed in <tt>slack-suggests</tt>, then slapt-get will offer to install it in addition to the packages noted in <tt>slack-required</tt>. === Potential Problems === Since official Slackware packages do not have the <tt>slack-required</tt> and other files needed for slapt-get to determine dependencies, it is not able to resolve dependencies for them. Therefore, slapt-get's perceived usefulness is in keeping unofficial third-party packages (or at least those which do contain the necessary files) up to date. See the discussion below for more information on unofficial third-party packages. Also, slapt-get, like swaret, will not "downgrade" a package to a previous version if it occurs in the upstream Slackware tree. == sbopkg == === Overview === [http://www.sbopkg.org/ SBopkg] is a tool for automating the download, compile and package build for SBo projects hosted in the [http://www.slackbuilds.org SlackBuilds.org ] repository. SBo packages are reviewed by team members for completeness as well as applicability to each Slackware release. SBo package documentation includes information regarding dependencies. = Third Party (Unofficial) Packages = This subject can elicit opinions just as strong as the topic of third-party package managers, and there are knowledgeable people on both sides of the issue. Third party packages can obviously present a security risk, as there's no way to know what's really in them, but for the average user, there are (amazingly enough) bigger concerns. On one hand, the user wants a package of some application that's not included with Slackware, but he doesn't want it to create other problems. Oftentimes, third party packages are not built on "clean" systems -- that is, the computer on which they're built has quite a few other non-official packages installed -- so the resulting package needs those other things to work properly. If the packager doesn't make note of all the different packages that this one depends on, the user installs it only to find that it still doesn't work. Even worse, those other dependencies are often not even necessary if the package is built on a clean system - if the other package had not been present, the new one obviously wouldn't have linked against it. Installing third party packages from two different packagers can cause problems. Package A might depend on Package B, which depends on Package C and optionally Package D. If the person who built Package B only linked it against Package C (not D), but the Package A expects Package B to have both Package C and Package D dependencies, then Package A may not work, even though you (think you) have everything it needs installed. Another frequent problem with third party packages is encountered by replacing stock (official) packages with unofficial ones. In addition to the library version issues mentioned in the swaret discussion, newer package versions often require newer versions of other packages, which might require newer versions of still other packages, and before you know it, you have replaced a sizable portion of the official Slackware packages. If/when something breaks, you will find it very difficult to find someone willing to help you, as there's no way to know how much effect the unofficial packages are having. = Slackware -current = Slackware -current is *not* a stable release of Slackware. It is intended for advanced users who are familiar with how Slackware works to test (and report success/failure, find and fix bugs, etcetera) the new packages leading to the next stable release of Slackware. Packages are constantly being added, removed, split up, merged, and otherwise mangled, and third party package managers (swaret/slapt-get/et al) should not be expected to know how to deal with this. If you use one of those tools while trying to run Slackware -current and you don't understand how they work and their limitations, you *will* break your system and you will *not* have much luck finding someone who is sympathetic. You have been warned. You may be wondering why these tools have trouble with -current. I won't even attempt to detail all of the potential issues, but here are a couple: 1. When upgrading to -current with one of these tools, the package sets are upgraded in alphabetical order (and the packages therein also in alphabetical order). This means that a/bash will be upgraded before a/glibc-solibs. If bash has been recompiled against newer glibc, and you upgrade to that new version, it will promptly stop working due to the fact that the needed version of glibc has not been upgraded yet; at that point, you are stuck with a "chicken and egg" problem. 2. Third party package tools will not install *new* packages that have been added in Slackware -current. This is not a bug - it's a feature; if you purposefully didn't install something, then you don't want your automatic package updater reinstalling it. However, when a package depends on something else that has been added or split out of an existing package, and your add-on package manager upgrades the existing package but doesn't install the added one, then the (upgraded) existing package will not work any more. = Solutions and Suggestions = For upgrading to Slackware -current, there is only *one* supported method: <tt>UPGRADE.TXT</tt> -- you can find this file on any Slackware mirror. Note that this is also the only supported method to upgrade from one stable release of Slackware to another. For keeping up to date on post-release patches added to a stable release of Slackware, you will *usually* be okay to use one of the third party package managers. You should still read the <tt>ChangeLog.txt</tt> before doing any upgrades, though, as new packages are occasionally added in /patches when circumstances require it. For software not included in official Slackware, consider building it yourself or using a SlackBuild script from one of the projects which provides them. One of the regular Slackware contributors, PiterPUNK, wrote and maintains a third-party package manager that minimizes all of the risks mentioned above. [http://slackpkg.org Slackpkg] does not support downloading or installing unofficial packages, and it has provisions to install any added packages and uninstall any removed packages as well as the normal install/upgrade/remove routines. Another third party package manager that promotes good practices is [http://slackroll.sourceforge.net/ SlackRoll] (see [[SlackRoll Tutorial|tutorial]]). Its philosophy is similar to that of Slackpkg but it is not included as part of Slackware. Programmed in Python, it is faster, has more features and detects more events from Slackware -current. However, the initial setup and workflow are a bit more complex. = See Also = * <tt>pkgtool(8)</tt> -- man 8 pkgtool * <tt>installpkg(8)</tt> -- man 8 installpkg * <tt>removepkg(8)</tt> -- man 8 removepkg * <tt>upgradepkg(8)</tt> -- man 8 upgradepkg * <tt>makepkg(8)</tt> -- man 8 makepkg * <tt>explodepkg(8)</tt> -- man 8 explodepkg = TODO = * Add links to other wiki pages that are related to this topic (add to "See Also" above) * Add hyperlinks to slapt-get, swaret, and other projects mentioned on this page * Others? [[Category:Information]] [[Category:Tutorials]] 21a63798668f6bcc5cc5e9bfd730e4972ed211c1 3185 3184 2018-10-28T00:45:38Z Wigums 609 wikitext text/x-wiki = Purpose = The mere mention of third party package managers (such as [http://software.jaos.org/#slapt-get slapt-get] and [http://swaret.sourceforge.net/ swaret]) often results in a quick admonishment from Slackware users, and unfortunately, the only reason given in most cases is something along the lines of "they'll break your system." This leaves users in a state of confusion, as the respective web sites of these third party tools tout them as an improvement. The purpose of this page is to explain why and how these tools will often result in system breakage. = Overview of Slackware's Native Package Tools = Slackware's native package management utilities (<tt>pkgtool(8)</tt>, <tt>installpkg(8)</tt>, <tt>removepkg(8)</tt>, and <tt>upgradepkg(8)</tt>) do not support any form of dependency checking. A Slackware package is essentially a compressed tarball of the files associated with an application, a file containing a short description of the application (<tt>./install/slack-desc</tt>), and a script that performs some essential post-installation tasks (<tt>./install/doinst.sh</tt>). Installing a Slackware package simply copies those files to the filesystem and then executes the post-install script, while removing the package removes the files and reverses the post-install script. As result, there is no guarantee that libraries and other files needed by a particular package are already present on the system when that particular package is installed. = Overview of Selected Third Party Tools = As stated above, Slackware's native package management suite neither has nor supports dependency resolution. Because the third-party add-ons all use Slackware's native package tools, they are bound by this same limitation, at least to some extent, but some of them try to mitigate this in various ways; the following is an overview. == swaret == no longer a viable package management solution == slapt-get == === Overview === Slapt-get makes use of additional files (<tt>slack-required</tt>, <tt>slack-suggests</tt>, <tt>slack-conflicts</tt>) inside a Slackware package. Essentially, if a package is listed in <tt>slack-required</tt>, then slapt-get will install or upgrade it first; if a package is listed in <tt>slack-conflicts</tt>, then slapt-get will remove it first; if a package is listed in <tt>slack-suggests</tt>, then slapt-get will offer to install it in addition to the packages noted in <tt>slack-required</tt>. === Potential Problems === Since official Slackware packages do not have the <tt>slack-required</tt> and other files needed for slapt-get to determine dependencies, it is not able to resolve dependencies for them. Therefore, slapt-get's perceived usefulness is in keeping unofficial third-party packages (or at least those which do contain the necessary files) up to date. See the discussion below for more information on unofficial third-party packages. Also, slapt-get, like swaret, will not "downgrade" a package to a previous version if it occurs in the upstream Slackware tree. == sbopkg == === Overview === [http://www.sbopkg.org/ SBopkg] is a tool for automating the download, compile and package build for SBo projects hosted in the [http://www.slackbuilds.org SlackBuilds.org ] repository. SBo packages are reviewed by team members for completeness as well as applicability to each Slackware release. SBo package documentation includes information regarding dependencies. == sbotools == === Overview === [https://pink-mist.github.io/sbotools/ sbotools] provides a ports-like interface to SlackBuilds.org. It consists of several commands, and a configuration file. It is written entirely in Perl and bundles a copy of the Sort::Versions module with itself for its own usage; this will not interfere with copies installed via the CPAN or SlackBuilds.org. = Third Party (Unofficial) Packages = This subject can elicit opinions just as strong as the topic of third-party package managers, and there are knowledgeable people on both sides of the issue. Third party packages can obviously present a security risk, as there's no way to know what's really in them, but for the average user, there are (amazingly enough) bigger concerns. On one hand, the user wants a package of some application that's not included with Slackware, but he doesn't want it to create other problems. Oftentimes, third party packages are not built on "clean" systems -- that is, the computer on which they're built has quite a few other non-official packages installed -- so the resulting package needs those other things to work properly. If the packager doesn't make note of all the different packages that this one depends on, the user installs it only to find that it still doesn't work. Even worse, those other dependencies are often not even necessary if the package is built on a clean system - if the other package had not been present, the new one obviously wouldn't have linked against it. Installing third party packages from two different packagers can cause problems. Package A might depend on Package B, which depends on Package C and optionally Package D. If the person who built Package B only linked it against Package C (not D), but the Package A expects Package B to have both Package C and Package D dependencies, then Package A may not work, even though you (think you) have everything it needs installed. Another frequent problem with third party packages is encountered by replacing stock (official) packages with unofficial ones. In addition to the library version issues mentioned in the swaret discussion, newer package versions often require newer versions of other packages, which might require newer versions of still other packages, and before you know it, you have replaced a sizable portion of the official Slackware packages. If/when something breaks, you will find it very difficult to find someone willing to help you, as there's no way to know how much effect the unofficial packages are having. = Slackware -current = Slackware -current is *not* a stable release of Slackware. It is intended for advanced users who are familiar with how Slackware works to test (and report success/failure, find and fix bugs, etcetera) the new packages leading to the next stable release of Slackware. Packages are constantly being added, removed, split up, merged, and otherwise mangled, and third party package managers (swaret/slapt-get/et al) should not be expected to know how to deal with this. If you use one of those tools while trying to run Slackware -current and you don't understand how they work and their limitations, you *will* break your system and you will *not* have much luck finding someone who is sympathetic. You have been warned. You may be wondering why these tools have trouble with -current. I won't even attempt to detail all of the potential issues, but here are a couple: 1. When upgrading to -current with one of these tools, the package sets are upgraded in alphabetical order (and the packages therein also in alphabetical order). This means that a/bash will be upgraded before a/glibc-solibs. If bash has been recompiled against newer glibc, and you upgrade to that new version, it will promptly stop working due to the fact that the needed version of glibc has not been upgraded yet; at that point, you are stuck with a "chicken and egg" problem. 2. Third party package tools will not install *new* packages that have been added in Slackware -current. This is not a bug - it's a feature; if you purposefully didn't install something, then you don't want your automatic package updater reinstalling it. However, when a package depends on something else that has been added or split out of an existing package, and your add-on package manager upgrades the existing package but doesn't install the added one, then the (upgraded) existing package will not work any more. = Solutions and Suggestions = For upgrading to Slackware -current, there is only *one* supported method: <tt>UPGRADE.TXT</tt> -- you can find this file on any Slackware mirror. Note that this is also the only supported method to upgrade from one stable release of Slackware to another. For keeping up to date on post-release patches added to a stable release of Slackware, you will *usually* be okay to use one of the third party package managers. You should still read the <tt>ChangeLog.txt</tt> before doing any upgrades, though, as new packages are occasionally added in /patches when circumstances require it. For software not included in official Slackware, consider building it yourself or using a SlackBuild script from one of the projects which provides them. One of the regular Slackware contributors, PiterPUNK, wrote and maintains a third-party package manager that minimizes all of the risks mentioned above. [http://slackpkg.org Slackpkg] does not support downloading or installing unofficial packages, and it has provisions to install any added packages and uninstall any removed packages as well as the normal install/upgrade/remove routines. Another third party package manager that promotes good practices is [http://slackroll.sourceforge.net/ SlackRoll] (see [[SlackRoll Tutorial|tutorial]]). Its philosophy is similar to that of Slackpkg but it is not included as part of Slackware. Programmed in Python, it is faster, has more features and detects more events from Slackware -current. However, the initial setup and workflow are a bit more complex. = See Also = * <tt>pkgtool(8)</tt> -- man 8 pkgtool * <tt>installpkg(8)</tt> -- man 8 installpkg * <tt>removepkg(8)</tt> -- man 8 removepkg * <tt>upgradepkg(8)</tt> -- man 8 upgradepkg * <tt>makepkg(8)</tt> -- man 8 makepkg * <tt>explodepkg(8)</tt> -- man 8 explodepkg = TODO = * Add links to other wiki pages that are related to this topic (add to "See Also" above) * Add hyperlinks to slapt-get, swaret, and other projects mentioned on this page * Others? [[Category:Information]] [[Category:Tutorials]] dc842fb2ec0f25c90d0d0f5e2fc4dbb5195ca29e Reinstalling Lilo 0 140 3186 166 2018-10-28T13:27:25Z Wigums 609 wikitext text/x-wiki this covers straight unencrypted installs. just a simple installation with everything installed under / mounted under /dev/sda1. No LVM or additional drives. if you're encrypted or have an otherwise fancy install this wiki expects that you understand the intricacies of your own system. for a more in depth look at how to chroot your installation media (which can be extremely useful for more that just lilo) see [https://docs.slackware.com/howtos:slackware_admin:how_to_chroot_from_media here] insert and boot your installation media login as root when prompted but do not run setup '''Mounting''' mount /dev/sda1 /mnt mount -o bind /dev /mnt/dev mount -o bind /proc /mnt/proc mount -o bind /sys /mnt/sys '''Chrooting''' Once the partition is mounted, we can chroot to it: chroot /mnt /bin/bash now simply run "liloconfig" and follow the prompts 01f81919a36c947981a9ba4c33b48175b1ebdbfa 3187 3186 2018-10-28T13:28:40Z Wigums 609 wikitext text/x-wiki this covers straight unencrypted installs. just a simple installation with everything installed under / mounted under /dev/sda1. No LVM or additional drives. if you're encrypted or have an otherwise fancy install this wiki expects that you understand the intricacies of your own system. for a more in depth look at how to chroot your installation media (which can be extremely useful for more that just lilo) see [https://docs.slackware.com/howtos:slackware_admin:how_to_chroot_from_media here] insert and boot your installation media login as root when prompted but do not run setup '''Mounting''' mount /dev/sda1 /mnt mount -o bind /dev /mnt/dev mount -o bind /proc /mnt/proc mount -o bind /sys /mnt/sys '''Chrooting''' Once everything is mounted, we can chroot to it: chroot /mnt /bin/bash now simply run "liloconfig" and follow the prompts c5d195ee09c490c667d9d6c98733c74fb4a91f79 3188 3187 2018-10-28T13:40:50Z Wigums 609 wikitext text/x-wiki this covers straight unencrypted installs. just a simple installation with everything installed under / mounted under /dev/sda1. No LVM or additional drives. if you're encrypted or have an otherwise fancy install this wiki expects that you understand the intricacies of your own system. for a more in depth look at how to chroot your installation media (which can be extremely useful for more that just lilo) see [https://docs.slackware.com/howtos:slackware_admin:how_to_chroot_from_media here] insert and boot your installation media login as root when prompted but do not run setup '''Mounting''' mount /dev/sdX1 /mnt mount -o bind /dev /mnt/dev mount -o bind /proc /mnt/proc mount -o bind /sys /mnt/sys '''Chrooting''' Once everything is mounted, we can chroot to it: chroot /mnt /bin/bash now simply run "liloconfig" and follow the prompts c9b2a98ff28d257c19f7a01c0a929ec2a4b49b8f 3189 3188 2018-10-28T13:41:59Z Wigums 609 wikitext text/x-wiki this covers straight unencrypted installs. just a simple installation with everything installed under / mounted under /dev/sda1. No LVM or additional drives. if you're encrypted or have an otherwise fancy install this wiki expects that you understand the intricacies of your own system. for a more in depth look at how to chroot your installation media (which can be extremely useful for more that just lilo) see [https://docs.slackware.com/howtos:slackware_admin:how_to_chroot_from_media here] insert and boot your installation media login as root when prompted but do not run setup '''Mounting''' mount /dev/sdX1 /mnt (where /dev/sdx1 is your / partition) mount -o bind /dev /mnt/dev mount -o bind /proc /mnt/proc mount -o bind /sys /mnt/sys '''Chrooting''' Once everything is mounted, we can chroot to it: chroot /mnt /bin/bash now simply run "liloconfig" and follow the prompts 9d6f052724ad8c5d0f918ab088a3cb3988720511 3190 3189 2018-10-28T13:45:00Z Wigums 609 wikitext text/x-wiki this covers straight unencrypted installs. just a simple installation with everything installed under / mounted under /dev/sda1. No LVM or additional drives. if you're encrypted or have an otherwise fancy install this wiki expects that you understand the intricacies of your own system. for a more in depth look at how to chroot your installation media (which can be extremely useful for more that just lilo) see [https://docs.slackware.com/howtos:slackware_admin:how_to_chroot_from_media here] insert and boot your installation media login as root when prompted but do not run setup '''Mounting''' ''mount /dev/sdX1 /mnt'' (where /dev/sdx1 is your / partition) ''mount -o bind /dev /mnt/dev'' ''mount -o bind /proc /mnt/proc'' ''mount -o bind /sys /mnt/sys'' '''Chrooting''' Once everything is mounted, we can chroot to it: ''chroot /mnt /bin/bash'' now simply run ''liloconfig'' and follow the prompts 8f40a645265fcdf9fbea67a7f6a414e95b57a464 3192 3190 2018-10-28T22:22:28Z Wigums 609 wikitext text/x-wiki this covers straight unencrypted installs. just a simple installation with everything installed under / mounted under /dev/sda1. No LVM or additional drives. if you're encrypted or have an otherwise fancy install this wiki expects that you understand the intricacies of your own system. for a more in depth look at how to chroot your installation media (which can be extremely useful for more that just lilo) see [https://docs.slackware.com/howtos:slackware_admin:how_to_chroot_from_media here] insert and boot your installation media login as root when prompted but do not run setup '''Mounting''' ''mount /dev/sdX1 /mnt'' (where /dev/sdx1 is your / partition) ''mount -o bind /dev /mnt/dev'' ''mount -o bind /proc /mnt/proc'' ''mount -o bind /sys /mnt/sys'' '''Chrooting''' Once everything is mounted, we can chroot to it: ''chroot /mnt /bin/bash'' now simply run ''liloconfig'' and follow the prompts [[Category:Tutorials]] 6e8e66f3fd2940eb147f0a812d237a31a7b5017b 3193 3192 2018-10-28T22:57:36Z Wigums 609 wikitext text/x-wiki this covers straight unencrypted installs. just a simple installation with everything installed under / mounted under /dev/sda1. No LVM or additional drives. if you're encrypted or have an otherwise fancy install this wiki expects that you understand the intricacies of your own system. for a more in depth look at how to chroot your installation media (which can be extremely useful for more that just lilo) see [https://docs.slackware.com/howtos:slackware_admin:how_to_chroot_from_media here] insert and boot your installation media login as root when prompted but do not run setup '''Mounting''' ''mount /dev/sdX1 /mnt'' (where /dev/sdx1 is your / partition) ''mount -o bind /dev /mnt/dev'' ''mount -o bind /proc /mnt/proc'' ''mount -o bind /sys /mnt/sys'' '''Chrooting''' Once everything is mounted, we can chroot to it: ''chroot /mnt /bin/bash'' now simply run ''liloconfig'' and follow the prompts [[Category:Tutorials]] 09cc04e3ae26214f7b5673c541ffd1f727fef382 3194 3193 2018-10-28T22:58:16Z Wigums 609 wikitext text/x-wiki this covers straight unencrypted installs. just a simple installation with everything installed under / mounted under /dev/sda1. No LVM or additional drives. if you're encrypted or have an otherwise fancy install this wiki expects that you understand the intricacies of your own system. for a more in depth look at how to chroot your installation media (which can be extremely useful for more that just lilo) see [https://docs.slackware.com/howtos:slackware_admin:how_to_chroot_from_media here] insert and boot your installation media login as root when prompted but do not run setup '''Mounting''' ''mount /dev/sdX1 /mnt'' (where /dev/sdx1 is your / partition) ''mount -o bind /dev /mnt/dev'' ''mount -o bind /proc /mnt/proc'' ''mount -o bind /sys /mnt/sys'' '''Chrooting''' Once everything is mounted, we can chroot to it: ''chroot /mnt /bin/bash'' now simply run ''liloconfig'' and follow the prompts [[Category:Tutorials]] 5a62b84ae39c5d74413646a9102e59df0b4d739c 3195 3194 2018-10-28T23:21:24Z Wigums 609 wikitext text/x-wiki this covers straight unencrypted installs. just a simple installation with everything installed under / mounted under /dev/sda1. No LVM or additional drives. if you're encrypted or have an otherwise fancy install this wiki expects that you understand the intricacies of your own system. for a more in depth look at how to chroot your installation media (which can be extremely useful for more that just lilo) see [https://docs.slackware.com/howtos:slackware_admin:how_to_chroot_from_media here] '''Chrooting''' insert and boot your installation media login as root when prompted but do not run setup '''Mounting''' ''mount /dev/sdX1 /mnt'' (where /dev/sdx1 is your / partition) ''mount -o bind /dev /mnt/dev'' ''mount -o bind /proc /mnt/proc'' ''mount -o bind /sys /mnt/sys'' '''Chrooting''' Once everything is mounted, we can chroot to it: ''chroot /mnt /bin/bash'' now simply run ''liloconfig'' and follow the prompts '''Booting your system from the installation media''' often times you can boot your system from the installation media as well simply boot the installation media and on the very first page are the following instructions In a pinch, you can boot your system from here with a command like: boot: huge.s root=/dev/sda1 rdinit= ro In the example above, /dev/sda1 is the / Linux partition. once booted run ''liloconfig'' [[Category:Tutorials]] 0df70bb3ac5e481702878229343b8a348d8ef59e 3196 3195 2018-10-28T23:22:14Z Wigums 609 wikitext text/x-wiki this covers straight unencrypted installs. just a simple installation with everything installed under / mounted under /dev/sda1. No LVM or additional drives. if you're encrypted or have an otherwise fancy install this wiki expects that you understand the intricacies of your own system. for a more in depth look at how to chroot your installation media (which can be extremely useful for more that just lilo) see [https://docs.slackware.com/howtos:slackware_admin:how_to_chroot_from_media here] '''Chroot method''' insert and boot your installation media login as root when prompted but do not run setup '''Mounting''' ''mount /dev/sdX1 /mnt'' (where /dev/sdx1 is your / partition) ''mount -o bind /dev /mnt/dev'' ''mount -o bind /proc /mnt/proc'' ''mount -o bind /sys /mnt/sys'' '''Chrooting''' Once everything is mounted, we can chroot to it: ''chroot /mnt /bin/bash'' now simply run ''liloconfig'' and follow the prompts '''Booting your system from the installation media''' often times you can boot your system from the installation media as well simply boot the installation media and on the very first page are the following instructions In a pinch, you can boot your system from here with a command like: boot: huge.s root=/dev/sda1 rdinit= ro In the example above, /dev/sda1 is the / Linux partition. once booted run ''liloconfig'' [[Category:Tutorials]] b429bc2ebaa55684d6af3296f43be75388f7d99c CPU Frequency Scaling 0 10 3191 13 2018-10-28T22:10:03Z Wigums 609 wikitext text/x-wiki The CPU frequency scaling feature present in modern computers allows lowering and increasing the processor speed dynamically in runtime so as to save energy while having the possibility of increasing the performance and power consumption if needed. Activating CPU frequency scaling under Slackware is very easy, and requires loading a minimum of two kernel modules and running a simple command. On the one hand, you need to load a specific CPU driver that will activate the frequency scaling feature in your platform. Second, you need to choose a CPU frequency scaling governor, a module that will decide how and when to change the internal processor speed. There are governors to always run at full speed, governors to always run at low speed, governors to increase and decrease the speed based on the CPU load, etc. = Find available governors = cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = Setting a governor = edit ''/etc/default/cpufreq'' = Applying the governor = ''/etc/rc.d/rc.cpufreq'' should already be executable make sure its running ''/etc.rc.d/rc.cpufreq restart'' [[Category:Tutorials]] c62e658832e8d92aff111035ca4614d3cc9ce929 3197 3191 2018-10-29T13:11:32Z Wigums 609 wikitext text/x-wiki The CPU frequency scaling feature present in modern computers allows lowering and increasing the processor speed dynamically in runtime so as to save energy while having the possibility of increasing the performance and power consumption if needed. Activating CPU frequency scaling under Slackware is very easy, and requires loading a minimum of two kernel modules and running a simple command. On the one hand, you need to load a specific CPU driver that will activate the frequency scaling feature in your platform. Second, you need to choose a CPU frequency scaling governor, a module that will decide how and when to change the internal processor speed. There are governors to always run at full speed, governors to always run at low speed, governors to increase and decrease the speed based on the CPU load, etc. = Find available governors = cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = Setting a governor = edit ''/etc/default/cpufreq'' = Applying the governor = ''/etc/rc.d/rc.cpufreq'' should already be executable make sure its running ''/etc.rc.d/rc.cpufreq restart'' = Governor types = '''Performance''' The CPUfreq governor "performance" sets the CPU statically to the highest frequency within the borders of scaling_min_freq and scaling_max_freq. '''Powersave''' The CPUfreq governor "powersave" sets the CPU statically to the lowest frequency within the borders of scaling_min_freq and scaling_max_freq. '''Userspace''' The CPUfreq governor "userspace" allows the user, or any userspace program running with UID "root", to set the CPU to a specific frequency by making a sysfs file "scaling_setspeed" available in the CPU-device directory. '''Ondemand''' The CPUfreq governor "ondemand" sets the CPU frequency depending on the current system load. Load estimation is triggered by the scheduler through the update_util_data->func hook; when triggered, cpufreq checks the CPU-usage statistics over the last period and the governor sets the CPU accordingly. The CPU must have the capability to switch the frequency very quickly. '''Conservative''' The CPUfreq governor "conservative", much like the "ondemand" governor, sets the CPU frequency depending on the current usage. It differs in behaviour in that it gracefully increases and decreases the CPU speed rather than jumping to max speed the moment there is any load on the CPU. This behaviour is more suitable in a battery powered environment. [[Category:Tutorials]] bb3f0742f72827ba693a7e5e13b6201fcace3030 3198 3197 2018-10-29T13:31:02Z Wigums 609 wikitext text/x-wiki The CPU frequency scaling feature present in modern computers allows lowering and increasing the processor speed dynamically in runtime so as to save energy while having the possibility of increasing the performance and power consumption if needed. Activating CPU frequency scaling under Slackware is very easy, and requires loading a minimum of two kernel modules and running a simple command. On the one hand, you need to load a specific CPU driver that will activate the frequency scaling feature in your platform. Second, you need to choose a CPU frequency scaling governor, a module that will decide how and when to change the internal processor speed. There are governors to always run at full speed, governors to always run at low speed, governors to increase and decrease the speed based on the CPU load, etc. = Find available governors = cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = Setting a governor = edit ''/etc/default/cpufreq'' = Applying the governor = ''/etc/rc.d/rc.cpufreq'' should already be executable make sure its running ''/etc.rc.d/rc.cpufreq restart'' = Governor types = '''Performance''' The CPUfreq governor "performance" sets the CPU statically to the highest frequency within the borders of scaling_min_freq and scaling_max_freq. '''Powersave''' The CPUfreq governor "powersave" sets the CPU statically to the lowest frequency within the borders of scaling_min_freq and scaling_max_freq. '''Userspace''' The CPUfreq governor "userspace" allows the user, or any userspace program running with UID "root", to set the CPU to a specific frequency by making a sysfs file "scaling_setspeed" available in the CPU-device directory. '''Ondemand''' The CPUfreq governor "ondemand" sets the CPU frequency depending on the current system load. Load estimation is triggered by the scheduler through the update_util_data->func hook; when triggered, cpufreq checks the CPU-usage statistics over the last period and the governor sets the CPU accordingly. The CPU must have the capability to switch the frequency very quickly. '''Conservative''' The CPUfreq governor "conservative", much like the "ondemand" governor, sets the CPU frequency depending on the current usage. It differs in behaviour in that it gracefully increases and decreases the CPU speed rather than jumping to max speed the moment there is any load on the CPU. This behaviour is more suitable in a battery powered environment. [[Category:Tutorials]] 6a8863a77b81d9ab3f09bd5d43effbc7b4d5f92b LVM/Luks Encryption 0 328 3199 2018-11-05T15:20:43Z Wigums 609 Created page with "This article assumes that this will be the only operating system installed. Also wherever you see '''''sdx2''''' it is referring to the single large partition (probably /dev/s..." wikitext text/x-wiki This article assumes that this will be the only operating system installed. Also wherever you see '''''sdx2''''' it is referring to the single large partition (probably /dev/sda2) made in the first step. It also assumes you know your way around the slackware installer. Swap space setup is documented here but note its only needed if you plan to hibernate e.g. a laptop. '''Partitioning''' Boot the installer. Login as '''''root''''' and run cfdisk What you’re doing here is setting up the partitions. Essentially, we’re dividing up the hard drive into a few logical partitions so that certain things can run in certain places, and not be affected by others. In order to create a bootable encrypted drive there needs to be a small partition that is not encrypted, it’s unencrypted and readable, so the computer can use it to figure out how to start the operating system. The first partition to make is a boot partition. Delete every other existing partition (if there are any) and write (again, assuming this will be your only OS). Next, select new and create a primary partition that is relatively small, I usually do 1G (which is rather large but i often juggle multiple kernels). Select ''Beginning'', which puts the partition at the front of the disk. DO NOT forget to make the first partition bootable, otherwise the installation won’t know to use this partition to install the boot scripts and such. Next, create another partition with the remaining space. Follow the same steps, except do not make it bootable and use the rest of the available space. Just hit enter when it asks how much space to use. After you’ve done this, make sure you go down and select '''''write''''' to ensure the changes are made. Then exit cfdisk. It's a good idea for you to rewrite the entire large partition with random data. This is so computer forensics folks cannot determine where encryption starts and stops, making it harder to find out a way to circumvent the encryption and stuff. To do this, run dd if=/dev/urandom of=/dev/sdx2 '''NOTE***''' this can take quite some time. '''LVM / Luks Config''' LVM or Logical Volume Manager is used here to configure volumes inside of the large partition set up earlier (sdx2). LVM makes it easy to separate things internally and keep it all encrypted as one partition. cryptsetup -s 512 -y luksFormat /dev/sdx2 Type '''''YES''''', then decide on a password and type it. Be careful, later on if you put stuff on the drive and you forget your password, it’s gone forever. Such is the nature of encryption. Basically this is setting up luks encryption on /dev/sdx2. cryptsetup luksOpen /dev/sdx2 slackcrypt pvcreate is a linux command used to initialize physical volumes for use by logical volume management (lvm) later. pvcreate /dev/mapper/slackcrypt This creates the volume group “cryptvg”. vgcreate cryptvg /dev/mapper/slackcrypt Create three internal logical volumes, '''''root''''', '''''home''''', and '''''swap'''''. If you have a unique setup and prefer it a different way, just follow the same steps and size them how you want. the sizes used are example only lvcreate -L 20G -n root cryptvg lvcreate -L 2G -n swap cryptvg lvcreate -l 100%FREE -n home cryptvg These will be your '''''/root''''', '''''/home''''', and '''''/swap''''' “partitions”. You can adjust the sizes to whatever you want them to be. I use a pretty large amount of space in root because I have run out of space installing tons of programs before, but I’ve also used tiny root partitions on machines where I didn’t plan on installing much. It really depends, but if you have the extra space I’d do like 20+ just to be on the safe side. The home directory gets everything that’s not allocated to swap or root. Next thing we’ve got to do is make sure some nodes get set so everything knows where things are and what not vgscan --mknodes vgchange -ay make sure the slackware installer can detect the swap partition mkswap /dev/cryptvg/swap '''Slack Setup and Installation''' Run the slackware installer setup the installer will walk you through it from here. it should auto-detect the swap partition we designated Selecting '''''root''''' partition Make sure you select /dev/cryptvg/root here, because that’ll be your LVM root partition. Pick whichever file-system you like. After that it should bring you back to the same screen. It’s important to designate your other partitions here. Select /dev/cryptvg/home and format it. Next designate boot, which is essential, otherwise your machine will not work properly. Select '''''/dev/sdx1/''''' (probably /dev/sda1), format it, and type ''/boot''. Now simply install slackware as you normally would until you get to '''Install LILO''' To install the bootloader Lilo select '''''expert''''', then begin. Ignore the optional LILO Append, you probably don’t need to do anything with that. Select ''mbr'', hit confirm when it asks you to confirm /dev/sdx (probably /dev/sda), and keep going through the options until you’re back at the screen where you selected “begin”. Now you have to select '''''Linux: Add a linux partition'''''... and select /dev/cryptvg/root. (/dev/cryptvg/root, NOT /boot). Once that’s been selected, install lilo. . Continue with the installation until you reach a screen listing slackwares installation steps. Eit the installer and select '''''No''''' to get dropped to a command prompt. '''Creating an initrd''' Now we have to fix lilo because of our encryption scheme. chroot /mnt The simple explanation for this command is that you basically just entered the installed system, which is mounted at /mnt. Now you can work on things that are installed on the system. The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure. to create an initrd run /usr/share/mkinitrd/mkinitrd_command_generator.sh it will look similar to this mkinitrd -c -k 4.19.0 -f ext4 -r /dev/cryptvg/root -m usb-storage:xhci- hcd:usbhid:hid_generic:mbcache:jbd2:ext4 -C /dev/sda2 -h /dev/cryptvg/swap -L -u -o /boot/initrd.gz Run the resulting command (yours will surely be different from the example). This will write an image to /boot/initrd.gz in your system which we will use for booting. The '''''-h /dev/cryptvg/swap''''' has been added to enable hibernation. it was not part of the resulting mikinitrd_command_generator.sh command If you need to know what kernel you just installed try uname -a '''Fixing LILO''' Next, you have to edit lilo’s configuration file and point it to the correct places so it knows what to boot with. Don’t forget the initrd line here. (use your preferred editor) vim /etc/lilo.conf Edit the pertinent parts to look like this: image = /boot/vmlinuz-generic-4.19.0 initrd = /boot/initrd.gz root = /dev/cryptvg/root label = Slackware read-only # Partitions should be mounted read-only for checking Above that, there’s an “append” line. Edit it to look something like this: append = "vt.default_utf8=0 resume=/dev/cryptvg/swap" Of course, substituting your kernel where necessary. You can check what you need to put for “image = ” by going to /boot and checking which generic kernel you want to use to boot. Save your changes and exit. Run lilo -v You may get an error or two from lilo, but you can usually ignore these. type exit to leave the chroot and then reboot If something went wrong, you probably configured something incorrectly along the way. To get back into your system and repair lilo or some other part of the system, follow these steps to chroot from installation media cryptsetup luksOpen /dev/sdx2 slackcrypt vgscan --mknodes vgchange -ay lvscan mount /dev/cryptvg/root /mnt mount /dev/cryptvg/home /mnt/home mount /dev/sdx1 /mnt/boot mount -o bind /proc /mnt/proc mount -o bind /sys /mnt/sys mount -o bind /dev /mnt/dev chroot /mnt ed5b41804b77115f8b5777ea967ff27544c430eb 3200 3199 2018-11-05T15:22:23Z Wigums 609 wikitext text/x-wiki [[Category:Tutorials]] This article assumes that this will be the only operating system installed. Also wherever you see '''''sdx2''''' it is referring to the single large partition (probably /dev/sda2) made in the first step. It also assumes you know your way around the slackware installer. Swap space setup is documented here but note its only needed if you plan to hibernate e.g. a laptop. '''Partitioning''' Boot the installer. Login as '''''root''''' and run cfdisk What you’re doing here is setting up the partitions. Essentially, we’re dividing up the hard drive into a few logical partitions so that certain things can run in certain places, and not be affected by others. In order to create a bootable encrypted drive there needs to be a small partition that is not encrypted, it’s unencrypted and readable, so the computer can use it to figure out how to start the operating system. The first partition to make is a boot partition. Delete every other existing partition (if there are any) and write (again, assuming this will be your only OS). Next, select new and create a primary partition that is relatively small, I usually do 1G (which is rather large but i often juggle multiple kernels). Select ''Beginning'', which puts the partition at the front of the disk. DO NOT forget to make the first partition bootable, otherwise the installation won’t know to use this partition to install the boot scripts and such. Next, create another partition with the remaining space. Follow the same steps, except do not make it bootable and use the rest of the available space. Just hit enter when it asks how much space to use. After you’ve done this, make sure you go down and select '''''write''''' to ensure the changes are made. Then exit cfdisk. It's a good idea for you to rewrite the entire large partition with random data. This is so computer forensics folks cannot determine where encryption starts and stops, making it harder to find out a way to circumvent the encryption and stuff. To do this, run dd if=/dev/urandom of=/dev/sdx2 '''NOTE***''' this can take quite some time. '''LVM / Luks Config''' LVM or Logical Volume Manager is used here to configure volumes inside of the large partition set up earlier (sdx2). LVM makes it easy to separate things internally and keep it all encrypted as one partition. cryptsetup -s 512 -y luksFormat /dev/sdx2 Type '''''YES''''', then decide on a password and type it. Be careful, later on if you put stuff on the drive and you forget your password, it’s gone forever. Such is the nature of encryption. Basically this is setting up luks encryption on /dev/sdx2. cryptsetup luksOpen /dev/sdx2 slackcrypt pvcreate is a linux command used to initialize physical volumes for use by logical volume management (lvm) later. pvcreate /dev/mapper/slackcrypt This creates the volume group “cryptvg”. vgcreate cryptvg /dev/mapper/slackcrypt Create three internal logical volumes, '''''root''''', '''''home''''', and '''''swap'''''. If you have a unique setup and prefer it a different way, just follow the same steps and size them how you want. the sizes used are example only lvcreate -L 20G -n root cryptvg lvcreate -L 2G -n swap cryptvg lvcreate -l 100%FREE -n home cryptvg These will be your '''''/root''''', '''''/home''''', and '''''/swap''''' “partitions”. You can adjust the sizes to whatever you want them to be. I use a pretty large amount of space in root because I have run out of space installing tons of programs before, but I’ve also used tiny root partitions on machines where I didn’t plan on installing much. It really depends, but if you have the extra space I’d do like 20+ just to be on the safe side. The home directory gets everything that’s not allocated to swap or root. Next thing we’ve got to do is make sure some nodes get set so everything knows where things are and what not vgscan --mknodes vgchange -ay make sure the slackware installer can detect the swap partition mkswap /dev/cryptvg/swap '''Slack Setup and Installation''' Run the slackware installer setup the installer will walk you through it from here. it should auto-detect the swap partition we designated Selecting '''''root''''' partition Make sure you select /dev/cryptvg/root here, because that’ll be your LVM root partition. Pick whichever file-system you like. After that it should bring you back to the same screen. It’s important to designate your other partitions here. Select /dev/cryptvg/home and format it. Next designate boot, which is essential, otherwise your machine will not work properly. Select '''''/dev/sdx1/''''' (probably /dev/sda1), format it, and type ''/boot''. Now simply install slackware as you normally would until you get to '''Install LILO''' To install the bootloader Lilo select '''''expert''''', then begin. Ignore the optional LILO Append, you probably don’t need to do anything with that. Select ''mbr'', hit confirm when it asks you to confirm /dev/sdx (probably /dev/sda), and keep going through the options until you’re back at the screen where you selected “begin”. Now you have to select '''''Linux: Add a linux partition'''''... and select /dev/cryptvg/root. (/dev/cryptvg/root, NOT /boot). Once that’s been selected, install lilo. . Continue with the installation until you reach a screen listing slackwares installation steps. Eit the installer and select '''''No''''' to get dropped to a command prompt. '''Creating an initrd''' Now we have to fix lilo because of our encryption scheme. chroot /mnt The simple explanation for this command is that you basically just entered the installed system, which is mounted at /mnt. Now you can work on things that are installed on the system. The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure. to create an initrd run /usr/share/mkinitrd/mkinitrd_command_generator.sh it will look similar to this mkinitrd -c -k 4.19.0 -f ext4 -r /dev/cryptvg/root -m usb-storage:xhci- hcd:usbhid:hid_generic:mbcache:jbd2:ext4 -C /dev/sda2 -h /dev/cryptvg/swap -L -u -o /boot/initrd.gz Run the resulting command (yours will surely be different from the example). This will write an image to /boot/initrd.gz in your system which we will use for booting. The '''''-h /dev/cryptvg/swap''''' has been added to enable hibernation. it was not part of the resulting mikinitrd_command_generator.sh command If you need to know what kernel you just installed try uname -a '''Fixing LILO''' Next, you have to edit lilo’s configuration file and point it to the correct places so it knows what to boot with. Don’t forget the initrd line here. (use your preferred editor) vim /etc/lilo.conf Edit the pertinent parts to look like this: image = /boot/vmlinuz-generic-4.19.0 initrd = /boot/initrd.gz root = /dev/cryptvg/root label = Slackware read-only # Partitions should be mounted read-only for checking Above that, there’s an “append” line. Edit it to look something like this: append = "vt.default_utf8=0 resume=/dev/cryptvg/swap" Of course, substituting your kernel where necessary. You can check what you need to put for “image = ” by going to /boot and checking which generic kernel you want to use to boot. Save your changes and exit. Run lilo -v You may get an error or two from lilo, but you can usually ignore these. type exit to leave the chroot and then reboot If something went wrong, you probably configured something incorrectly along the way. To get back into your system and repair lilo or some other part of the system, follow these steps to chroot from installation media cryptsetup luksOpen /dev/sdx2 slackcrypt vgscan --mknodes vgchange -ay lvscan mount /dev/cryptvg/root /mnt mount /dev/cryptvg/home /mnt/home mount /dev/sdx1 /mnt/boot mount -o bind /proc /mnt/proc mount -o bind /sys /mnt/sys mount -o bind /dev /mnt/dev chroot /mnt dedec3acaf5a8fd4c3ddb35a34d14535f670dcda 3201 3200 2018-11-05T19:23:10Z Wigums 609 wikitext text/x-wiki [[Category:Tutorials]] '''LVM''' LVM is a tool for logical volume management which includes allocating disks, striping, mirroring and resizing logical volumes. With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes. LVM physical volumes can be placed on other block devices which might span two or more disks. '''LUKS''' LUKS is the standard for Linux hard disk encryption. By providing a standard on-disk-format, it does not only facilitate compatibility among distributions, but also provides secure management of multiple user passwords. LUKS stores all necessary setup information in the partition header, enabling to transport or migrate data seamlessly. This article assumes that this will be the only operating system installed. Also wherever you see '''''sdx2''''' it is referring to the single large partition (probably /dev/sda2) made in the first step. It also assumes you know your way around the slackware installer. Swap space setup is documented here but note its only needed if you plan to hibernate e.g. a laptop. '''Partitioning''' Boot the installer. Login as '''''root''''' and run cfdisk What you’re doing here is setting up the partitions. Essentially, we’re dividing up the hard drive into a few logical partitions so that certain things can run in certain places, and not be affected by others. In order to create a bootable encrypted drive there needs to be a small partition that is not encrypted, it’s unencrypted and readable, so the computer can use it to figure out how to start the operating system. The first partition to make is a boot partition. Delete every other existing partition (if there are any) and write (again, assuming this will be your only OS). Next, select new and create a primary partition that is relatively small, I usually do 1G (which is rather large but i often juggle multiple kernels). Select ''Beginning'', which puts the partition at the front of the disk. DO NOT forget to make the first partition bootable, otherwise the installation won’t know to use this partition to install the boot scripts and such. Next, create another partition with the remaining space. Follow the same steps, except do not make it bootable and use the rest of the available space. Just hit enter when it asks how much space to use. After you’ve done this, make sure you go down and select '''''write''''' to ensure the changes are made. Then exit cfdisk. It's a good idea for you to rewrite the entire large partition with random data. This is so computer forensics folks cannot determine where encryption starts and stops, making it harder to find out a way to circumvent the encryption and stuff. To do this, run dd if=/dev/urandom of=/dev/sdx2 '''NOTE***''' this can take quite some time. '''LVM / Luks Config''' LVM or Logical Volume Manager is used here to configure volumes inside of the large partition set up earlier (sdx2). LVM makes it easy to separate things internally and keep it all encrypted as one partition. cryptsetup -s 512 -y luksFormat /dev/sdx2 Type '''''YES''''', then decide on a password and type it. Be careful, later on if you put stuff on the drive and you forget your password, it’s gone forever. Such is the nature of encryption. Basically this is setting up luks encryption on /dev/sdx2. cryptsetup luksOpen /dev/sdx2 slackcrypt pvcreate is a linux command used to initialize physical volumes for use by logical volume management (lvm) later. pvcreate /dev/mapper/slackcrypt This creates the volume group “cryptvg”. vgcreate cryptvg /dev/mapper/slackcrypt Create three internal logical volumes, '''''root''''', '''''home''''', and '''''swap'''''. If you have a unique setup and prefer it a different way, just follow the same steps and size them how you want. the sizes used are example only lvcreate -L 20G -n root cryptvg lvcreate -L 2G -n swap cryptvg lvcreate -l 100%FREE -n home cryptvg These will be your '''''/root''''', '''''/home''''', and '''''/swap''''' “partitions”. You can adjust the sizes to whatever you want them to be. I use a pretty large amount of space in root because I have run out of space installing tons of programs before, but I’ve also used tiny root partitions on machines where I didn’t plan on installing much. It really depends, but if you have the extra space I’d do like 20+ just to be on the safe side. The home directory gets everything that’s not allocated to swap or root. Next thing we’ve got to do is make sure some nodes get set so everything knows where things are and what not vgscan --mknodes vgchange -ay make sure the slackware installer can detect the swap partition mkswap /dev/cryptvg/swap '''Slack Setup and Installation''' Run the slackware installer setup the installer will walk you through it from here. it should auto-detect the swap partition we designated Selecting '''''root''''' partition Make sure you select /dev/cryptvg/root here, because that’ll be your LVM root partition. Pick whichever file-system you like. After that it should bring you back to the same screen. It’s important to designate your other partitions here. Select /dev/cryptvg/home and format it. Next designate boot, which is essential, otherwise your machine will not work properly. Select '''''/dev/sdx1/''''' (probably /dev/sda1), format it, and type ''/boot''. Now simply install slackware as you normally would until you get to '''Install LILO''' To install the bootloader Lilo select '''''expert''''', then begin. Ignore the optional LILO Append, you probably don’t need to do anything with that. Select ''mbr'', hit confirm when it asks you to confirm /dev/sdx (probably /dev/sda), and keep going through the options until you’re back at the screen where you selected “begin”. Now you have to select '''''Linux: Add a linux partition'''''... and select /dev/cryptvg/root. (/dev/cryptvg/root, NOT /boot). Once that’s been selected, install lilo. . Continue with the installation until you reach a screen listing slackwares installation steps. Eit the installer and select '''''No''''' to get dropped to a command prompt. '''Creating an initrd''' Now we have to fix lilo because of our encryption scheme. chroot /mnt The simple explanation for this command is that you basically just entered the installed system, which is mounted at /mnt. Now you can work on things that are installed on the system. The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure. to create an initrd run /usr/share/mkinitrd/mkinitrd_command_generator.sh it will look similar to this mkinitrd -c -k 4.19.0 -f ext4 -r /dev/cryptvg/root -m usb-storage:xhci- hcd:usbhid:hid_generic:mbcache:jbd2:ext4 -C /dev/sda2 -h /dev/cryptvg/swap -L -u -o /boot/initrd.gz Run the resulting command (yours will surely be different from the example). This will write an image to /boot/initrd.gz in your system which we will use for booting. The '''''-h /dev/cryptvg/swap''''' has been added to enable hibernation. it was not part of the resulting mikinitrd_command_generator.sh command If you need to know what kernel you just installed try uname -a '''Fixing LILO''' Next, you have to edit lilo’s configuration file and point it to the correct places so it knows what to boot with. Don’t forget the initrd line here. (use your preferred editor) vim /etc/lilo.conf Edit the pertinent parts to look like this: image = /boot/vmlinuz-generic-4.19.0 initrd = /boot/initrd.gz root = /dev/cryptvg/root label = Slackware read-only # Partitions should be mounted read-only for checking Above that, there’s an “append” line. Edit it to look something like this: append = "vt.default_utf8=0 resume=/dev/cryptvg/swap" Of course, substituting your kernel where necessary. You can check what you need to put for “image = ” by going to /boot and checking which generic kernel you want to use to boot. Save your changes and exit. Run lilo -v You may get an error or two from lilo, but you can usually ignore these. type exit to leave the chroot and then reboot If something went wrong, you probably configured something incorrectly along the way. To get back into your system and repair lilo or some other part of the system, follow these steps to chroot from installation media cryptsetup luksOpen /dev/sdx2 slackcrypt vgscan --mknodes vgchange -ay lvscan mount /dev/cryptvg/root /mnt mount /dev/cryptvg/home /mnt/home mount /dev/sdx1 /mnt/boot mount -o bind /proc /mnt/proc mount -o bind /sys /mnt/sys mount -o bind /dev /mnt/dev chroot /mnt cad012f744c9c498f3451206038565caeb533bb7 3202 3201 2018-11-05T19:23:30Z Wigums 609 wikitext text/x-wiki [[Category:Tutorials]] '''LVM''' LVM is a tool for logical volume management which includes allocating disks, striping, mirroring and resizing logical volumes. With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes. LVM physical volumes can be placed on other block devices which might span two or more disks. '''LUKS''' LUKS is the standard for Linux hard disk encryption. By providing a standard on-disk-format, it does not only facilitate compatibility among distributions, but also provides secure management of multiple user passwords. LUKS stores all necessary setup information in the partition header, enabling to transport or migrate data seamlessly. This article assumes that this will be the only operating system installed. Also wherever you see '''''sdx2''''' it is referring to the single large partition (probably /dev/sda2) made in the first step. It also assumes you know your way around the slackware installer. Swap space setup is documented here but note its only needed if you plan to hibernate e.g. a laptop. '''Partitioning''' Boot the installer. Login as '''''root''''' and run cfdisk What you’re doing here is setting up the partitions. Essentially, we’re dividing up the hard drive into a few logical partitions so that certain things can run in certain places, and not be affected by others. In order to create a bootable encrypted drive there needs to be a small partition that is not encrypted, it’s unencrypted and readable, so the computer can use it to figure out how to start the operating system. The first partition to make is a boot partition. Delete every other existing partition (if there are any) and write (again, assuming this will be your only OS). Next, select new and create a primary partition that is relatively small, I usually do 1G (which is rather large but i often juggle multiple kernels). Select ''Beginning'', which puts the partition at the front of the disk. DO NOT forget to make the first partition bootable, otherwise the installation won’t know to use this partition to install the boot scripts and such. Next, create another partition with the remaining space. Follow the same steps, except do not make it bootable and use the rest of the available space. Just hit enter when it asks how much space to use. After you’ve done this, make sure you go down and select '''''write''''' to ensure the changes are made. Then exit cfdisk. It's a good idea for you to rewrite the entire large partition with random data. This is so computer forensics folks cannot determine where encryption starts and stops, making it harder to find out a way to circumvent the encryption and stuff. To do this, run dd if=/dev/urandom of=/dev/sdx2 '''NOTE***''' this can take quite some time. '''LVM / Luks Config''' LVM or Logical Volume Manager is used here to configure volumes inside of the large partition set up earlier (sdx2). LVM makes it easy to separate things internally and keep it all encrypted as one partition. cryptsetup -s 512 -y luksFormat /dev/sdx2 Type '''''YES''''', then decide on a password and type it. Be careful, later on if you put stuff on the drive and you forget your password, it’s gone forever. Such is the nature of encryption. Basically this is setting up luks encryption on /dev/sdx2. cryptsetup luksOpen /dev/sdx2 slackcrypt pvcreate is a linux command used to initialize physical volumes for use by logical volume management (lvm) later. pvcreate /dev/mapper/slackcrypt This creates the volume group “cryptvg”. vgcreate cryptvg /dev/mapper/slackcrypt Create three internal logical volumes, '''''root''''', '''''home''''', and '''''swap'''''. If you have a unique setup and prefer it a different way, just follow the same steps and size them how you want. the sizes used are example only lvcreate -L 20G -n root cryptvg lvcreate -L 2G -n swap cryptvg lvcreate -l 100%FREE -n home cryptvg These will be your '''''/root''''', '''''/home''''', and '''''/swap''''' “partitions”. You can adjust the sizes to whatever you want them to be. I use a pretty large amount of space in root because I have run out of space installing tons of programs before, but I’ve also used tiny root partitions on machines where I didn’t plan on installing much. It really depends, but if you have the extra space I’d do like 20+ just to be on the safe side. The home directory gets everything that’s not allocated to swap or root. Next thing we’ve got to do is make sure some nodes get set so everything knows where things are and what not vgscan --mknodes vgchange -ay make sure the slackware installer can detect the swap partition mkswap /dev/cryptvg/swap '''Slack Setup and Installation''' Run the slackware installer setup the installer will walk you through it from here. it should auto-detect the swap partition we designated Selecting '''''root''''' partition Make sure you select /dev/cryptvg/root here, because that’ll be your LVM root partition. Pick whichever file-system you like. After that it should bring you back to the same screen. It’s important to designate your other partitions here. Select /dev/cryptvg/home and format it. Next designate boot, which is essential, otherwise your machine will not work properly. Select '''''/dev/sdx1/''''' (probably /dev/sda1), format it, and type ''/boot''. Now simply install slackware as you normally would until you get to '''Install LILO''' To install the bootloader Lilo select '''''expert''''', then begin. Ignore the optional LILO Append, you probably don’t need to do anything with that. Select ''mbr'', hit confirm when it asks you to confirm /dev/sdx (probably /dev/sda), and keep going through the options until you’re back at the screen where you selected “begin”. Now you have to select '''''Linux: Add a linux partition'''''... and select /dev/cryptvg/root. (/dev/cryptvg/root, NOT /boot). Once that’s been selected, install lilo. . Continue with the installation until you reach a screen listing slackwares installation steps. Eit the installer and select '''''No''''' to get dropped to a command prompt. '''Creating an initrd''' Now we have to fix lilo because of our encryption scheme. chroot /mnt The simple explanation for this command is that you basically just entered the installed system, which is mounted at /mnt. Now you can work on things that are installed on the system. The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure. to create an initrd run /usr/share/mkinitrd/mkinitrd_command_generator.sh it will look similar to this mkinitrd -c -k 4.19.0 -f ext4 -r /dev/cryptvg/root -m usb-storage:xhci- hcd:usbhid:hid_generic:mbcache:jbd2:ext4 -C /dev/sda2 -h /dev/cryptvg/swap -L -u -o /boot/initrd.gz Run the resulting command (yours will surely be different from the example). This will write an image to /boot/initrd.gz in your system which we will use for booting. The '''''-h /dev/cryptvg/swap''''' has been added to enable hibernation. it was not part of the resulting mikinitrd_command_generator.sh command If you need to know what kernel you just installed try uname -a '''Fixing LILO''' Next, you have to edit lilo’s configuration file and point it to the correct places so it knows what to boot with. Don’t forget the initrd line here. (use your preferred editor) vim /etc/lilo.conf Edit the pertinent parts to look like this: image = /boot/vmlinuz-generic-4.19.0 initrd = /boot/initrd.gz root = /dev/cryptvg/root label = Slackware read-only # Partitions should be mounted read-only for checking Above that, there’s an “append” line. Edit it to look something like this: append = "vt.default_utf8=0 resume=/dev/cryptvg/swap" Of course, substituting your kernel where necessary. You can check what you need to put for “image = ” by going to /boot and checking which generic kernel you want to use to boot. Save your changes and exit. Run lilo -v You may get an error or two from lilo, but you can usually ignore these. type exit to leave the chroot and then reboot If something went wrong, you probably configured something incorrectly along the way. To get back into your system and repair lilo or some other part of the system, follow these steps to chroot from installation media cryptsetup luksOpen /dev/sdx2 slackcrypt vgscan --mknodes vgchange -ay lvscan mount /dev/cryptvg/root /mnt mount /dev/cryptvg/home /mnt/home mount /dev/sdx1 /mnt/boot mount -o bind /proc /mnt/proc mount -o bind /sys /mnt/sys mount -o bind /dev /mnt/dev chroot /mnt 9fa0de54db4e282b74d320a52961a7d1e689963e 3203 3202 2018-11-05T19:25:22Z Wigums 609 wikitext text/x-wiki [[Category:Tutorials]] '''LVM''' LVM is a tool for logical volume management which includes allocating disks, striping, mirroring and resizing logical volumes. With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes. LVM physical volumes can be placed on other block devices which might span two or more disks. '''LUKS''' LUKS is the standard for Linux hard disk encryption. By providing a standard on-disk-format, it does not only facilitate compatibility among distributions, but also provides secure management of multiple user passwords. LUKS stores all necessary setup information in the partition header, enabling you to transport or migrate data seamlessly. This article assumes that this will be the only operating system installed. Also wherever you see '''''sdx2''''' it is referring to the single large partition (probably /dev/sda2) made in the first step. It also assumes you know your way around the slackware installer. Swap space setup is documented here but note its only needed if you plan to hibernate e.g. a laptop. '''Partitioning''' Boot the installer. Login as '''''root''''' and run cfdisk What you’re doing here is setting up the partitions. Essentially, we’re dividing up the hard drive into a few logical partitions so that certain things can run in certain places, and not be affected by others. In order to create a bootable encrypted drive there needs to be a small partition that is not encrypted, it’s unencrypted and readable, so the computer can use it to figure out how to start the operating system. The first partition to make is a boot partition. Delete every other existing partition (if there are any) and write (again, assuming this will be your only OS). Next, select new and create a primary partition that is relatively small, I usually do 1G (which is rather large but i often juggle multiple kernels). Select ''Beginning'', which puts the partition at the front of the disk. DO NOT forget to make the first partition bootable, otherwise the installation won’t know to use this partition to install the boot scripts and such. Next, create another partition with the remaining space. Follow the same steps, except do not make it bootable and use the rest of the available space. Just hit enter when it asks how much space to use. After you’ve done this, make sure you go down and select '''''write''''' to ensure the changes are made. Then exit cfdisk. It's a good idea for you to rewrite the entire large partition with random data. This is so computer forensics folks cannot determine where encryption starts and stops, making it harder to find out a way to circumvent the encryption and stuff. To do this, run dd if=/dev/urandom of=/dev/sdx2 '''NOTE***''' this can take quite some time. '''LVM / Luks Config''' LVM or Logical Volume Manager is used here to configure volumes inside of the large partition set up earlier (sdx2). LVM makes it easy to separate things internally and keep it all encrypted as one partition. cryptsetup -s 512 -y luksFormat /dev/sdx2 Type '''''YES''''', then decide on a password and type it. Be careful, later on if you put stuff on the drive and you forget your password, it’s gone forever. Such is the nature of encryption. Basically this is setting up luks encryption on /dev/sdx2. cryptsetup luksOpen /dev/sdx2 slackcrypt pvcreate is a linux command used to initialize physical volumes for use by logical volume management (lvm) later. pvcreate /dev/mapper/slackcrypt This creates the volume group “cryptvg”. vgcreate cryptvg /dev/mapper/slackcrypt Create three internal logical volumes, '''''root''''', '''''home''''', and '''''swap'''''. If you have a unique setup and prefer it a different way, just follow the same steps and size them how you want. the sizes used are example only lvcreate -L 20G -n root cryptvg lvcreate -L 2G -n swap cryptvg lvcreate -l 100%FREE -n home cryptvg These will be your '''''/root''''', '''''/home''''', and '''''/swap''''' “partitions”. You can adjust the sizes to whatever you want them to be. I use a pretty large amount of space in root because I have run out of space installing tons of programs before, but I’ve also used tiny root partitions on machines where I didn’t plan on installing much. It really depends, but if you have the extra space I’d do like 20+ just to be on the safe side. The home directory gets everything that’s not allocated to swap or root. Next thing we’ve got to do is make sure some nodes get set so everything knows where things are and what not vgscan --mknodes vgchange -ay make sure the slackware installer can detect the swap partition mkswap /dev/cryptvg/swap '''Slack Setup and Installation''' Run the slackware installer setup the installer will walk you through it from here. it should auto-detect the swap partition we designated Selecting '''''root''''' partition Make sure you select /dev/cryptvg/root here, because that’ll be your LVM root partition. Pick whichever file-system you like. After that it should bring you back to the same screen. It’s important to designate your other partitions here. Select /dev/cryptvg/home and format it. Next designate boot, which is essential, otherwise your machine will not work properly. Select '''''/dev/sdx1/''''' (probably /dev/sda1), format it, and type ''/boot''. Now simply install slackware as you normally would until you get to '''Install LILO''' To install the bootloader Lilo select '''''expert''''', then begin. Ignore the optional LILO Append, you probably don’t need to do anything with that. Select ''mbr'', hit confirm when it asks you to confirm /dev/sdx (probably /dev/sda), and keep going through the options until you’re back at the screen where you selected “begin”. Now you have to select '''''Linux: Add a linux partition'''''... and select /dev/cryptvg/root. (/dev/cryptvg/root, NOT /boot). Once that’s been selected, install lilo. . Continue with the installation until you reach a screen listing slackwares installation steps. Eit the installer and select '''''No''''' to get dropped to a command prompt. '''Creating an initrd''' Now we have to fix lilo because of our encryption scheme. chroot /mnt The simple explanation for this command is that you basically just entered the installed system, which is mounted at /mnt. Now you can work on things that are installed on the system. The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure. to create an initrd run /usr/share/mkinitrd/mkinitrd_command_generator.sh it will look similar to this mkinitrd -c -k 4.19.0 -f ext4 -r /dev/cryptvg/root -m usb-storage:xhci- hcd:usbhid:hid_generic:mbcache:jbd2:ext4 -C /dev/sda2 -h /dev/cryptvg/swap -L -u -o /boot/initrd.gz Run the resulting command (yours will surely be different from the example). This will write an image to /boot/initrd.gz in your system which we will use for booting. The '''''-h /dev/cryptvg/swap''''' has been added to enable hibernation. it was not part of the resulting mikinitrd_command_generator.sh command If you need to know what kernel you just installed try uname -a '''Fixing LILO''' Next, you have to edit lilo’s configuration file and point it to the correct places so it knows what to boot with. Don’t forget the initrd line here. (use your preferred editor) vim /etc/lilo.conf Edit the pertinent parts to look like this: image = /boot/vmlinuz-generic-4.19.0 initrd = /boot/initrd.gz root = /dev/cryptvg/root label = Slackware read-only # Partitions should be mounted read-only for checking Above that, there’s an “append” line. Edit it to look something like this: append = "vt.default_utf8=0 resume=/dev/cryptvg/swap" Of course, substituting your kernel where necessary. You can check what you need to put for “image = ” by going to /boot and checking which generic kernel you want to use to boot. Save your changes and exit. Run lilo -v You may get an error or two from lilo, but you can usually ignore these. type exit to leave the chroot and then reboot If something went wrong, you probably configured something incorrectly along the way. To get back into your system and repair lilo or some other part of the system, follow these steps to chroot from installation media cryptsetup luksOpen /dev/sdx2 slackcrypt vgscan --mknodes vgchange -ay lvscan mount /dev/cryptvg/root /mnt mount /dev/cryptvg/home /mnt/home mount /dev/sdx1 /mnt/boot mount -o bind /proc /mnt/proc mount -o bind /sys /mnt/sys mount -o bind /dev /mnt/dev chroot /mnt 8498f42f2e0fea36ea6cbefc613734c5feb2af6d 3204 3203 2018-11-05T19:45:40Z Wigums 609 wikitext text/x-wiki [[Category:Tutorials]] '''LVM''' LVM is a tool for logical volume management which includes allocating disks, striping, mirroring and resizing logical volumes. With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes. LVM physical volumes can be placed on other block devices which might span two or more disks. '''LUKS''' LUKS is the standard for Linux hard disk encryption. By providing a standard on-disk-format, it does not only facilitate compatibility among distributions, but also provides secure management of multiple user passwords. LUKS stores all necessary setup information in the partition header, enabling you to transport or migrate data seamlessly. This article assumes that this will be the only operating system installed. Also wherever you see '''''sdx2''''' it is referring to the single large partition (probably /dev/sda2) made in the first step. It also assumes you know your way around the slackware installer. Swap space setup is documented here but note its only needed if you plan to hibernate e.g. a laptop. '''Partitioning''' Boot the installer. Login as '''''root''''' and run cfdisk What you’re doing here is setting up the partitions. Essentially, we’re dividing up the hard drive into a few logical partitions so that certain things can run in certain places, and not be affected by others. In order to create a bootable encrypted drive there needs to be a small partition that is not encrypted, it’s unencrypted and readable, so the computer can use it to figure out how to start the operating system. The first partition to make is a boot partition. Delete every other existing partition (if there are any) and write (again, assuming this will be your only OS). Next, select new and create a primary partition that is relatively small, I usually do 1G (which is rather large but i often juggle multiple kernels). Select ''Beginning'', which puts the partition at the front of the disk. DO NOT forget to make the first partition bootable, otherwise the installation won’t know to use this partition to install the boot scripts and such. Next, create another partition with the remaining space. Follow the same steps, except do not make it bootable and use the rest of the available space. Just hit enter when it asks how much space to use. After you’ve done this, make sure you go down and select '''''write''''' to ensure the changes are made. Then exit cfdisk. It's a good idea for you to rewrite the entire large partition with random data. This is so computer forensics folks cannot determine where encryption starts and stops, making it harder to find out a way to circumvent the encryption and stuff. To do this, run dd if=/dev/urandom of=/dev/sdx2 '''NOTE***''' this can take quite some time. '''LVM / Luks Config''' LVM or Logical Volume Manager is used here to configure volumes inside of the large partition set up earlier (sdx2). LVM makes it easy to separate things internally and keep it all encrypted as one partition. cryptsetup -s 512 -y luksFormat /dev/sdx2 Type '''''YES''''', then decide on a password and type it. Be careful, later on if you put stuff on the drive and you forget your password, it’s gone forever. Such is the nature of encryption. Basically this is setting up luks encryption on /dev/sdx2. cryptsetup luksOpen /dev/sdx2 slackcrypt pvcreate is a linux command used to initialize physical volumes for use by logical volume management (lvm) later. pvcreate /dev/mapper/slackcrypt This creates the volume group “cryptvg”. vgcreate cryptvg /dev/mapper/slackcrypt Create three internal logical volumes, '''''root''''', '''''home''''', and '''''swap'''''. If you have a unique setup and prefer it a different way, just follow the same steps and size them how you want. the sizes used are example only lvcreate -L 20G -n root cryptvg lvcreate -L 2G -n swap cryptvg lvcreate -l 100%FREE -n home cryptvg These will be your '''''/root''''', '''''/home''''', and '''''/swap''''' “partitions”. You can adjust the sizes to whatever you want them to be. I use a pretty large amount of space in root because I have run out of space installing tons of programs before, but I’ve also used tiny root partitions on machines where I didn’t plan on installing much. It really depends, but if you have the extra space I’d do like 20+ just to be on the safe side. The home directory gets everything that’s not allocated to swap or root. Next thing we’ve got to do is make sure some nodes get set so everything knows where things are and what not vgscan --mknodes vgchange -ay make sure the slackware installer can detect the swap partition mkswap /dev/cryptvg/swap '''Slack Setup and Installation''' Run the slackware installer setup the installer will walk you through it from here. it should auto-detect the swap partition we designated Selecting '''''root''''' partition Make sure you select /dev/cryptvg/root here, because that’ll be your LVM root partition. Pick whichever file-system you like. After that it should bring you back to the same screen. It’s important to designate your other partitions here. Select /dev/cryptvg/home and format it. Next designate boot, which is essential, otherwise your machine will not work properly. Select '''''/dev/sdx1/''''' (probably /dev/sda1), format it, and type ''/boot''. Now simply install slackware as you normally would until you get to '''Install LILO''' To install the bootloader Lilo select '''''expert''''', then begin. Ignore the optional LILO Append, you probably don’t need to do anything with that. Select ''mbr'', hit confirm when it asks you to confirm /dev/sdx (probably /dev/sda), and keep going through the options until you’re back at the screen where you selected “begin”. Now you have to select '''''Linux: Add a linux partition'''''... and select /dev/cryptvg/root. (/dev/cryptvg/root, NOT /boot). Once that’s been selected, install lilo. . Continue with the installation until you reach a screen listing slackwares installation steps. Eit the installer and select '''''No''''' to get dropped to a command prompt. '''Creating an initrd''' Now we have to fix lilo because of our encryption scheme. chroot /mnt The simple explanation for this command is that you basically just entered the installed system, which is mounted at /mnt. Now you can work on things that are installed on the system. The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure. to create an initrd run /usr/share/mkinitrd/mkinitrd_command_generator.sh it will look similar to this mkinitrd -c -k 4.19.0 -f ext4 -r /dev/cryptvg/root -m usb-storage:xhci- hcd:usbhid:hid_generic:mbcache:jbd2:ext4 -C /dev/sda2 -h /dev/cryptvg/swap -L -u -o /boot/initrd.gz Run the resulting command (yours will surely be different from the example). This will write an image to /boot/initrd.gz in your system which we will use for booting. The '''''-h /dev/cryptvg/swap''''' has been added to enable hibernation. it was not part of the resulting mikinitrd_command_generator.sh command If you need to know what kernel you just installed try uname -a '''Fixing LILO''' Next, you have to edit lilo’s configuration file and point it to the correct places so it knows what to boot with. Don’t forget the initrd line here. (use your preferred editor) vim /etc/lilo.conf Edit the pertinent parts to look like this: image = /boot/vmlinuz-generic-4.19.0 initrd = /boot/initrd.gz root = /dev/cryptvg/root label = Slackware read-only # Partitions should be mounted read-only for checking Above that, there’s an “append” line. Edit it to look something like this: append = "vt.default_utf8=0 resume=/dev/cryptvg/swap" Of course, substituting your kernel where necessary. You can check what you need to put for “image = ” by going to /boot and checking which generic kernel you want to use to boot. Save your changes and exit. Run lilo -v You may get an error or two from lilo, but you can usually ignore these. type exit to leave the chroot and then reboot If something went wrong, you probably configured something incorrectly along the way. To get back into your system and repair lilo or some other part of the system, follow these steps to chroot from installation media cryptsetup luksOpen /dev/sdx2 slackcrypt vgscan --mknodes vgchange -ay lvscan mount /dev/cryptvg/root /mnt mount /dev/cryptvg/home /mnt/home mount /dev/sdx1 /mnt/boot mount -o bind /proc /mnt/proc mount -o bind /sys /mnt/sys mount -o bind /dev /mnt/dev chroot /mnt f97c40a9c73a3c460cc8c68cbfbfc75cc9fedb89 3205 3204 2018-11-14T20:24:22Z Wigums 609 wikitext text/x-wiki [[Category:Tutorials]] '''LVM''' LVM is a tool for logical volume management which includes allocating disks, striping, mirroring and resizing logical volumes. With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes. LVM physical volumes can be placed on other block devices which might span two or more disks. '''LUKS''' LUKS is the standard for Linux hard disk encryption. By providing a standard on-disk-format, it does not only facilitate compatibility among distributions, but also provides secure management of multiple user passwords. LUKS stores all necessary setup information in the partition header, enabling you to transport or migrate data seamlessly. This article assumes that this will be the only operating system installed. Also wherever you see '''''sdx2''''' it is referring to the single large partition (probably /dev/sda2) made in the first step. It also assumes you know your way around the slackware installer. Swap space setup is documented here but note its only needed if you plan to hibernate e.g. a laptop. '''Partitioning''' Boot the installer. Login as '''''root''''' and run cfdisk What you’re doing here is setting up the partitions. Essentially, we’re dividing up the hard drive into a few logical partitions so that certain things can run in certain places, and not be affected by others. In order to create a bootable encrypted drive there needs to be a small partition that is not encrypted, it’s unencrypted and readable, so the computer can use it to figure out how to start the operating system. The first partition to make is a boot partition. Delete every other existing partition (if there are any) and write (again, assuming this will be your only OS). Next, select new and create a primary partition that is relatively small, I usually do 1G (which is rather large but i often juggle multiple kernels). Select ''Beginning'', which puts the partition at the front of the disk. DO NOT forget to make the first partition bootable, otherwise the installation won’t know to use this partition to install the boot scripts and such. Next, create another partition with the remaining space. Follow the same steps, except do not make it bootable and use the rest of the available space. Just hit enter when it asks how much space to use. After you’ve done this, make sure you go down and select '''''write''''' to ensure the changes are made. Then exit cfdisk. It's a good idea for you to rewrite the entire large partition with random data. This is so computer forensics folks cannot determine where encryption starts and stops, making it harder to find out a way to circumvent the encryption and stuff. To do this, run dd if=/dev/urandom of=/dev/sdx2 '''NOTE***''' this can take quite some time. '''LVM / Luks Config''' LVM or Logical Volume Manager is used here to configure volumes inside of the large partition set up earlier (sdx2). LVM makes it easy to separate things internally and keep it all encrypted as one partition. cryptsetup -s 512 -y luksFormat /dev/sdx2 Type '''''YES''''', then decide on a password and type it. Be careful, later on if you put stuff on the drive and you forget your password, it’s gone forever. Such is the nature of encryption. Basically this is setting up luks encryption on /dev/sdx2. cryptsetup luksOpen /dev/sdx2 slackcrypt pvcreate is a linux command used to initialize physical volumes for use by logical volume management (lvm) later. pvcreate /dev/mapper/slackcrypt This creates the volume group “cryptvg”. vgcreate cryptvg /dev/mapper/slackcrypt Create three internal logical volumes, '''''root''''', '''''home''''', and '''''swap'''''. If you have a unique setup and prefer it a different way, just follow the same steps and size them how you want. the sizes used are example only lvcreate -L 20G -n root cryptvg lvcreate -L 2G -n swap cryptvg lvcreate -l 100%FREE -n home cryptvg These will be your '''''/root''''', '''''/home''''', and '''''/swap''''' “partitions”. You can adjust the sizes to whatever you want them to be. I use a pretty large amount of space in root because I have run out of space installing tons of programs before, but I’ve also used tiny root partitions on machines where I didn’t plan on installing much. It really depends, but if you have the extra space I’d do like 20+ just to be on the safe side. The home directory gets everything that’s not allocated to swap or root. Next thing we’ve got to do is make sure some nodes get set so everything knows where things are and what not vgscan --mknodes vgchange -ay make sure the slackware installer can detect the swap partition mkswap /dev/cryptvg/swap '''Slack Setup and Installation''' Run the slackware installer setup the installer will walk you through it from here. it should auto-detect the swap partition we designated Selecting '''''root''''' partition Make sure you select /dev/cryptvg/root here, because that’ll be your LVM root partition. Pick whichever file-system you like. After that it should bring you back to the same screen. It’s important to designate your other partitions here. Select /dev/cryptvg/home and format it. Next designate boot, which is essential, otherwise your machine will not work properly. Select '''''/dev/sdx1/''''' (probably /dev/sda1), format it, and type ''/boot''. Now simply install slackware as you normally would until you get to '''Install LILO''' To install the bootloader Lilo select '''''expert''''', then begin. Ignore the optional LILO Append, you probably don’t need to do anything with that. Select ''mbr'', hit confirm when it asks you to confirm /dev/sdx (probably /dev/sda), and keep going through the options until you’re back at the screen where you selected “begin”. Now you have to select '''''Linux: Add a linux partition'''''... and select /dev/cryptvg/root. (/dev/cryptvg/root, NOT /boot). Once that’s been selected, install lilo. . Continue with the installation until you reach a screen listing slackwares installation steps. Eit the installer and select '''''No''''' to get dropped to a command prompt. '''Creating an initrd''' Now we have to fix lilo because of our encryption scheme. chroot /mnt The simple explanation for this command is that you basically just entered the installed system, which is mounted at /mnt. Now you can work on things that are installed on the system. The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure. to create an initrd run /usr/share/mkinitrd/mkinitrd_command_generator.sh it will look similar to this mkinitrd -c -k 4.19.0 -f ext4 -r /dev/cryptvg/root -m usb-storage:xhci- hcd:usbhid:hid_generic:mbcache:jbd2:ext4 -C /dev/sda2 -h /dev/cryptvg/swap -L -u -o /boot/initrd.gz Run the resulting command (yours will surely be different from the example). This will write an image to /boot/initrd.gz in your system which we will use for booting. The '''''-h /dev/cryptvg/swap''''' has been added to enable hibernation. it was not part of the resulting mikinitrd_command_generator.sh command If you need to know what kernel you just installed try uname -a '''Fixing LILO''' Next, you have to edit lilo’s configuration file and point it to the correct places so it knows what to boot with. Don’t forget the initrd line here. (use your preferred editor) vim /etc/lilo.conf Edit the pertinent parts to look like this: image = /boot/vmlinuz-generic-4.19.0 initrd = /boot/initrd.gz root = /dev/cryptvg/root label = Slackware read-only # Partitions should be mounted read-only for checking Above that, there’s an “append” line. Edit it to look something like this: append = "vt.default_utf8=0 resume=/dev/cryptvg/swap" Of course, substituting your kernel where necessary. You can check what you need to put for “image = ” by going to /boot and checking which generic kernel you want to use to boot. Save your changes and exit. Run lilo -v You may get an error or two from lilo, but you can usually ignore these. type exit to leave the chroot and then reboot If something went wrong, you probably configured something incorrectly along the way. To get back into your system and repair lilo or some other part of the system, follow these steps to chroot from installation media cryptsetup luksOpen /dev/sdx2 slackcrypt vgscan --mknodes vgchange -ay lvscan mount /dev/cryptvg/root /mnt mount /dev/cryptvg/home /mnt/home mount /dev/sdx1 /mnt/boot mount -o bind /proc /mnt/proc mount -o bind /sys /mnt/sys mount -o bind /dev /mnt/dev chroot /mnt When you update your kernel all you have to do is make another initrd (run the same command mkinitrd_commaand_generator.sh gave you earlier with updated kernel info), edit /etc/lilo.conf to reflect the new kernel and run lilo 324d2628d537576e0429b45530a767d5bc6df7a0 Reinstalling Lilo 0 140 3206 3196 2018-11-16T14:06:08Z Wigums 609 wikitext text/x-wiki this covers straight unencrypted installs. just a simple installation with everything installed under / mounted under /dev/sda1. No LVM or additional drives. if you're encrypted or have an otherwise fancy install this wiki expects that you understand the intricacies of your own system. for a more in depth look at how to chroot your installation media (which can be extremely useful for more that just lilo) see [https://docs.slackware.com/howtos:slackware_admin:how_to_chroot_from_media here] '''Chroot method''' insert and boot your installation media login as root when prompted but do not run setup '''Mounting''' ''mount /dev/sdX1 /mnt'' (where /dev/sdx1 is your / partition) ''mount -o bind /dev /mnt/dev'' ''mount -o bind /proc /mnt/proc'' ''mount -o bind /sys /mnt/sys'' '''Chrooting''' Once everything is mounted, we can chroot to it: ''chroot /mnt /bin/bash'' now simply run ''liloconfig'' and follow the prompts '''Booting your system from the installation media''' often times you can boot your system from the installation media as well simply boot the installation media and on the very first page are the following instructions In a pinch, you can boot your system from here with a command like: boot: huge.s root=/dev/sda1 rdinit= ro In the example above, /dev/sda1 is the / Linux partition. once booted run ''liloconfig'' [[Category:Tutorials]] bc337ade0f53f830e2954018029c5a0907bb5044 Main Page 0 1 3207 3176 2019-06-07T17:06:12Z Erik 1 MediaWiki Upgrade wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.31.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:06, 7 June 2019 (UTC) MediaWiki was upgraded to 1.31.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:42, 27 October 2018 (UTC) MediaWiki was upgraded to 1.31.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:59, 16 June 2018 (UTC) MediaWiki was upgraded to 1.30.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 20:21, 11 March 2018 (UTC) MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 48e9c1857413b230f6e7131af66c61f10bb00d2b 3220 3207 2020-03-27T02:15:34Z Erik 1 MediaWiki Upgrade wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.31.7. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:15, 27 March 2020 (UTC) MediaWiki was upgraded to 1.31.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:06, 7 June 2019 (UTC) MediaWiki was upgraded to 1.31.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:42, 27 October 2018 (UTC) MediaWiki was upgraded to 1.31.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:59, 16 June 2018 (UTC) MediaWiki was upgraded to 1.30.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 20:21, 11 March 2018 (UTC) MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 35bb326679b6aa2a1ffe0c371da14d6944fd45ce 3277 3220 2021-09-23T13:46:22Z Erik 1 Update wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on irc.freenode.net. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Freenode ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.36.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 13:46, 23 September 2021 (UTC) MediaWiki was upgraded to 1.31.7. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:15, 27 March 2020 (UTC) MediaWiki was upgraded to 1.31.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:06, 7 June 2019 (UTC) MediaWiki was upgraded to 1.31.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:42, 27 October 2018 (UTC) MediaWiki was upgraded to 1.31.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:59, 16 June 2018 (UTC) MediaWiki was upgraded to 1.30.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 20:21, 11 March 2018 (UTC) MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 585a1ba0b87caf519e8b982f087aeeb9091f1387 3278 3277 2021-09-23T13:51:47Z Erik 1 Freenode is dead. wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on [ircs://irc.libera.chat:6697 Libera Chat]. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Libera Chat ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.36.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 13:46, 23 September 2021 (UTC) MediaWiki was upgraded to 1.31.7. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:15, 27 March 2020 (UTC) MediaWiki was upgraded to 1.31.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:06, 7 June 2019 (UTC) MediaWiki was upgraded to 1.31.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:42, 27 October 2018 (UTC) MediaWiki was upgraded to 1.31.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:59, 16 June 2018 (UTC) MediaWiki was upgraded to 1.30.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 20:21, 11 March 2018 (UTC) MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 5d17ff5998096527c08cfb144964dd4e41570750 Talk:Writing A SlackBuild Script 1 329 3208 2019-06-16T19:23:43Z Captain-sensible 614 maybe document needs updating wikitext text/x-wiki in a recent post on linux.org someone asked how to go about writing a slackbuild script. I thought I would follow this documentation & see how things worked out. The most recent release on github is v2019.2 release date 6th June 2o19. Thus i edited wget link to that download. I've tested $ wget -O latex2html-2019.2.tar.gz https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz and it downloads the tar.gz to my home folder with the name latex2html-2019.2.tar.gz. Also i have successfully created a package latex2html-2019.2-i486-1_SBo.tgz which launched on my 14.2 32 bit slackware box. Now when it came to the actual slackbuild file i used, i tried different approaches including Alien slackbuild kit , mksb and another. Eventually i downloaded latex2html from slackbuild.org for slackware 13 or thereabouts and edited it. Since this slackbuild document references latex2html my thinking is that to further help understand a slackbuild maybe the actual slackbuild for latex would be dissected with explanation. 713edbd209236bd00d314caa1c4cc7081600607c 3213 3208 2019-06-18T09:22:20Z Captain-sensible 614 using page mainly as appendix to main slackbuild doc wikitext text/x-wiki in a recent post on linux.org someone asked how to go about writing a slackbuild script. I thought I would follow this documentation & see how things worked out. I successfully wrote slackbuild and got package visible in /var/log/packages as: /var/log/packages/latex2html-2019.2-i486-1_arb Example GNU general public licence Slackware build script latex2html converts latex docs to html Copyright (C) 2019 <name> <email> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. --[[User:Captain-sensible|Captain-sensible]] ([[User talk:Captain-sensible|talk]]) 09:22, 18 June 2019 (UTC)--[[User:Captain-sensible|Captain-sensible]] ([[User talk:Captain-sensible|talk]]) 09:22, 18 June 2019 (UTC) 6c8549de04552e1d5e4737628afd1e55fe5ddfb7 Writing A SlackBuild Script 0 16 3209 1021 2019-06-16T19:33:45Z Captain-sensible 614 /* Getting Started */ wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like pkgs.org, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget -O latex2html-2019.2.tar.gz [https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz] #6 th June 2019 release Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar -xzf latex2html-2002-2-1.tar.gz || exit 1 = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ 97772372f581555dfa918fb939b1f72d66f4315e 3210 3209 2019-06-17T10:36:28Z Captain-sensible 614 /* Getting Started */ wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like pkgs.org, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget -O latex2html-2019.2.tar.gz [https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz] #6 th June 2019 release Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar xvzf latex2html-2019.2.tar.gz || exit 1 x -extract v -verbose f -file z -basically ungzip = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ 5ebac7e93eceedaba173f70a61df375f24a550cf 3211 3210 2019-06-18T08:21:07Z Captain-sensible 614 /* Introduction */ wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) Those that really know what they are doing are unlikely to need to read this document; as a noob I've read through and successfully created a slackbuild and package.Some of the text needs updating,which i will have a go at in the knowledge that it should be able to be reversed via the history data. I will update from the perspective that a noob is reading and they may need some spoon feeding! If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like pkgs.org, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget -O latex2html-2019.2.tar.gz [https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz] #6 th June 2019 release Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar xvzf latex2html-2019.2.tar.gz || exit 1 x -extract v -verbose f -file z -basically ungzip = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ 03330c8046c6490fa3f7ba905d456c329a4bf044 3212 3211 2019-06-18T09:13:18Z Captain-sensible 614 /* Initial Setup */ wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) Those that really know what they are doing are unlikely to need to read this document; as a noob I've read through and successfully created a slackbuild and package.Some of the text needs updating,which i will have a go at in the knowledge that it should be able to be reversed via the history data. I will update from the perspective that a noob is reading and they may need some spoon feeding! If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like pkgs.org, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget -O latex2html-2019.2.tar.gz [https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz] #6 th June 2019 release Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar xvzf latex2html-2019.2.tar.gz || exit 1 x -extract v -verbose f -file z -basically ungzip = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license.For the sake of brevity an example has been put on discussion page ), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=2002-2-1 # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. ARCH=${ARCH:-i486} # the architecture on which you want to build your package # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ b435e0b851ee34783912c0b251b9b5613dd7e85f 3214 3212 2019-06-18T09:46:31Z Captain-sensible 614 /* Writing the SlackBuild script */ wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) Those that really know what they are doing are unlikely to need to read this document; as a noob I've read through and successfully created a slackbuild and package.Some of the text needs updating,which i will have a go at in the knowledge that it should be able to be reversed via the history data. I will update from the perspective that a noob is reading and they may need some spoon feeding! If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like pkgs.org, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget -O latex2html-2019.2.tar.gz [https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz] #6 th June 2019 release Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar xvzf latex2html-2019.2.tar.gz || exit 1 x -extract v -verbose f -file z -basically ungzip = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license.For the sake of brevity an example has been put on discussion page ), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=${VERSION:-2019-2} # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) ARCH=$( uname -m ) ;; esac fi # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ 3b367e13682ca475f41e0a7ea715ba9cdb2229cc 3215 3214 2019-06-18T09:48:44Z Captain-sensible 614 /* Initial Setup */ wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) Those that really know what they are doing are unlikely to need to read this document; as a noob I've read through and successfully created a slackbuild and package.Some of the text needs updating,which i will have a go at in the knowledge that it should be able to be reversed via the history data. I will update from the perspective that a noob is reading and they may need some spoon feeding! If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like pkgs.org, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget -O latex2html-2019.2.tar.gz [https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz] #6 th June 2019 release Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar xvzf latex2html-2019.2.tar.gz || exit 1 x -extract v -verbose f -file z -basically ungzip = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license.For the sake of brevity an example has been put on discussion page ), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=${VERSION:-2019.2} # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) ARCH=$( uname -m ) ;; esac fi # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ b16ab5e503c7e426c71f077672f6b39cc6662e55 3216 3215 2019-06-18T13:46:13Z Captain-sensible 614 /* SlackBuild Script Repositories */ wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) Those that really know what they are doing are unlikely to need to read this document; as a noob I've read through and successfully created a slackbuild and package.Some of the text needs updating,which i will have a go at in the knowledge that it should be able to be reversed via the history data. I will update from the perspective that a noob is reading and they may need some spoon feeding! If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like pkgs.org, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget -O latex2html-2019.2.tar.gz [https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz] #6 th June 2019 release Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar xvzf latex2html-2019.2.tar.gz || exit 1 x -extract v -verbose f -file z -basically ungzip = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license.For the sake of brevity an example has been put on discussion page ), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=${VERSION:-2019.2} # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) ARCH=$( uname -m ) ;; esac fi # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ ;*https://github.com/captain-sensible/latex2html.SlackBuild the last link is intended for noobs reading this document and wanting to download a working slackbuild for latex2html which was based on this tutorial. Its been tested on current stable Slackware 14.2 32 bit 852a6d8ec77415842ce6b3c2e2474d284bf48174 3217 3216 2019-06-23T14:40:54Z Captain-sensible 614 /* SlackBuild Script Repositories */ wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) Those that really know what they are doing are unlikely to need to read this document; as a noob I've read through and successfully created a slackbuild and package.Some of the text needs updating,which i will have a go at in the knowledge that it should be able to be reversed via the history data. I will update from the perspective that a noob is reading and they may need some spoon feeding! If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like pkgs.org, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget -O latex2html-2019.2.tar.gz [https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz] #6 th June 2019 release Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar xvzf latex2html-2019.2.tar.gz || exit 1 x -extract v -verbose f -file z -basically ungzip = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license.For the sake of brevity an example has been put on discussion page ), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=${VERSION:-2019.2} # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) ARCH=$( uname -m ) ;; esac fi # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ ;*https://slackbuilds.org/repository/14.2/academic/latex2html/?search=latex2html the last link is intended for noobs reading this document and wanting to download a working slackbuild for latex2html which was based on this tutorial. Its been tested on current stable Slackware 14.2 32 bit 201c4462532f81152dde05877070dd68a5e75230 3218 3217 2019-11-04T20:25:53Z Rworkman 13 Undo revision 3211 by [[Special:Contributions/Captain-sensible|Captain-sensible]] ([[User talk:Captain-sensible|talk]]) - I'm not necessarily opposed to this text, but it needs attribution - as it was, it appeared to be written by me. -RW wikitext text/x-wiki [[Category:Tutorials]] = Introduction = Originally written by Florian Mueller jjdm@jjdm.org Substantial cleanup and enhancement by Robby Workman (rworkman) If you use slackware as your main operating system, you have probably wanted to install quite a few applications which are not available in the official slackware.com or even third-party repositories like pkgs.org, or perhaps you just don't like using third-party packages. In this situation, you have several options on how to install the application: * ./configure && make && make install * use checkinstall * use installwatch * compile and use makepkg by hand * write a SlackBuild script I will go through the last option: writing [[SlackBuild Scripts]] (which combines the best qualities of all the other aforementioned methods). With a SlackBuild script, you have the build process automated, which will allow you to easily do later upgrades or patches to the package. SlackBuild scripts are also the method by which Patrick Volkerding builds all of the official packages for Slackware. If you look at the various scripts from different sources, you will notice that there is generally an application-independent portion of a script and an application-specific portion of the script. I cannot teach you how to build the "perfect" package, as reaching that goal requires fairly in-depth knowledge of the Slackware operating system. You must consider the interactions of your proposed package with all of the other packages within the distribution; they must be integrated seamlessly. What I can teach you is how to build a package that works and which stays true to the "Slackware Way." "But it takes so much time!" It will take approximately thirty minutes to go through this tutorial and about fifteen minutes to create each package (actual compile process not included), but the time you save in the future (you want to create a newer version of the package) makes the initial time expenditure worth it. = The Slackware package structure = See [[Packages#Slackware Package Layout]] = Setting up your build environment = See [[Build_Environment]] for examples of how various users do this. = Getting Started = Hopefully, everything is now clear about Slackware package structure, and you have set up a clean build environment, so we'll begin the process of building a package with a SlackBuild script. For this example, we'll create a package of latex2html - I made my homepage with that tool. First, you have to create a directory named <build_environment>/latex2html/. Get the most recent source code release of latex2html place it in this directory. Note that use of wget below to obtain the most recent source code is optional - you can just as well use your favorite web browser to download it, and then move it into the correct directory. $ cd <build_environment> $ mkdir latex2html $ cd latex2html $ wget -O latex2html-2019.2.tar.gz [https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz] #6 th June 2019 release Next, we'll create some other needed files with touch. If you're not familiar with touch, see: man touch Note that the *.SlackBuild file will always contain the name of the application for which it's written; for example, gaim would have gaim.SlackBuild. $ touch latex2html.SlackBuild $ touch slack-desc Extract the source code of the application, because we'll need to look at the configure script later on to determine what options we need to pass to it. $ tar xvzf latex2html-2019.2.tar.gz || exit 1 x -extract v -verbose f -file z -basically ungzip = Writing the slack-desc file = See this [[Slack-desc]] page on SlackWiki.org for instructions on how to write a proper slack-desc file. = Writing the SlackBuild script = This is the section which takes the most time, and I'll go through it with you step by step. When you build more packages, you'll probably be able to just copy an existing SlackBuild script and customize it. First, you need to understand that you can write your SlackBuild script in any manner you choose so long as it creates a working package; the method described here is more or less the way Pat Volkerding [[http://slackware.com/~volkerdi]] does it, but even Pat has several different styles for writing the official SlackBuild scripts. Therefore, if you see something you would do a different way, feel free to do it that way - it's okay. ===Initial Setup=== Open the file latex2html.SlackBuild with your favourite editor. What follows below is a piece by piece walk-through of a working SlackBuild script. You may certainly paste the exact contents of those pieces, but in the author's opinion, you have a better chance of understanding it if you write everything yourself. First, you'll need to set your shell interpreter. This should be /bin/sh, as *every* Slackware system is guaranteed to have this shell installed, and you want maximum portability. For this same reason, be careful not to use any extensions and/or syntax that is customized for your particular shell (bash, zsh, or whatever), as it won't be interpreted correctly. The '-e' flag tells the shell to exit on any error; this helps with both debugging your script as well as ensuring your script does not proceed in an unknown state. #!/bin/sh -e You might want to include a license of some sort with your SlackBuild script (preferably a GPL or BSD-style license.For the sake of brevity an example has been put on discussion page ), but at a minimum, you'll want something like this: #<your name> revision date yyyy/mm/dd With the next few lines, we set some variables that will be used throughout the script. First is the "CWD" variable; in our case, CWD will be <build_environment>/latex2html/. We also test if the TMP variable is set, and if not, we set it to /tmp. #Set initial variables: CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi Some people like to build in a subdirectory of /tmp (such as /tmp/build), but that's up to you. # The version which appears in the application's filename VERSION=${VERSION:-2019.2} # If the version conflicts with the Slackware package standard # The dash character ("-") is not allowed in the VERSION string # You can set the PKG_VERSION to something else than VERSION PKG_VERSION=2002.2.1 # the version which appears in the package name. # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) ARCH=$( uname -m ) ;; esac fi # First digit is the build number, which specifies how many times it has been built. # Second string is the short form of the authors name, typical three initials:w BUILD=${BUILD:-1_rlw} # The application's name APP=latex2html # The installation directory of the package (where its actual directory # structure will be created) PKG=$TMP/package-$APP Set SLKCFLAGS (which will be used for both CFLAGS and CXXFLAGS). If you are building on a system with an earlier version of gcc than 3.4.x, then you'll need to use "-mcpu" instead of "-mtune" below. if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi The section just finished sets up a few application-specific variables. When you want to create a package of some other application, you can usually just change the variables, and most of the further steps will work automatically. === Extract Sources === # Delete the leftover directories if they exist (due to a previous build) # and (re)create the packaging directory rm -rf $PKG mkdir -p $TMP $PKG rm -rf $TMP/$APP-$VERSION # Change to the TMP directory cd $TMP || exit 1 # Extract the application source in TMP # Note: if your application comes as a tar.bz2, you need tar -jxvf tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 # Change to the application source directory cd $APP-$VERSION || exit 1 # Change ownership and permissions if necessary # This may not be needed in some source tarballs, but it never hurts chown -R root:root . chmod -R u+w,go+r-w,a-s . ===Configure and Compile Sources=== # Set configure options # If your app is written in C++, you'll also need to add a line for CXXFLAGS CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --with-perl=/usr/bin/perl \ --enable-eps \ --enable-gif \ --enable-png \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux # compile the source, but exit if anything goes wrong make || exit # Install everything into the package directory, but exit if anything goes wrong make install DESTDIR=$PKG || exit There are three configure options I always set: * --prefix=/usr * --sysconfdir=/etc * --localstatedir=/var This makes configuration files go to /etc, state files (such as log files) go to /var, and the rest goes to /usr. That's the usual Slackware way, but it's your system, so you can certainly install everything in /usr/local or some other location. See the Unix Filesystem Hierarchy Standard [[http://www.pathname.com/fhs/]] for more information on "correct" locations of various filetypes. You notice that there were several other options passed to the configure script, and for each application you compile, you have to figure those out for yourself - that's why you were told to extract the sources earlier in this process. You simply cd into the source directory and run: ./configure --help This will produce a page or two (sometimes more, though) of information about various options that are specific to the application. Read through this information and figure out what you need (I like to pipe that command through lpr to get a printed copy, but you can certainly use some sort of pager as well: ./configure --help | lpr ./configure --help | less The DESTDIR variable is very important in this script because it specifies the directory in which the files should be installed. This should always be our package directory ($PKG). Unfortunately, some applications' Makefiles will not support the DESTDIR variable, so you can't use it for those apps. A simple line like this: grep DESTDIR Makefile* while inside the source directory should tell you whether it supports DESTDIR or not. If you get some lines of output with $DESTDIR in them, you're in good shape. If the command returns no output, then the Makefile does not support the DESTDIR variable. Here's a piece of advice: ALWAYS go through the ./configure && make && make install DESTDIR=/somedir process manually and as a NORMAL USER account BEFORE you run your SlackBuild script. There are quite a few applications out there which try to do "funny stuff" during the installation phase. For example, apcupsd will attempt to patch your /etc/rc.d/rc.6 init script Yes, it's possible to avoid this with a configure option, but it's not obvious that you would need to do so until you look at all of the Makefiles for apcupsd (or watch the install process) Anyway, if you go through the process as a normal user, you will get "Permission Denied" errors and such if the install process tries to write anywhere it's not allowed to do so. === Install Documentation === # Create a directory for documentation mkdir -p $PKG/usr/doc/$APP-$VERSION # Copy documentation to the docs directory and fix permissions cp -a BUGS Changes FAQ INSTALL LICENSE MANIFEST README TODO docs/ $PKG/usr/doc/$APP-$VERSION find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; I (rworkman) also like to place a copy of my SlackBuild script in this directory cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild Make sure you look inside the actual source archive of the application, because some applications won't have all of the documentation files specified above, and some applications will have additional files. In other words, don't just copy/paste what you see above into your SlackBuild script - you *must* customize this section for each individual application. === Final Touches === # Create the ./install directory and copy the slack-desc into it mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc NOTE: In some cases, you will have some sort of command or setup that needs to run after the package contents are installed - for this, you would add a file to $CWD called "doinst.sh" which contains the needed commands, and then compress that file with gzip. The SlackBuild script will zcat (which means to gunzip and cat its contents) that file and write the output to a doinst.sh file in the $PKG/install directory. # Add doinst.sh to package (if it exists) if [ -e $CWD/doinst.sh.gz ]; then zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh fi Let's conserve space if we can; strip libraries and binaries and compress man pages with gzip Note that you might be able to use "make install-strip" instead of "make install" above instead to accomplish the same purpose # Strip some libraries and binaries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man pages if they exist if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) fi # Compress info pages if they exist (and remove the dir file) if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi === Build the Package === # Build the package cd $PKG /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz = Other Concerns = === DESTDIR Option Not Available === As mentioned above, there are quite a few applications whose Makefiles do not support the DESTDIR option for make install. On some applications the DESTDIR Makefile variable has another name. For example, some Qt applications use the variable INSTALL_ROOT for the same purpose. If you can understand Makefiles, it is probably worth your time to take a look at its contents and try to find out which actions are performed in the install rule. Sometimes there will be no DESTDIR equivalent at all. The <strong>best</strong> thing you can do in this situation is write a patch for the Makefile.in or equivalent, and submit it to the developer(s) for inclusion in the source, but I realize that everyone doesn't have the ability to do that. The second best thing you can do it write to the developer(s) and ask them to include that functionality in future releases. In the meantime, here are some thoughts on the subject... ==== Example 1: ==== Configure the build with: ./configure --prefix=$PKG/usr along with your other configure options. This will install *all* of the package contents in that directory. If the package creates $PKG/usr/etc and $PKG/usr/var directories (or any other directories that should be elsewhere), you can probably just move them to their correct location within the package directory tree and everything will be fine. You might also try this along with your other configure options. ./configure --prefix=$PKG/usr \ --sysconfdir=$PKG/etc \ --localstatedir=$PKG/var There are some applications, however, which "hard-code" configuration files based on configure/Makefile parameters. In those cases, you'll have to figure out a way to patch the config file prior to packaging it, or in worst-case scenario, include instructions for the end user on how to make the necessary changes. ==== Example 2: ==== This example makes use of the ability to override any Makefile variable, which is called a '''macro''' in the Makefile terminology, on the command line and not have to worry about patching the Makefile to include a '''DESTDIR''' macro in the Makefile. This approach makes it a bit easier for those not familiar with Makefiles. If the Makefile does not honor '''DESTDIR''' for the 'make install' command, you can change the prefix macro, instead: make prefix=$PKG/usr install This will override the $(prefix) variable inside the Makefile and install to the location you supplied on the command line. Therefore, you can configure with the standard ''./configure --prefix=/usr'' (or ''./configure --prefix=/usr/local'') syntax, yet install to a different location as if you supplied a ''DESTDIR=$PKG/usr'' for the 'make install' command. IMPORTANT NOTE: Macro names are case-sensitive (at least for GNU make). Some Makefiles may use a "'''PREFIX ='''" macro instead of the usual "'''prefix ='''", so the 'make install' command would look like this: make PREFIX=$PKG/usr install Therefore, it's necessary to look inside the Makefile to be sure which form was used for the prefix. For large, complex makefiles, the easiest way is to 'grep' the Makefile, like so: grep -i '^prefix \?=' Makefile{,.in} The ''-i'' option makes the search case-insensitive and the ''{,.in}'' part at the end will search "Makefile" or "Makefile.in" files, the second one being a template for the "configure" script. Grep's search term is a basic regular expression, so the escaped question mark after the space (\?) means there may or may not be a space in between when searching. Once in a while, there may be a "'''PREFIX ='''" in a Makefile that is not defined which you are to edit and supply the location. Use the usual ''/usr'' (or ''/usr/local''), in this case, and then use 'make PREFIX=$PKG/usr install' to install to the package's build location. === Patching the Sources === Sooner or later, there will be some reason to patch the source code prior to building a package, and you'll want to be able to do this automatically. ===== Obtaining the Patch ===== In most cases, the patch will be provided by the author of the source code, so we're not going to discuss patch *creation* here. Download the patch and place it in the same directory as the SlackBuild script, slack-desc file, and other related files (in $CWD from above). $ wget http://someapplication.org/files/patches/bigsecuritypatch.diff It's not necessary to do the next step, but because developers generally want to conserve space if possible, it's conventional to do this: $ gzip -9 bigsecuritypatch.diff This will result in a new file called bigsecuritypatch.diff.gz -- we'll use that in the SlackBuild script in just a moment. ===== Applying the Patch ===== You will now need to edit your <application>.SlackBuild script so that it applies the patch before it runs configure, make, and make install. To do this, you'll want something like this to run before the configure script, but after extracting the sources: zcat $CWD/bigsecuritypatch.diff.gz | patch -p1 || exit Depending on how the patch was created, you might use a different patchlevel on that line, as in: zcat $CWD/bigsecuritypatch.diff.gz | patch -p0 || exit It's a bit beyond the scope of this HOWTO, but essentially, the -p# specifies the number of trailing directories to skip when looking for the file to patch. You'll often need to skip the top-level directory, but not always (hence the -p0). = See Also = * [[SlackBuild_Scripts]] * [[Different_Approach_To_Buildscripts]] * [[Building_A_Package]] * [[Slack-desc]] * [[Checkinstall]] * [[Compiling]] = SlackBuild Script Repositories = ;* http://slackbuilds.org ;* http://www.slackware.com/~alien/slackbuilds/ ;* http://slackbuilds.slackadelic.com/ ;* http://slackbuilds.rlworkman.net/ ;*https://slackbuilds.org/repository/14.2/academic/latex2html/?search=latex2html the last link is intended for noobs reading this document and wanting to download a working slackbuild for latex2html which was based on this tutorial. Its been tested on current stable Slackware 14.2 32 bit 627282d3b2b543bc9efbfffc94b9fb318fac6095 Icecream 0 330 3219 2020-02-09T16:10:59Z Wigums 609 Created page with "Icecream was created by SUSE based on distcc. Like distcc, Icecream takes compile jobs from a build and distributes it among remote machines allowing a parallel build. But unl..." wikitext text/x-wiki Icecream was created by SUSE based on distcc. Like distcc, Icecream takes compile jobs from a build and distributes it among remote machines allowing a parallel build. But unlike distcc, Icecream uses a central server that dynamically schedules the compile jobs to the fastest free server. This advantage pays off mostly for shared computers, if you're the only user on x machines, you have full control over them. icecream comes installed on slackware and is super easy to setup you need one master and atleast one slave but you may have many many slaves. also all your machines need to use the same domain such as .localdomain or i just use .org you need the rc.iceccd running on all machines even the master so chmod +x /etc/rc.d/rc.iceccd and make sure its running /etc.rc.d.rc.iceccd restart and on the master machine you need the scheduler running chmod +x /etc/rc.d/rc.icecc-scheduler and make sure the shceduler is running on the master machine /etc/rc.d/rc.icecc-scheduler restart now you need to set your make jobs. this is a big topic and wont be covered here. however as an example i use sbotools so in its sbotools.conf i set '''JOBS=N+1''' where N is the total number of cores across all machines. you may set MAKE -jN elsewhere thats it. now build something 2e3757e997613b4e860d7dfb609d3cec0339c126 Talk:ZFS root 1 331 3221 2020-05-20T14:07:29Z Dchmelik 32 Created page with "This is a very good tutorial/HOWTO, though would need to be updated (some things have changed.) I'd also like to see one for ZFS more in general, like for any/all partitions,..." wikitext text/x-wiki This is a very good tutorial/HOWTO, though would need to be updated (some things have changed.) I'd also like to see one for ZFS more in general, like for any/all partitions, particularly /home, maybe a swap partition, and in the case one also uses both on classic *BSD. I wish it was as simple as mkfs.zfs but it seems like there's a set of 100+ options (and in the case of dual-boot, you have to choose the intersection of both... if you even want many such options, and it probably only works to setup on one first... probably Slackware.) 6db6a8ad0fb5c21c0b529bab3f800017cb211b1d 3222 3221 2020-05-20T14:09:03Z Dchmelik 32 wikitext text/x-wiki This is a very good tutorial/HOWTO, though would need to updating (some things changed.) I'd also like to see one for ZFS in general, like any/all partitions, particularly /home and maybe swap partition, and in the case one uses both with classic *BSD dual-boot with Slackware. I wish it was as simple as mkfs.zfs but seems like there's a set of 100+ options (and in case of dual-boot, one must choose intersection of both... if one even wants many such options, and probably only works to setup on one first... probably Slackware)--[[User:Dchmelik|Dchmelik]] ([[User talk:Dchmelik|talk]]) 14:09, 20 May 2020 (UTC) b7bce85498de8552604b135698090c1d56b70044 3224 3222 2020-05-20T14:12:55Z Dchmelik 32 wikitext text/x-wiki This is a very good tutorial/HOWTO, though would need updating (things changed.) I'd also like to see a general ZFS one, like any/all partitions, particularly /home and maybe swap partitions, and in case one uses both with classic *BSD Unix & Slackware dual-boot. I wish it was as simple as mkfs.zfs but seems there's a set of 100+ options varying by operating system (OS, and in case of dual-boot, one must choose sets' intersection... if one even wants many options, and probably only works to setup on Slackware first)--[[User:Dchmelik|Dchmelik]] ([[User talk:Dchmelik|talk]]) 14:12, 20 May 2020 (UTC) 4823452d8f2123c20a09efaf245eb203a39915c3 The Regulars 0 4 3223 867 2020-05-20T14:09:45Z Dchmelik 32 /* Others */ wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Adioe3|adioe3]] * [[User:Alisonken1|Alisonken1]] * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[User:Clientkill|Clientkill]] * [[USer:codermaniac|codermaniac]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|DarwinElf]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:Erik|erik]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jcm |jcm]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[User:natex|natex]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:robert-brown|robert-brown]] * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. 970328ddc7685fa1abcfbc23018c2f9640d3b163 Fonts update 0 332 3225 2020-05-20T14:17:43Z Dchmelik 32 script to update fonts wikitext text/x-wiki #!/bin/sh #updatefonts mkfontdir mkfontscale fc-cache -f -v 980ec289ea64858ddd7f9f071df228e2a3696374 3226 3225 2020-05-20T14:18:09Z Dchmelik 32 wikitext text/x-wiki <pre>#!/bin/sh #updatefonts mkfontdir mkfontscale fc-cache -f -v</pre> 979e05d6acee075857c0c04a4ee9605c0ee4bafd 3227 3226 2020-05-20T14:20:42Z Dchmelik 32 wikitext text/x-wiki <pre>#!/bin/sh #updatefonts mkfontdir mkfontscale #Scan directories with apparently valid caches (-f, --force,) verbose (-v, --verbose) (see also (-r, really-force: ) fc-cache -f -v</pre> 77a84e826e2452a13dd59747ef71fcd3bd6b024f 3228 3227 2020-05-20T14:21:15Z Dchmelik 32 wikitext text/x-wiki <pre>#!/bin/sh #updatefonts mkfontdir mkfontscale #Scan directories with apparently valid caches (-f, --force,) verbose (-v, --verbose) (see also (-r, really-force, -s --system-only: ) fc-cache -f -v</pre> 4f94863b404de50b5cc1d393ac7817f08f77b14b 3229 3228 2020-05-20T14:21:51Z Dchmelik 32 wikitext text/x-wiki <pre>#!/bin/sh #updatefonts mkfontdir mkfontscale #Scan directories with apparently valid caches (-f, --force,) verbose (-v, --verbose) (see also man fc-cache:) fc-cache -f -v</pre> 321af9ddd59e334f2f8fcfe58e12a17dacf0ba42 3230 3229 2020-05-20T14:22:00Z Dchmelik 32 wikitext text/x-wiki <pre>#!/bin/sh #updatefonts mkfontdir mkfontscale #Scan directories with apparently valid caches (-f, --force,) verbose (-v, --verbose) (see also man fc-cache: ) fc-cache -f -v</pre> 49e73b3230474ad58a27879c1a9c3baa4f752a3c 3231 3230 2020-05-20T14:23:20Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre>#!/bin/sh #updatefonts mkfontdir mkfontscale #Scan directories with apparently valid caches (-f, --force,) verbose (-v, --verbose) (see also man fc-cache: ) fc-cache -f -v</pre> 634d1cf8d8ae2e36bd2f4ac2d308a134d9fd6dcf 3234 3231 2020-05-20T14:46:50Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> #!/bin/sh #updatefonts mkfontdir mkfontscale #Scan directories with apparently valid caches (-f, --force,) verbose (-v, --verbose) (see also man fc-cache: ) fc-cache -f -v </pre> 647f82e605ce823520f886e0054cc0f1072e1b9b 3238 3234 2020-05-20T15:04:46Z Dchmelik 32 Dchmelik moved page [[Fonts]] to [[Fonts update]]: better title wikitext text/x-wiki [[Category:Tips]] <pre> #!/bin/sh #updatefonts mkfontdir mkfontscale #Scan directories with apparently valid caches (-f, --force,) verbose (-v, --verbose) (see also man fc-cache: ) fc-cache -f -v </pre> 647f82e605ce823520f886e0054cc0f1072e1b9b Thumbnails 0 333 3232 2020-05-20T14:45:59Z Dchmelik 32 Created page with "#!/bin/sh #For every .jpg in a directory, create a thumbnail (smaller) image at 280 pixels high (or comment out, uncomment similar line, for width: ) #Resize to 280 pixels hei..." wikitext text/x-wiki #!/bin/sh #For every .jpg in a directory, create a thumbnail (smaller) image at 280 pixels high (or comment out, uncomment similar line, for width: ) #Resize to 280 pixels height for file in *.jpg; do convert -resize x280 "$file" "t$file"; done #resize to 280 pixels width #for file in *.jpg; do convert -resize 280 "$file" "t$file"; done b3a6840caf0be86d235bdd2344d9a94868406e9c 3233 3232 2020-05-20T14:46:15Z Dchmelik 32 wikitext text/x-wiki <pre>#!/bin/sh #For every .jpg in a directory, create a thumbnail (smaller) image at 280 pixels high (or comment out, uncomment similar line, for width: ) #Resize to 280 pixels height for file in *.jpg; do convert -resize x280 "$file" "t$file"; done #resize to 280 pixels width #for file in *.jpg; do convert -resize 280 "$file" "t$file"; done</pre> 2147a63a186b60beb7c3c84806d68d27808b645c 3235 3233 2020-05-20T14:47:04Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> #!/bin/sh #For every .jpg in a directory, create a thumbnail (smaller) image at 280 pixels high (or comment out, uncomment similar line, for width: ) #Resize to 280 pixels height for file in *.jpg; do convert -resize x280 "$file" "t$file"; done #resize to 280 pixels width #for file in *.jpg; do convert -resize 280 "$file" "t$file"; done </pre> 3cb2d135bbbe6dbb01f02b3dc7f4170c0e534806 User:Dchmelik 2 334 3236 2020-05-20T14:52:45Z Dchmelik 32 Created page with "IRC ##slackware & #slackbuilds DarwinElf<br> mathematician/computer-scientist<br> http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik<br> http://davidchmelik.com" wikitext text/x-wiki IRC ##slackware & #slackbuilds DarwinElf<br> mathematician/computer-scientist<br> http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik<br> http://davidchmelik.com 22a89bec8dc6db7c074148845eab5156897e03b6 3243 3236 2020-06-06T02:10:27Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [[http://davidchmelik.com David Chmelik]], programmer since 1993 (CWU 2012 BSc.)<br> Unix & Slackware user/programmer/scientist since 1997.<br> Editor/creator of some wiki material since '00s.<br> IRC [[irc://freenode/##slackware ##slackware]] & [[irc://freenode/#slackbuilds #slackbuilds]] & [[irc://freenode/#slackdocs #slackdocs]] DarwinElf<br> Maintainer/creator of [[http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some]] [[http://SlackBuilds.org SlackBuilds]] since '10.<br> [[https://docs.slackware.com/howtos:zfs_home HOWTO: ZFS /home]] 46c6f570e5fedbc5d42d908da91fd66debd51222 3244 3243 2020-06-06T02:12:14Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [[http://davidchmelik.com David Chmelik]], programmer since 1993 (CWU 2012 BSc.)<br> Unix & Slackware user/programmer/scientist since 1997.<br> Editor/creator of some wiki material since '00s.<br> IRC [[irc://freenode/##slackware ##slackware]] & [[irc://freenode/#slackbuilds #slackbuilds]] & [[irc://freenode/#slackdocs #slackdocs]] DarwinElf<br> Maintainer/creator of [[http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some]] [[http://SlackBuilds.org SlackBuilds]] since '10.<br> [[http://docs.slackware.com/wiki:user:dchmelil Slackware docs: ]][[http://docs.slackware.com/howtos:zfs_home HOWTO: ZFS /home]] 88aa17eb95fda2db23b7a0bfd60645cd78130768 3246 3244 2020-06-19T03:37:16Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [[http://davidchmelik.com David Chmelik]], programmer since 1993 (CWU 2012 BSc.)<br> Unix & Slackware user/programmer/scientist since 1997.<br> Editor/creator of some wiki material since '00s.<br> IRC [[irc://freenode/##slackware ##slackware]] & [[irc://freenode/#slackbuilds #slackbuilds]] & [[irc://freenode/#slackdocs #slackdocs]] DarwinElf<br> Maintainer/creator of [[http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some]] [[http://SlackBuilds.org SlackBuilds]] since '10.<br> [[Decompress many]]<br> [[Fonts update]]<br> [[Git pull writable]]<br> [[Thumbnails]]<br> [[http://docs.slackware.com/wiki:user:dchmelil Slackware docs: ]][[http://docs.slackware.com/howtos:zfs_home HOWTO: ZFS /home]] 74077356e621b5eaf66bdbd550d980cd220525d8 3247 3246 2020-06-19T03:37:34Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [[http://davidchmelik.com David Chmelik]], programmer since 1993 (CWU 2012 BSc.)<br> Unix & Slackware user/programmer/scientist since 1997.<br> Editor/creator of some wiki material since '00s.<br> IRC [[irc://freenode/##slackware ##slackware]] & [[irc://freenode/#slackbuilds #slackbuilds]] & [[irc://freenode/#slackdocs #slackdocs]] DarwinElf<br> Maintainer/creator of [[http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some]] [[http://SlackBuilds.org SlackBuilds]] since '10.<br> [[Decompress many]]<br> [[Fonts update]]<br> [[Git pull writable]]<br> [[Thumbnails]]<br> [[http://docs.slackware.com/wiki:user:dchmelil Slackware.com Docs: ]][[http://docs.slackware.com/howtos:zfs_home HOWTO: ZFS /home]] 18a2a9998ea88108ad44bceb98a47256d24a50e7 3248 3247 2020-06-19T03:37:59Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [[http://davidchmelik.com David Chmelik]], programmer since 1993 (CWU 2012 BSc.)<br> Unix & Slackware user/programmer/scientist since 1997.<br> Editor/creator of some wiki material since '00s.<br> IRC [[irc://freenode/##slackware ##slackware]] & [[irc://freenode/#slackbuilds #slackbuilds]] & [[irc://freenode/#slackdocs #slackdocs]] DarwinElf<br> Maintainer/creator of [[http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some]] [[http://SlackBuilds.org SlackBuilds]] since '10.<br> *HOWTOS [[http://docs.slackware.com/wiki:user:dchmelil Slackware.com Docs: ]][[http://docs.slackware.com/howtos:zfs_home ZFS /home]] *tips [[Decompress many]]<br> [[Fonts update]]<br> [[Git pull writable]]<br> [[Thumbnails]]<br> 2d8856d03c6f4a3aea4a169e093e0b007f1853c9 3249 3248 2020-06-19T03:38:15Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [[http://davidchmelik.com David Chmelik]], programmer since 1993 (CWU 2012 BSc.)<br> Unix & Slackware user/programmer/scientist since 1997.<br> Editor/creator of some wiki material since '00s.<br> IRC [[irc://freenode/##slackware ##slackware]] & [[irc://freenode/#slackbuilds #slackbuilds]] & [[irc://freenode/#slackdocs #slackdocs]] DarwinElf<br> Maintainer/creator of [[http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some]] [[http://SlackBuilds.org SlackBuilds]] since '10.<br> *HOWTOS [http://docs.slackware.com/wiki:user:dchmelil Slackware.com Docs: ][http://docs.slackware.com/howtos:zfs_home ZFS /home] *tips [[Decompress many]]<br> [[Fonts update]]<br> [[Git pull writable]]<br> [[Thumbnails]]<br> 4f4a7edefe0a4dc3e5e196d8f32e9c74ef641c5b 3250 3249 2020-06-19T03:41:45Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [[http://davidchmelik.com David Chmelik]], programmer since 1993 (CWU 2012 BSc.)<br> *Unix & Slackware user/programmer/scientist since 1997.<br> *Editor/creator of some wiki material since '00s.<br> *IRC [[irc://freenode/##slackware ##slackware]] & [[irc://freenode/#slackbuilds #slackbuilds]] & [[irc://freenode/#slackdocs #slackdocs]] DarwinElf<br> *Maintainer/creator of [[http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some]] [[http://SlackBuilds.org SlackBuilds]] since '10.<br> HOWTOS *[http://docs.slackware.com/wiki:user:dchmelil Slackware.com Docs: ][http://docs.slackware.com/howtos:zfs_home ZFS /home] tips *[[Decompress many]]<br> *[[Fonts update]]<br> *[[Git pull writable]]<br> *[[Thumbnails]]<br> 58f687a00712475235426267dd9b1582ac925d01 Git clone writable 0 335 3237 2020-05-20T15:03:28Z Dchmelik 32 Created page with "[[Category:Tips]] <pre> #Bash function to make git clone writable (annoyingly, if you clone repository, some files are non-user-writable... which after compiling dangerously t..." wikitext text/x-wiki [[Category:Tips]] <pre> #Bash function to make git clone writable (annoyingly, if you clone repository, some files are non-user-writable... which after compiling dangerously tempts 'sudo rm -rf!') git() { if [[ $1=="clone" ]]; then command git "$@" && find */.git -type f -perm ! -u=w -exec chmod u+w {} \; else command git "$@"; fi; } </pre> 28df6874379f3357987bea1a9fcee9fcbadddeac 3241 3237 2020-05-21T11:07:45Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> #Bash function to make git clone writable (annoyingly, if you clone repository, some files are non-user-writable... which after compiling dangerously tempts 'sudo rm -rf!') git() { if [ $1 = "clone" ]; then command git "$@" && find */.git -type f -perm ! -u=w -exec chmod u+w {} \; else command git "$@"; fi; } </pre> bf68f3ebbc55d80c12c8b5cf7d527ddf32d1abda 3242 3241 2020-05-21T11:09:30Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> #Bash function to make git clones writable (annoyingly, if you clone repository, some files are non-user-writable... which after compiling dangerously tempts 'sudo rm -rf!') git() { if [ $1 = "clone" ]; then command git "$@" && find */.git -type f -perm ! -u=w -exec chmod u+w {} \; else command git "$@"; fi; } </pre> c9fdab2a872768ce668418543a9e7b15466415b6 3245 3242 2020-06-19T03:16:19Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> #Bash function to make git clones writable (annoyingly, if you clone repository, some files are non-user-writable... which after compiling dangerously tempts 'sudo rm -rf!') git() { if [ $1 = "clone" ]; then command git "$@" && find */.git -perm u-w -exec chmod u+w "{}" \; else command git "$@"; fi; } </pre> b817aa19b32c2ebfa7d04aa0ddce321e2e5f41b4 3251 3245 2020-06-23T07:22:24Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> #Bash function to make git clones writable (annoyingly, if you clone repository, some files are non-user-writable... which after compiling dangerously tempts 'sudo rm -rf!') git() { if [ $1 = "clone" ]; then command git "$@" && chmod -R u+w */.git; else command git "$@"; fi; } </pre> 6a4e1bb3bf426e479ce6dfe67c3a8234c6142713 Fonts 0 336 3239 2020-05-20T15:04:46Z Dchmelik 32 Dchmelik moved page [[Fonts]] to [[Fonts update]]: better title wikitext text/x-wiki #REDIRECT [[Fonts update]] 00c6b3e9e07ebe6cb2b7bc35f724cb1e968caaaf Decompress many 0 337 3240 2020-05-20T15:32:40Z Dchmelik 32 Created page with "[[Category:Tips]] <pre> #Bash function to decompress (unarchive) may formats. function unarc() { if [ -f $1 ]; then case $1 in *.tar.*) tar xvf $1;; *.bz2) b..." wikitext text/x-wiki [[Category:Tips]] <pre> #Bash function to decompress (unarchive) may formats. function unarc() { if [ -f $1 ]; then case $1 in *.tar.*) tar xvf $1;; *.bz2) bunzip2 $1;; *.gz) gunzip $1;; *.jar) jar xvf $1;; *.lha) lha e $1;; *.tar) tar xvf $1;; *.tar.bz2) tar xvf $1;; *.tar.gz) tar xvf $1;; *.tar.xz) tar xvf $1;; *.tar.Z) tar xvf $1;; *.rar) rar x $1;; *.7z) 7z x $1;; *.tbz2) tar xvf $1;; *.tgz) tar xvf $1;; *.txz) tar xvf $1;; *.xz) unxz $1;; *.Z) uncompress $1;; *.zip) unzip $1;; *) echo '"$1" cannot be extracted.';; esac else echo '"1" cannot be extracted.'; fi } </pre> e2cbbc74e9d0b02bb5bcd72fa2be1b323c38a66e User talk:Erik 3 338 3252 2021-03-08T00:01:00Z Dchmelik 32 Created page with "Is it possible you could make available the wiki logo image so people (such as me) could link to it graphically from their public homepages?--~~~~" wikitext text/x-wiki Is it possible you could make available the wiki logo image so people (such as me) could link to it graphically from their public homepages?--[[User:Dchmelik|Dchmelik]] ([[User talk:Dchmelik|talk]]) 00:01, 8 March 2021 (UTC) 9e89d522a5b3c949d97e541e7753783f65a676af 3253 3252 2021-03-08T13:39:05Z Erik 1 reply wikitext text/x-wiki Is it possible you could make available the wiki logo image so people (such as me) could link to it graphically from their public homepages?--[[User:Dchmelik|Dchmelik]] ([[User talk:Dchmelik|talk]]) 00:01, 8 March 2021 (UTC) : The logo URL is [https://slackwiki.com/images/logo.png https://slackwiki.com/images/logo.png] --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 13:39, 8 March 2021 (UTC) ed05315116271a367fea58dc930c21fc8b876812 Irssi 0 99 3279 121 2021-09-23T13:53:50Z Erik 1 Freenode is dead. wikitext text/x-wiki Irssi Quick tutorial - Based on http://www.irssi.org/documentation == Installation == If you did a full install of Slackware, you may already have irssi, and you can skip to the next section of this guide. However, if typing 'irssi' at the command line returns nothing, you will need to install the program. Irssi is located in the 'n' folder of Slackware mirrors - and once you have downloaded it, you only need to run 'installpkg irssi[tab]' as root to install it. == Usage == To start the client, "irssi" is entered from either the console or any xterm. Connecting is done by the /server command /server irc.libera.chat:6697 , would connect to the libera chat server /connect does the same thing but is used to open a new connection in a new window /disconnect is to leave that server. If the nick or handle is already chosen, just issue /nick somenewhandle , this will change to a new name. Names that are registered on NickServ must be identified by /msg NickServ IDENTIFY <password> Or you can select window #2 by the alt key and number 2 and enter IDENTIFY <password>. N.B alt key 0-10 is for windows 0-10, Alt-q through Alt-o is for 11-19. To join a channel, issue /j #slackware, that will bring you to the wonderful people on Slackware's official channel on the Libera Chat IRC network. Ctrl-X is used to switch between network connections, if you are connected to multiple servers, e.g. irc.libera.chat and another server. /query and /q are used to initiate private convesationa with people. eg. /query linus would open a private chat window with the user 'linus'. /set in the first window, shows all the settings, where by help is found by issuing the command. e.g. /help dcc would bring up information on the dcc commmand. Window management /WINDOW NEW , splits the screen in half this new window will have a number assigned to it, to access just type alt 4, if the window is number 4. /WINDOW CLOSE , this closes the current window. /WINDOW BALANCE , this i am constantly using to keep the windows the same size. /window name hilight, whenever someone types your name in the channel, the line is highlighted in another colour. Don't forget to run the /save command, so that next time irssi loads, all the windows will be there. SET term_force_colors ON, is a very useful command, as certain xterms need this to display the colours correctly. [[Category:Tutorials]] 4e772e3d66f0474324cac83d78f64fbafd0be873 User:Erik 2 2 3280 597 2021-09-25T00:36:48Z Erik 1 Freenode is dead. wikitext text/x-wiki Name: [mailto:erik@sl1200.org Erik Hanson]<br> Web: [http://sl1200.org/~erik/ http://sl1200s.org/~erik/]<br> IRC: [ircs://irc.libera.chat:6697 Libera Chat]<br> <math>\phi_n(\kappa) = \frac{1}{4\pi^2\kappa^2} \int_0^\infty \frac{\sin(\kappa R)}{\kappa R} \frac{\partial}{\partial R}\left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR</math> 4382bb7196356e45bf7909e9d2c5f45418bfe43a 3316 3280 2022-12-15T17:00:38Z Erik 1 http to https wikitext text/x-wiki Name: [mailto:erik@sl1200.org Erik Hanson]<br> Web: [https://sl1200.org/ https://sl1200s.org/]<br> IRC: [ircs://irc.libera.chat:6697 Libera Chat]<br> 8596485293f622661ccf55d5928319c4929e2b4f Grub 0 339 3281 2021-09-25T18:13:26Z Wigums 609 Created page with "'''installing grub on sackware''' grub-install /dev/XXX grub-mkconfig -o /boot/grub/grub.cfg after updating kernel dont forget to run grub-mkconfig -o /boot/grub/..." wikitext text/x-wiki '''installing grub on sackware''' grub-install /dev/XXX grub-mkconfig -o /boot/grub/grub.cfg after updating kernel dont forget to run grub-mkconfig -o /boot/grub/grub.cfg 0fd51f257a76997700bf967e108324793b29f587 3282 3281 2021-09-25T18:18:55Z Wigums 609 wikitext text/x-wiki [[Category:Tutorials]] '''installing grub on sackware''' grub-install /dev/XXX grub-mkconfig -o /boot/grub/grub.cfg after updating kernel dont forget to run grub-mkconfig -o /boot/grub/grub.cfg 16baed8a6f6b6f935f5dd0f925f182d30e6b108e 3284 3282 2021-10-05T02:00:12Z Rworkman 13 speling is dificult wikitext text/x-wiki [[Category:Tutorials]] '''installing grub on slackware''' grub-install /dev/XXX grub-mkconfig -o /boot/grub/grub.cfg after updating kernel dont forget to run grub-mkconfig -o /boot/grub/grub.cfg e90a827d251be2edefa6095a0d8f8c0e890c614e 3401 3284 2025-01-09T14:36:39Z Wigums 609 wikitext text/x-wiki [[Category:Tutorials]] GRUB2 is the latest version of GNU GRUB, the GRand Unified Bootloader. A bootloader is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the operating system kernel. '''installing grub on slackware''' grub-install /dev/XXX grub-mkconfig -o /boot/grub/grub.cfg after updating kernel dont forget to update your initrd then run grub-mkconfig -o /boot/grub/grub.cfg 7612265d243e3ec6e12b355439cda09b824a97aa Main Page 0 1 3283 3278 2021-10-02T15:55:11Z Erik 1 Software Update wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on [ircs://irc.libera.chat:6697 Libera Chat]. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Libera Chat ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.36.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 15:55, 2 October 2021 (UTC) MediaWiki was upgraded to 1.36.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 13:46, 23 September 2021 (UTC) MediaWiki was upgraded to 1.31.7. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:15, 27 March 2020 (UTC) MediaWiki was upgraded to 1.31.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:06, 7 June 2019 (UTC) MediaWiki was upgraded to 1.31.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:42, 27 October 2018 (UTC) MediaWiki was upgraded to 1.31.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:59, 16 June 2018 (UTC) MediaWiki was upgraded to 1.30.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 20:21, 11 March 2018 (UTC) MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 1ac337e919a66c5dc252b547053ef36c62551d91 3285 3283 2021-11-25T18:02:36Z Erik 1 MediaWiki Upgrade wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on [ircs://irc.libera.chat:6697 Libera Chat]. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Libera Chat ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.37.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:02, 25 November 2021 (UTC) MediaWiki was upgraded to 1.36.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 15:55, 2 October 2021 (UTC) MediaWiki was upgraded to 1.36.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 13:46, 23 September 2021 (UTC) MediaWiki was upgraded to 1.31.7. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:15, 27 March 2020 (UTC) MediaWiki was upgraded to 1.31.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:06, 7 June 2019 (UTC) MediaWiki was upgraded to 1.31.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:42, 27 October 2018 (UTC) MediaWiki was upgraded to 1.31.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:59, 16 June 2018 (UTC) MediaWiki was upgraded to 1.30.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 20:21, 11 March 2018 (UTC) MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 7500a7c5af483493c3dfede563f6c23493f0d0ea 3291 3285 2022-04-02T05:14:34Z Erik 1 MediaWiki Upgrade wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on [ircs://irc.libera.chat:6697 Libera Chat]. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Libera Chat ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.37.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 05:14, 2 April 2022 (UTC) MediaWiki was upgraded to 1.37.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:02, 25 November 2021 (UTC) MediaWiki was upgraded to 1.36.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 15:55, 2 October 2021 (UTC) MediaWiki was upgraded to 1.36.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 13:46, 23 September 2021 (UTC) MediaWiki was upgraded to 1.31.7. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:15, 27 March 2020 (UTC) MediaWiki was upgraded to 1.31.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:06, 7 June 2019 (UTC) MediaWiki was upgraded to 1.31.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:42, 27 October 2018 (UTC) MediaWiki was upgraded to 1.31.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:59, 16 June 2018 (UTC) MediaWiki was upgraded to 1.30.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 20:21, 11 March 2018 (UTC) MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 8975545b730697f96380701b266d9a401e4ac406 3292 3291 2022-07-09T19:40:52Z Erik 1 MediaWiki Upgrade wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on [ircs://irc.libera.chat:6697 Libera Chat]. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Libera Chat ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.37.4. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:40, 9 July 2022 (UTC) {| class="mw-collapsible mw-collapsed wikitable" |+ style=white-space:nowrap | Previous upgrades. |- |MediaWiki was upgraded to 1.37.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 05:14, 2 April 2022 (UTC) |- |MediaWiki was upgraded to 1.37.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:02, 25 November 2021 (UTC) |- |MediaWiki was upgraded to 1.36.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 15:55, 2 October 2021 (UTC) |- |MediaWiki was upgraded to 1.36.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 13:46, 23 September 2021 (UTC) |- |MediaWiki was upgraded to 1.31.7. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:15, 27 March 2020 (UTC) |- |MediaWiki was upgraded to 1.31.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:06, 7 June 2019 (UTC) |- |MediaWiki was upgraded to 1.31.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:42, 27 October 2018 (UTC) |- |MediaWiki was upgraded to 1.31.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:59, 16 June 2018 (UTC) |- |MediaWiki was upgraded to 1.30.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 20:21, 11 March 2018 (UTC) |- |MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) |- |MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) |- |MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) |} MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) df932fe54dfd52cfcd7aae860d900798945fc829 3315 3292 2022-10-01T19:30:17Z Erik 1 MediaWiki Upgrade wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on [ircs://irc.libera.chat:6697 Libera Chat]. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Libera Chat ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.38.4. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:30, 1 October 2022 (UTC) {| class="mw-collapsible mw-collapsed wikitable" |+ style=white-space:nowrap | Previous upgrades. |- |MediaWiki was upgraded to 1.37.4. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:40, 9 July 2022 (UTC) |- |MediaWiki was upgraded to 1.37.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 05:14, 2 April 2022 (UTC) |- |MediaWiki was upgraded to 1.37.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:02, 25 November 2021 (UTC) |- |MediaWiki was upgraded to 1.36.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 15:55, 2 October 2021 (UTC) |- |MediaWiki was upgraded to 1.36.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 13:46, 23 September 2021 (UTC) |- |MediaWiki was upgraded to 1.31.7. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:15, 27 March 2020 (UTC) |- |MediaWiki was upgraded to 1.31.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:06, 7 June 2019 (UTC) |- |MediaWiki was upgraded to 1.31.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:42, 27 October 2018 (UTC) |- |MediaWiki was upgraded to 1.31.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:59, 16 June 2018 (UTC) |- |MediaWiki was upgraded to 1.30.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 20:21, 11 March 2018 (UTC) |- |MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) |- |MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) |- |MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) |} MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 0ce16c3961aaee521f75182159e11ec52b370a10 3317 3315 2023-07-06T22:03:37Z Erik 1 wikitext text/x-wiki Welcome to slackwiki! Feel free to [[Special:Userlogin|Create an account or log in]] and edit any of the pages, or add your own (see [http://meta.wikimedia.org/wiki/Help:Starting_a_new_page Starting A New Page]). Come talk to some of us in ##slackware on [ircs://irc.libera.chat:6697 Libera Chat]. When saving changes, please provide a brief summary of your changes in the box provided - it's nice for those sad people who follow [[Special:Recentchanges|RecentChanges]] via RSS. Any questions about the wiki? See the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]. ==Main Sections== Please [[Special:Userlogin|LOG IN]] before adding/editing pages. * [[:Category:Information|Information]] * [[:Category:Tutorials|Tutorials]] * [[:Category:Tips|Tips]] * [[:Category:Security|Security]] * [[:Category:Hardware|Hardware]] * [[Links]] <hr style="width:20em"/> * [[The Regulars|Regulars of Libera Chat ##slackware]] * [[Contest|Logo Contest]] (Finished) ==Thanks== * '''Anyone who contributes to the wiki :)''' ==News== MediaWiki was upgraded to 1.40.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 22:03, 6 July 2023 (UTC) {| class="mw-collapsible mw-collapsed wikitable" |+ style=white-space:nowrap | Previous upgrades. |- |MediaWiki was upgraded to 1.38.4. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:30, 1 October 2022 (UTC) |- |MediaWiki was upgraded to 1.37.4. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:40, 9 July 2022 (UTC) |- |MediaWiki was upgraded to 1.37.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 05:14, 2 April 2022 (UTC) |- |MediaWiki was upgraded to 1.37.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:02, 25 November 2021 (UTC) |- |MediaWiki was upgraded to 1.36.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 15:55, 2 October 2021 (UTC) |- |MediaWiki was upgraded to 1.36.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 13:46, 23 September 2021 (UTC) |- |MediaWiki was upgraded to 1.31.7. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:15, 27 March 2020 (UTC) |- |MediaWiki was upgraded to 1.31.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:06, 7 June 2019 (UTC) |- |MediaWiki was upgraded to 1.31.1. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 18:42, 27 October 2018 (UTC) |- |MediaWiki was upgraded to 1.31.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 17:59, 16 June 2018 (UTC) |- |MediaWiki was upgraded to 1.30.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 20:21, 11 March 2018 (UTC) |- |MediaWiki was upgraded to 1.28.2. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 02:00, 12 May 2017 (UTC) |- |MediaWiki was upgraded to 1.23.5. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 19:34, 26 October 2014 (EDT) |- |MediaWiki was upgraded to 1.19.0. --[[User:Erik|Erik]] ([[User talk:Erik|talk]]) 00:30, 1 June 2012 (EDT) |} MediaWiki was upgraded to 1.18.0. --[[User:Erik|Erik]] 03:44, 17 December 2011 (CST) Patched to 1.16.2. --[[User:Erik|Erik]] 18:53, 1 February 2011 (EST) | Patched to 1.16.5. --[[User:Erik|Erik]] 17:55, 13 June 2011 (CDT) MediaWiki was upgraded to 1.16.1. --[[User:Erik|Erik]] 11:43, 5 January 2011 (CST) Patched to 1.15.3. --[[User:Erik|Erik]] 09:33, 7 April 2010 (UTC) | Patched to 1.15.4. --[[User:Erik|Erik]] 08:31, 30 May 2010 (UTC) | Patched to 1.15.5. --[[User:Erik|Erik]] 23:12, 28 July 2010 (UTC) MediaWiki was upgraded to 1.15.2. --[[User:Erik|Erik]] 00:25, 9 March 2010 (UTC) Sorry for the temporary downtime - we forgot to renew the domain name registration. --[[User:rworkman|rworkman]] 0006, 3 November 2009 (UTC) There has been a reset of the wiki. The database was corrupted. A few pages, all Talk/Discussion pages and all user accounts were lost. --[[User:Erik|Erik]] 23:44, 6 June 2009 (UTC) MediaWiki was upgraded to 1.14.0 --[[User:Erik|Erik]] 16:49, 16 March 2009 (UTC) We've moved! We're now hosted by [http://onyxlight.net/ http://onyxlight.net/] with an upgrade to MediaWiki 1.6.6 and spambot prevention in place. --[[User:Erik|Erik]] 11:33, 22 May 2006 (GMT) The contest has been won by [[User:Marcus|Marcus]]. Admire the logo :) --[[User:FredEmmott|FredEmmott]] 12:36, 24 Feb 2005 (GMT) Updated SlackWiki to MediaWiki 1.4.7 --[[User:FredEmmott|FredEmmott]] 12:01, 21 Jul 2005 (GMT) We're now sharing [http://cardinal.lizella.net cardinal.lizella.net] with several other Slackware projects such as [http://www.slacksec.org SlackSec], the [http://www.slackbook.org Slackware Book Project], and [http://www.slamd64.com Slamd64]. Hopefully this will mean a more reliable and faster wiki --[[User:FredEmmott|FredEmmott]] 19:42, 2 May 2005 (GMT) We're back onto my little UML temporarily, but I've finally judged the contest, congratulations to [[User:Marcus|Marcus]]. Next artwork contest comming soon, please use the [[Talk:Main_Page|main talk page]] for suggestions on more technical contests --[[User:FredEmmott|FredEmmott]] 18:36, 24 Feb 2005 (GMT) Thanks to RackSpace and Michael Shuler - they've generously donated a dedicated server to http://www.slacksec.org, which slackwiki is sharing --[[User:FredEmmott|FredEmmott]] 15:06, 1 Dec 2004 (CST) We are now sharing this server with http://www.slacksec.info - security updates in Pat's absence --[[User:FredEmmott|FredEmmott]] 22:22, 19 Nov 2004 (GMT) We should not have as many problems with server now - I have no choice but to run debian on this server, and apparantly they missed backporting a security patch, so it's now on traditional non-debianified apache 1.3.33 :) --[[User:FredEmmott|FredEmmott]] 18:03, 2 Nov 2004 (GMT) Please feel free to bring our old pages over from [http://slackwiki.org/old/index.php?pagename=HomePage the old site] --[[User:FredEmmott|FredEmmott]] 21:23, 31 Oct 2004 (GMT) Swapped wiki software again because PHPWiki is too buggy --[[User:FredEmmott|FredEmmott]] 21:11, 31 Oct 2004 (GMT) 2cdcf5969416cadf5cfdbdb6effecfabb912d452 Jellyfin 0 340 3286 2022-01-01T15:30:42Z Wigums 609 Created page with "''' jellyfin ''' Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media. It is an alternative to the proprietary Emby and Plex, to provide media from a dedicated server to end-user devices via multiple apps. Jellyfin is descended from Emby's 3.5.2 release and ported to the .NET Core framework to enable full cross-platform support. ''' Installation Process ''' Create a directory in /opt for jellyfin and its files, and en..." wikitext text/x-wiki ''' jellyfin ''' Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media. It is an alternative to the proprietary Emby and Plex, to provide media from a dedicated server to end-user devices via multiple apps. Jellyfin is descended from Emby's 3.5.2 release and ported to the .NET Core framework to enable full cross-platform support. ''' Installation Process ''' Create a directory in /opt for jellyfin and its files, and enter that directory. mkdir /opt/jellyfin cd /opt/jellyfin Download the latest generic Linux build from the release page. The generic Linux build ends with "linux-amd64.tar.gz". The rest of these instructions assume version 10.4.3 is being installed (i.e. jellyfin_10.4.3_linux-amd64.tar.gz). Download the generic build, then extract the archive: wget https://github.com/jellyfin/jellyfin/releases/download/v10.4.3/jellyfin_10.4.3_linux-amd64.tar.gz tar xvzf jellyfin_10.4.3_linux-amd64.tar.gz Create a symbolic link to the Jellyfin 10.4.3 directory. This allows an upgrade by repeating the above steps and enabling it by simply re-creating the symbolic link to the new version. ln -s jellyfin_10.4.3 jellyfin Create four sub-directories for Jellyfin data. mkdir data cache config log Due to the number of command line options that must be passed, it is easiest to create a small script to run Jellyfin. nano jellyfin.sh Then paste the following commands and modify as needed. (i didnt have to modify anything) #!/bin/bash JELLYFINDIR="/opt/jellyfin" FFMPEGDIR="/usr/share/jellyfin-ffmpeg" $JELLYFINDIR/jellyfin/jellyfin \ -d $JELLYFINDIR/data \ -C $JELLYFINDIR/cache \ -c $JELLYFINDIR/config \ -l $JELLYFINDIR/log \ --ffmpeg $FFMPEGDIR/ffmpeg Assuming you desire Jellyfin to run as a non-root user, chmod all files and directories to your normal login user and group. Also make the startup script above executable. (i run it as root. if you choose to run it as root omit the chown command) chown -R user:group * chmod u+x jellyfin.sh Finally you can run it. You will see lots of log information when run, this is normal. Setup is as usual in the web browser. ./jellyfin.sh & in your browser go to localhost:8096 and set up as you wish 1714bcb8186fa5f1c58ae96d66ecda3c7efc1579 3287 3286 2022-01-01T15:34:02Z Wigums 609 wikitext text/x-wiki [[Category:Tutorials]] ''' jellyfin ''' Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media. It is an alternative to the proprietary Emby and Plex, to provide media from a dedicated server to end-user devices via multiple apps. Jellyfin is descended from Emby's 3.5.2 release and ported to the .NET Core framework to enable full cross-platform support. ''' Installation Process ''' Create a directory in /opt for jellyfin and its files, and enter that directory. mkdir /opt/jellyfin cd /opt/jellyfin Download the latest generic Linux build from the release page. The generic Linux build ends with "linux-amd64.tar.gz". The rest of these instructions assume version 10.4.3 is being installed (i.e. jellyfin_10.4.3_linux-amd64.tar.gz). Download the generic build, then extract the archive: wget https://github.com/jellyfin/jellyfin/releases/download/v10.4.3/jellyfin_10.4.3_linux-amd64.tar.gz tar xvzf jellyfin_10.4.3_linux-amd64.tar.gz Create a symbolic link to the Jellyfin 10.4.3 directory. This allows an upgrade by repeating the above steps and enabling it by simply re-creating the symbolic link to the new version. ln -s jellyfin_10.4.3 jellyfin Create four sub-directories for Jellyfin data. mkdir data cache config log Due to the number of command line options that must be passed, it is easiest to create a small script to run Jellyfin. nano jellyfin.sh Then paste the following commands and modify as needed. (i didnt have to modify anything) #!/bin/bash JELLYFINDIR="/opt/jellyfin" FFMPEGDIR="/usr/share/jellyfin-ffmpeg" $JELLYFINDIR/jellyfin/jellyfin \ -d $JELLYFINDIR/data \ -C $JELLYFINDIR/cache \ -c $JELLYFINDIR/config \ -l $JELLYFINDIR/log \ --ffmpeg $FFMPEGDIR/ffmpeg Assuming you desire Jellyfin to run as a non-root user, chmod all files and directories to your normal login user and group. Also make the startup script above executable. (i run it as root. if you choose to run it as root omit the chown command) chown -R user:group * chmod u+x jellyfin.sh Finally you can run it. You will see lots of log information when run, this is normal. Setup is as usual in the web browser. ./jellyfin.sh & in your browser go to localhost:8096 and set up as you wish ddbf83bb445699932bfd225c5449ff8baf323678 3288 3287 2022-01-01T15:35:29Z Wigums 609 wikitext text/x-wiki [[Category:Tutorials]] ''' jellyfin ''' Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media. It is an alternative to the proprietary Emby and Plex, to provide media from a dedicated server to end-user devices via multiple apps. Jellyfin is descended from Emby's 3.5.2 release and ported to the .NET Core framework to enable full cross-platform support. ''' Installation Process ''' this wiki assumes you are logged in as root Create a directory in /opt for jellyfin and its files, and enter that directory. mkdir /opt/jellyfin cd /opt/jellyfin Download the latest generic Linux build from the release page. The generic Linux build ends with "linux-amd64.tar.gz". The rest of these instructions assume version 10.4.3 is being installed (i.e. jellyfin_10.4.3_linux-amd64.tar.gz). Download the generic build, then extract the archive: wget https://github.com/jellyfin/jellyfin/releases/download/v10.4.3/jellyfin_10.4.3_linux-amd64.tar.gz tar xvzf jellyfin_10.4.3_linux-amd64.tar.gz Create a symbolic link to the Jellyfin 10.4.3 directory. This allows an upgrade by repeating the above steps and enabling it by simply re-creating the symbolic link to the new version. ln -s jellyfin_10.4.3 jellyfin Create four sub-directories for Jellyfin data. mkdir data cache config log Due to the number of command line options that must be passed, it is easiest to create a small script to run Jellyfin. nano jellyfin.sh Then paste the following commands and modify as needed. (i didnt have to modify anything) #!/bin/bash JELLYFINDIR="/opt/jellyfin" FFMPEGDIR="/usr/share/jellyfin-ffmpeg" $JELLYFINDIR/jellyfin/jellyfin \ -d $JELLYFINDIR/data \ -C $JELLYFINDIR/cache \ -c $JELLYFINDIR/config \ -l $JELLYFINDIR/log \ --ffmpeg $FFMPEGDIR/ffmpeg Assuming you desire Jellyfin to run as a non-root user, chmod all files and directories to your normal login user and group. Also make the startup script above executable. (i run it as root. if you choose to run it as root omit the chown command) chown -R user:group * chmod u+x jellyfin.sh Finally you can run it. You will see lots of log information when run, this is normal. Setup is as usual in the web browser. ./jellyfin.sh & in your browser go to localhost:8096 and set up as you wish cbd39bc57cf1ce49d394e58fbf1ef717d9d4125a User:Dchmelik 2 334 3289 3250 2022-03-24T02:35:15Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [[http://davidchmelik.com David Chmelik]], programmer since 1993 (CWU 2012 BSc.)<br> *Unix & Slackware user/programmer/scientist since 1997.<br> *Editor/creator of some wiki material since '00s.<br> *IRC [[irc://libera.chat/##slackware ##slackware]] & [[irc://libera.chat/#slackbuilds #slackbuilds]] & [[irc://libera.chat/#slackdocs #slackdocs]] DarwinElf<br> *Maintainer/creator of [[http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some]] [[http://SlackBuilds.org SlackBuilds]] since '10.<br> HOWTOS *[http://docs.slackware.com/wiki:user:dchmelil Slackware.com Docs: ][http://docs.slackware.com/howtos:zfs_home ZFS /home] tips *[[Decompress many]]<br> *[[Fonts update]]<br> *[[Git pull writable]]<br> *[[Thumbnails]]<br> 46a58484f746c41817de4f02701fa57cd4472b8f 3290 3289 2022-03-24T02:37:32Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [[http://davidchmelik.com David Chmelik]], programmer since 1993 (CWU 2012 BSc.)<br> *Unix & Slackware user/programmer/scientist since 1997.<br> *Editor/creator of some wiki material since '00s.<br> *IRC [irc://libera.chat/##slackware irc://libera.chat/##slackware] & [irc://libera.chat/#slackbuilds #slackbuilds] & [irc://libera.chat/#slackdocs #slackdocs] DarwinElf<br> *Maintainer/creator of [[http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some]] [[http://SlackBuilds.org SlackBuilds]] since '10.<br> HOWTOS *[http://docs.slackware.com/wiki:user:dchmelil Slackware.com Docs: ][http://docs.slackware.com/howtos:zfs_home ZFS /home] tips *[[Decompress many]]<br> *[[Fonts update]]<br> *[[Git pull writable]]<br> *[[Thumbnails]]<br> 3d2f0fdd996f698b40490fda94200698535dc7d9 3300 3290 2022-07-27T04:51:44Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [[http://davidchmelik.com David Chmelik]], programmer since 1993 (CWU 2012 BSc.)<br> *Unix & Slackware user/programmer/scientist since 1997.<br> *Editor/creator of some wiki material since '00s.<br> *IRC [irc://libera.chat/##slackware irc://libera.chat/##slackware] & [irc://libera.chat/#slackbuilds #slackbuilds] & [irc://libera.chat/#slackdocs #slackdocs] DarwinElf<br> *Maintainer/creator of [[http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some]] [[http://SlackBuilds.org SlackBuilds]] since '10.<br> HOWTOS *[http://docs.slackware.com/wiki:user:dchmelil Slackware.com Docs: ][http://docs.slackware.com/howtos:zfs_home ZFS /home] tips *[[decompress many]]<br> *[[fonts update]]<br> *[[git pull writable]]<br> *[[thumbnails]]<br> 7957978a80cfcbb32c6f2116d0d64e62134cb2f3 3301 3300 2022-07-27T04:54:14Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [[http://davidchmelik.com David Chmelik]], BSc (CWU 2012), programmer since 1993<br> *UNIX/*BSD & Slackware user/programmer/scientist since 1997.<br> *Editor/creator of some wiki material since '00s.<br> *IRC [irc://libera.chat/##slackware irc://libera.chat/##slackware] & [irc://libera.chat/#slackbuilds #slackbuilds] & [irc://libera.chat/#slackdocs #slackdocs] darwin<br> *Maintainer/creator of [[http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some]] [[http://SlackBuilds.org SlackBuilds]] since '10.<br> HOWTOS *[http://docs.slackware.com/wiki:user:dchmelil Slackware.com Docs: ][http://docs.slackware.com/howtos:zfs_home ZFS /home] tips *[[decompress many]]<br> *[[fonts update]]<br> *[[git pull writable]]<br> *[[thumbnails]]<br> 7ff8c330361fec1ff5e1b52a7b7c4fc2a3220b64 3302 3301 2022-07-27T04:55:50Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [http://davidchmelik.com David Chmelik], BSc (CWU 2012), programmer since 1993<br> *UNIX/*BSD & Slackware user/programmer/scientist since 1997<br> *Editor/creator of some wiki material since '00s<br> *IRC [irc://libera.chat/##slackware irc://libera.chat/##slackware] & [irc://libera.chat/#slackbuilds #slackbuilds] & [irc://libera.chat/#slackdocs #slackdocs] darwin<br> *Maintainer/creator of [[http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some]] [[http://SlackBuilds.org SlackBuilds]] since '10<br> HOWTOS *[http://docs.slackware.com/wiki:user:dchmelil Slackware.com Docs: ][http://docs.slackware.com/howtos:zfs_home ZFS /home] tips *[[decompress many]]<br> *[[fonts update]]<br> *[[git pull writable]]<br> *[[thumbnails]]<br> 2e7de18c908fceab86f2ad0bac307662050759b8 3303 3302 2022-07-27T04:56:25Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [http://davidchmelik.com David Chmelik], BSc (CWU 2012), programmer since 1993<br> *UNIX/*BSD & Slackware user/programmer/scientist since 1997<br> *Editor/creator of some wiki material since '0s<br> *IRC [irc://libera.chat/##slackware irc://libera.chat/##slackware] & [irc://libera.chat/#slackbuilds #slackbuilds] & [irc://libera.chat/#slackdocs #slackdocs] darwin<br> *Maintainer/creator of [[http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some]] [[http://SlackBuilds.org SlackBuilds]] since '10<br> HOWTOS *[http://docs.slackware.com/wiki:user:dchmelil Slackware.com Docs: ][http://docs.slackware.com/howtos:zfs_home ZFS /home] tips *[[decompress many]]<br> *[[fonts update]]<br> *[[git pull writable]]<br> *[[thumbnails]]<br> d0af0bef5b7a65fe5bd9a91bde8720d529ecb75f 3304 3303 2022-07-27T04:56:36Z Dchmelik 32 wikitext text/x-wiki philosopher-mathematician-scientist [http://davidchmelik.com David Chmelik], BSc (CWU 2012), programmer since 1993<br> *UNIX/*BSD & Slackware user/programmer/scientist since 1997<br> *Editor/creator of some wiki material since '0s<br> *IRC [irc://libera.chat/##slackware irc://libera.chat/##slackware] & [irc://libera.chat/#slackbuilds #slackbuilds] & [irc://libera.chat/#slackdocs #slackdocs] darwin<br> *Maintainer/creator of [http://slackbuilds.org/cgit/slackbuilds/log/?qt=author&q=David+Melik some] [http://SlackBuilds.org SlackBuilds] since '10<br> HOWTOS *[http://docs.slackware.com/wiki:user:dchmelil Slackware.com Docs: ][http://docs.slackware.com/howtos:zfs_home ZFS /home] tips *[[decompress many]]<br> *[[fonts update]]<br> *[[git pull writable]]<br> *[[thumbnails]]<br> 5122408fd220d3e1609ec649e494cbbbeb18caa0 Git clone writable 0 335 3293 3251 2022-07-23T05:49:49Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> #Bash function to make git clones writable (annoyingly, if you clone repository, some files are non-user-writable... which after compiling dangerously tempts 'sudo rm -rf!') git() { if [ $1 = "clone" ]; then command git "$@" && chmod -R u+w */.git; #you may prefer # command git "$@" && chmod -R rm -rf */.git; else command git "$@"; fi; } </pre> 77ee6e5dc9123d7315e85f817d3287bd0036037a 3294 3293 2022-07-23T05:50:07Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> #Bash function to make git clones writable (annoyingly, if you clone repository, some files are non-user-writable... which after compiling dangerously tempts 'sudo rm -rf!') git() { if [ $1 = "clone" ]; then command git "$@" && chmod -R u+w */.git; #you may prefer # command git "$@" && rm -rf */.git; else command git "$@"; fi; } </pre> 97690b017a72a72a0a21206903daecc4a81f7c4d 3296 3294 2022-07-27T04:46:05Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> # bash function to set git clones user-writable (annoyingly if you clone repository some files are non-user-writable... dangerously tempts 'sudo rm -rf'!) git() { if [ $1 = "clone" ]; then command git "$@" && chmod -R u+w */.git*; #you may prefer # command git "$@" && rm -fR */.git*; else command git "$@"; fi; } </pre> f67654322603095cdfbb0bcdaf7608f40628d6e7 3297 3296 2022-07-27T04:48:36Z Dchmelik 32 Dchmelik moved page [[Git pull writable]] to [[Git clone writable]] wikitext text/x-wiki [[Category:Tips]] <pre> # bash function to set git clones user-writable (annoyingly if you clone repository some files are non-user-writable... dangerously tempts 'sudo rm -rf'!) git() { if [ $1 = "clone" ]; then command git "$@" && chmod -R u+w */.git*; #you may prefer # command git "$@" && rm -fR */.git*; else command git "$@"; fi; } </pre> f67654322603095cdfbb0bcdaf7608f40628d6e7 3307 3297 2022-07-27T05:14:31Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> # bash function: set git clones user-writable (annoyingly if you clone some files are non-user-writable... dangerously tempts 'sudo rm -rf'!) git() { if [ $1 = "clone" ]; then # Might work. #find . -iname .git* -perm u-w -exec chmod u+w {} \+; command git "$@" && chmod -R u+w */.git*; #you may prefer # command git "$@" && rm -fR */.git*; else command git "$@"; fi; } </pre> 128fe1007f8db523a04076eb3a4f267a55c2ae68 3308 3307 2022-07-27T05:15:01Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> # bash function: set git clones user-writable (annoyingly if you clone some files are non-user-writable... dangerously tempts 'sudo rm -rf'!) git() { if [ $1 = "clone" ]; then # Might work. #find . -iname .git* -perm u-w -exec chmod u+w {} \+; command git "$@" && chmod -R u+w */.git*; # You may prefer. #command git "$@" && rm -fR */.git*; else command git "$@"; fi; } </pre> 9743649302ce0cd062569c164df385e75abd190e 3309 3308 2022-07-27T05:18:16Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> # bash function: set git clones user-writable (annoyingly if you clone some files are non-user-writable... dangerously tempts 'sudo rm -rf'!) git() { if [ $1 = "clone" ]; then # Might work. #sudo find . -iname .git* -perm u-w -exec chmod u+w {} \+; command git "$@" && chmod -R u+w */.git*; # You may prefer. #command git "$@" && rm -fR */.git*; # Uncomment section to SlackBuilds.org version naming convention compress. #d='$@' #d=https://github.com/user/project.git; #d=${d##*/} #d=${d%.git} #cd $d #VERSION=$(git log --pretty=format:'%cd_%h' --date=format:'%Y%m%d' | head -n 1) #cd .. #tar --exclude-vcs -cJvf $d-$VERSION.tar.xz $d else command git "$@"; fi; } </pre> 35bf936c6ea6f5f2df41a82d3a970cf328012a88 3310 3309 2022-07-27T05:18:38Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> # bash function: set git clones user-writable (annoyingly if you clone some files are non-user-writable... dangerously tempts 'sudo rm -rf'!) git() { if [ $1 = "clone" ]; then # Might work. #sudo find . -iname .git* -perm u-w -exec chmod u+w {} \+; command git "$@" && chmod -R u+w */.git*; # You may prefer. #command git "$@" && rm -fR */.git*; # Uncomment section to SlackBuilds.org version naming convention compress. #d='$@' #d=https://github.com/user/project.git #d=${d##*/} #d=${d%.git} #cd $d #VERSION=$(git log --pretty=format:'%cd_%h' --date=format:'%Y%m%d' | head -n 1) #cd .. #tar --exclude-vcs -cJvf $d-$VERSION.tar.xz $d else command git "$@"; fi; } </pre> 6d0d0361fe1287d859101cab578887207e8cf77d 3311 3310 2022-07-27T09:31:32Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> # bash function: set git clones user-writable (annoyingly if you clone some files are non-user-writable... dangerously tempts 'sudo rm -rf'!) git() { if [ $1 = "clone" ]; then # Might work. #sudo find . -iname .git* -perm u-w -exec chmod u+w {} \+; command git "$@" && chmod -R u+w */.git*; # You may prefer. #command git "$@" && rm -fR */.git*; # Uncomment section to SlackBuilds.org version naming convention compress. #d='$@' #d=${d##*/} #d=${d%.git} #cd $d #VERSION=$(git log --pretty=format:'%cd_%h' --date=format:'%Y%m%d' | head -n 1) #cd .. #tar --exclude-vcs -cJvf $d-$VERSION.tar.xz $d else command git "$@"; fi; } </pre> 49ede8393dad05869588443fbf082090941ec859 3312 3311 2022-08-28T11:29:50Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> # Annoyingly some 'git clone' files aren't user-writable: dangerously tempts 'sudo rm -rf'!. Bash function. # Writable git clone git() { command git "$@" if [ $1 = 'clone' ]; then d="$@"; d=${d##*/}; d=${d%.git}; d=${d##* } #read -p "dir: $d" if [ -d "$d" ]; then chmod -R u+w $d/.git* # Maybe faster than previous line. #find $d -iname .git* -perm u-w -exec chmod u+w {} \+ cd $d VERSION=$(git log --pretty=format:'%cd_%h' --date=format:'%Y%m%d' | head -n 1) # Maybe faster than above chmod/find. #rm -fR .git* cd .. tar --exclude-vcs -cJvf $d-$VERSION.tar.xz $d else echo "save/download error" fi fi; } </pre> 5ee90660bd2caa611ea459d380ffac6dfe1e693f The Regulars 0 4 3295 3223 2022-07-27T04:41:14Z Dchmelik 32 wikitext text/x-wiki ==Staff== * [[User:Alan_Hicks|Alan Hicks]] * [[User:alienbob|alienBOB]] * nachox/darkjoker * [[User:phrag|phrag]] * [[User:rworkman|rworkman]] * [[User:Stx|Stx]] * [[User:Unixfool|Unixfool/W|GGL|T]] ==Others== * [[User:Adioe3|adioe3]] * [[User:Alisonken1|Alisonken1]] * [[User:Apeitheo|Apeitheo]] * [[User:Boojit|boojit]] * [[User:Michiel |BP{k}]] * [[User:Buzzedlightyear|Buzzedlightyear]] * [[User:chopp|chopp]] * [[User:Chrismo|Chrismo]] * [[User:clavius|clavius]] * [[User:Clientkill|Clientkill]] * [[USer:codermaniac|codermaniac]] * [[User:Crudo|crudo]] * [[User:Crypticlineage|crypticlineage]] * [[User:dadexter|dadexter]] * [[User:dchmelik|darwin]] * [[User:derxob|derxob]] * [[User:Dominian|Dominian]] * dtanner * [[eclipse75]] * [[User:Erik|erik]] * [[User:FredEmmott|fred]] * [[User:giangy|giangy]] * [[User:jcm |jcm]] * [[User:jpipkin |jpipkin]] * [[User:macavity|macavity]] * [[User:Marcus | Marcus_]] * [[User:Mmlj4|mmlj4]] * [[User:natex|natex]] * [[USer:Phoul|Phoul]] * [[User:Dardan Fejzullahi |radiohead]] * [[User:radi0head|radi0head]] * Riddick * [[User:robert-brown|robert-brown]] * [[User:1337ln | ron1n]] * [[User:Ryanx0r|Ryanx0r]] * [[USer:slackmagic|slackmagic]] * [[User:Slakmagik|slakmagik]] * [[StevenR]] * [[User:Straterra|Straterra]] * [[USer:Strykar|Strykar]] * [[User:tecky|tecky]] * [[User:Tewmten|tewmten]] * [[User:v3ctor|v3ctor]] * [[User:Zordrak|Zordrak]] ==SlackWiki Admins== There is a [[Special:Listadmins|list]] of SlackWiki admins. Please contact one if you think you'd be a suitable admin. 457fb63209b1bbfe674c7942b61f7c196ab4eeaa Git pull writable 0 341 3298 2022-07-27T04:48:36Z Dchmelik 32 Dchmelik moved page [[Git pull writable]] to [[Git clone writable]] wikitext text/x-wiki #REDIRECT [[Git clone writable]] 8411865e774b1f47a2d4c41b79c1eab3b80cf212 Decompress many 0 337 3299 3240 2022-07-27T04:51:30Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> # bash function to decompress (unarchive) many formats. function unarc() { if [ -f $1 ]; then case $1 in *.tar.*) tar xvf $1;; *.bz2) bunzip2 $1;; *.gz) gunzip $1;; *.jar) jar xvf $1;; *.lha) lha e $1;; *.tar) tar xvf $1;; *.tar.bz2) tar xvf $1;; *.tar.gz) tar xvf $1;; *.tar.xz) tar xvf $1;; *.tar.Z) tar xvf $1;; *.rar) rar x $1;; *.7z) 7z x $1;; *.tbz2) tar xvf $1;; *.tgz) tar xvf $1;; *.txz) tar xvf $1;; *.xz) unxz $1;; *.Z) uncompress $1;; *.zip) unzip $1;; *) echo '"$1" cannot be extracted.';; esac else echo '"1" cannot be extracted.'; fi } </pre> 3c868c0d8071c2d7eea90e4cc371cef05681165e 3313 3299 2022-08-28T11:30:34Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> # bash function to decompress (unarchive) many formats. function unarc() { if [ -f $1 ]; then case $1 in *.tar.*) tar xvf $1;; *.bz2) bunzip2 $1;; *.gz) gunzip $1;; *.jar) jar xvf $1;; *.lha) lha e $1;; *.tar) tar xvf $1;; *.tar.bz2) tar xvf $1;; *.tar.gz) tar xvf $1;; *.tar.xz) tar xvf $1;; *.tar.Z) tar xvf $1;; *.rar) rar x $1;; *.7z) 7z x $1;; *.tbz2) tar xvf $1;; *.tgz) tar xvf $1;; *.txz) tar xvf $1;; *.xz) unxz $1;; *.Z) uncompress $1;; *.zip) unzip $1;; *) echo '"$1" extraction error.';; esac else echo '"1" nonexistent?'; fi } </pre> 6257a51fe0fb011cc3e3983b27577fb1ef200982 3314 3313 2022-08-28T11:31:55Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> # bash function: decompress an archive file of any of many formats # Decompress archive file. function unarc() { if [ -f $1 ]; then case $1 in *.tar.*) tar xvf $1;; *.bz2) bunzip2 $1;; *.gz) gunzip $1;; *.jar) jar xvf $1;; *.lha) lha e $1;; *.tar) tar xvf $1;; *.tar.bz2) tar xvf $1;; *.tar.gz) tar xvf $1;; *.tar.xz) tar xvf $1;; *.tar.Z) tar xvf $1;; *.rar) rar x $1;; *.7z) 7z x $1;; *.tbz2) tar xvf $1;; *.tgz) tar xvf $1;; *.txz) tar xvf $1;; *.xz) unxz $1;; *.Z) uncompress $1;; *.zip) unzip $1;; *) echo '"$1" extraction error.';; esac else echo '"1" nonexistent?'; fi } </pre> 0a30f965f9fee518500c8e4c60e0eb3264c2a132 Fonts update 0 332 3305 3238 2022-07-27T04:57:54Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> #!/bin/sh # Update fonts. mkfontdir mkfontscale # Scan directories with apparently valid caches (-f, --force,) verbose (-v, --verbose) (see also man fc-cache): fc-cache -f -v </pre> eb5de0a27fc23384b4cb49087ac7b0ed51302c9c Thumbnails 0 333 3306 3235 2022-07-27T04:58:45Z Dchmelik 32 wikitext text/x-wiki [[Category:Tips]] <pre> #!/bin/sh # For every .jpg in a directory, create a thumbnail (smaller) image at 280 pixels high (or comment out, uncomment similar line, for width): # Resize to 280 pixels height. for file in *.jpg; do convert -resize x280 "$file" "t$file"; done # Resize to 280 pixels width. #for file in *.jpg; do convert -resize 280 "$file" "t$file"; done </pre> 2eaea1ade6c0548c68b3ea7dc24547585953d4d5 User:Mmlj4 2 342 3318 2023-07-12T15:14:51Z Mmlj4 322 Created page with "I'm Joey Kelly (http://joeykelly.net), a *nix admin/programmer and ordained minister of the gospel." wikitext text/x-wiki I'm Joey Kelly (http://joeykelly.net), a *nix admin/programmer and ordained minister of the gospel. bf3ae73574ebed94d6cf4f2e096e9d0aac5c5283 Plymouth 0 343 3398 2025-01-09T01:36:26Z Wigums 609 Created page with "== plymouth == Plymouth is an application that runs very early in the boot process (even before the root filesystem is mounted!) that provides a graphical boot animation while the boot process happens in the background. you can install plymouth on slackware from [https://slackbuilds.org/repository/15.0/system/plymouth/?search=plymouth plymouth] for which i use [[sbotools]] which is at [https://slackbuilds.org/repository/15.0/system/sbotools/ sbotools] once plymouth..." wikitext text/x-wiki == plymouth == Plymouth is an application that runs very early in the boot process (even before the root filesystem is mounted!) that provides a graphical boot animation while the boot process happens in the background. you can install plymouth on slackware from [https://slackbuilds.org/repository/15.0/system/plymouth/?search=plymouth plymouth] for which i use [[sbotools]] which is at [https://slackbuilds.org/repository/15.0/system/sbotools/ sbotools] once plymouth is installed edit /etc/dracut.conf.d/myflags.conf and add this line <code>add_dracutmodules+=" plymouth "</code> edit your /etc/default/grub to include <code>GRUB_CMDLINE_LINUX_DEFAULT="splash"</code> themes are in /usr/share/plymouth/themes to view available themes <code>plymouth-set-default-theme -l</code> to set the theme <code>plymouth-set-default-theme <theme-name></code> to list available themes <code>dracut --list-modules</code> load plymouth module <code>dracut --add-drivers plymouth</code> build new initrd <code>dracut --force /boot/initrd-<kernel-version>.img</code> update your bootloader to use the new initrd. i use grub2 <code>grub-mkconfig -o /boot/grub/grub.cfg</code> reboot f67a170dd3356094404e7fded14d482efe193768 3399 3398 2025-01-09T01:43:53Z Wigums 609 /* plymouth */ wikitext text/x-wiki == plymouth == Plymouth is an application that runs very early in the boot process (even before the root filesystem is mounted!) that provides a graphical boot animation while the boot process happens in the background. you can install plymouth on slackware from [https://slackbuilds.org/repository/15.0/system/plymouth/?search=plymouth plymouth] for which i use [[sbotools]] which is at [https://slackbuilds.org/repository/15.0/system/sbotools/ sbotools] once plymouth is installed edit /etc/dracut.conf.d/myflags.conf and add this line <code>add_dracutmodules+=" plymouth "</code> edit your /etc/default/grub to include <code>GRUB_CMDLINE_LINUX_DEFAULT="splash"</code> themes are in /usr/share/plymouth/themes to view available themes <code>plymouth-set-default-theme -l</code> to set the theme <code>plymouth-set-default-theme <theme-name></code> to list available themes <code>dracut --list-modules</code> load plymouth module <code>dracut --add-drivers plymouth</code> build new initrd <code>dracut --force /boot/initrd-<kernel-version>.img</code> update your bootloader to use the new initrd. i use grub2 <code>grub-mkconfig -o /boot/grub/grub.cfg</code> reboot --[[User:Wigums|Wigums]] ([[User talk:Wigums|talk]]) 01:43, 9 January 2025 (UTC) f02c721a3075329d2023569871d367b362a423af 3400 3399 2025-01-09T02:02:52Z Wigums 609 /* plymouth */ wikitext text/x-wiki [[Category:Tutorials]] == plymouth == Plymouth is an application that runs very early in the boot process (even before the root filesystem is mounted!) that provides a graphical boot animation while the boot process happens in the background. you can install plymouth on slackware from [https://slackbuilds.org/repository/15.0/system/plymouth/?search=plymouth plymouth] for which i use [[sbotools]] which is at [https://slackbuilds.org/repository/15.0/system/sbotools/ sbotools] once plymouth is installed edit /etc/dracut.conf.d/myflags.conf and add this line <code>add_dracutmodules+=" plymouth "</code> edit your /etc/default/grub to include <code>GRUB_CMDLINE_LINUX_DEFAULT="splash"</code> themes are in /usr/share/plymouth/themes to view available themes <code>plymouth-set-default-theme -l</code> to set the theme <code>plymouth-set-default-theme <theme-name></code> to list available themes <code>dracut --list-modules</code> load plymouth module <code>dracut --add-drivers plymouth</code> build new initrd <code>dracut --force /boot/initrd-<kernel-version>.img</code> update your bootloader to use the new initrd. i use grub2 <code>grub-mkconfig -o /boot/grub/grub.cfg</code> reboot --[[User:Wigums|Wigums]] ([[User talk:Wigums|talk]]) 01:43, 9 January 2025 (UTC) c3636497edb7de921db56a779d21e03dca6a99a7